rospogrigio / localtuya

local handling for Tuya devices
GNU General Public License v3.0
2.99k stars 565 forks source link

Different fan control dimmers #123

Open vadss opened 4 years ago

vadss commented 4 years ago

Hi, i have two fan controllers, they have 5 step control step and can't control it now.

  1. This if first product with additional light turn on off, which works. https://aliexpress.com/item/4000214394624.html
Standard Function Set Code Type Values
switch Boolean {true,false}
light Boolean {true,false}
fan_speed_percent Integer {"min":1,"max":5,"scale":0,"step":1}
Standard State Set Code Type Values
switch Boolean {true,false}
light Boolean {true,false}
fan_speed_percent Integer {"min":1,"max":5,"scale":0,"step":1}
  1. In app it has only 5 steps of controlling a fan, but it shows more https://aliexpress.com/item/4000235813178.html

Standard Function Set

Code Type Values
switch Boolean {true,false}
fan_speed Enum {"range":["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26"]}
countdown Enum {"range":["0","1","2","3","4","5","6"]}
Standard State Set Code Type Values
switch Boolean {true,false}
fan_speed Enum {"range":["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26"]}
countdown Enum {"range":["0","1","2","3","4","5","6"]}

Thanks for integration, hope it helps.

postlund commented 4 years ago

I think this is somewhat related to #75, but we might need to do some adjustments.

vadss commented 4 years ago

@postlund So will it be possible to try to control fan in this range {"range":["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26"]} ? Is it possible to test if it is possible now somehow?

postlund commented 4 years ago

@vadss We will have to make the range configurable. But first we need to get the changes in #75 merged.

vadss commented 4 years ago

@postlund Thank you! Can't wait to test if it will work. Sadly, i don't have skill to help with programming. But will gladly help to test if needed.

ThomasADavis commented 4 years ago

Let me think about it. Homeassistant doesn't support a fan controller with this many speeds.

There is talk about changing the fan controller, but no major progress on implementing it I have found.

postlund commented 4 years ago

Right, that's a problem of course. But maybe we can interpolate the speeds we have in HA to the speeds supported by the fan for now (like how we map the about 1000 brightness levels a light has to the 255 supported by HA)? It will be horrible resolution, but at least it's usable.

ThomasADavis commented 4 years ago

Well, the other idea I have had is to use the low/high as speed down/up buttons, and let the medium speed display the current true speed. This would would work in the current model, and accommodate more fans..

postlund commented 4 years ago

That would work too I guess. Better from the perspective that you can use all speeds.

vadss commented 4 years ago

It maybe will not work at all, so just maybe implent to test. I have another component for Xiaomi device https://github.com/NikolayBorisov/xiaomi_airfresh and it adds service fan.airfresh_set_favourite_speed (speed: 1-200) to change fan speed.

vadss commented 3 years ago

So is it possible to test this changes somehow if they were made?