finity69x2 / fan-percent-button-row

Frontend plugin to control fans in Home Assistant using percent values for speeds
32 stars 19 forks source link

Off button not working #29

Closed steveothesane closed 2 years ago

steveothesane commented 2 years ago

I have a Tuya ceiling fan controller that now uses percentages, I'm assuming, since the entity uses a slider with four positions and the button card wouldn't work any more. So I tried the percent card and everything works as expected except I can't turn it off with the off button. Tell me what you need to see from the logs and I'll provide it to you. Any help would be appreciated. Thank you.

zhushp commented 2 years ago

Same here for my Xiaomi fan, the issue is at the setPercentage function here:

this.hass.callService('fan', 'turn_off', param);
param.percentage = this._offSP;
this.hass.callService('fan', 'set_percentage', param);

It turns off the fan, then send another set_percentage to 0 signal which would turn on the fan again. Removing the 2nd and 3rd line above makes it work. Created a PR #30 for the same.

finity69x2 commented 2 years ago

I merged the PR.

Hopefully I don't get a flood of "hey this used to work...!" issues now.

:)