This is wild! I’ve not observed any of this except whenever I used the wrong commands in the setup. Mine have been rock solid since but your devices are obviously requiring something different. I wonder what the difference is and more importantly can we put in a PR to code against it. I am using two different tuya fan controllers.
Just installed a new fan and have come across this same issue. I have a 6 speed Fanco Infinity fan with no light.
The primary issue is identical to above where setting a speed in home assistant causes the fan to turn off and the speed in HA to revert to the previous remote setting.
If i use the tuya app or remote to change the fan speed HA reflects this change correctly.
The default tuya integration seems to have a 0-100 slider and works fine triggering the fan speed to change to the nearest appropriate value (1-6)
My fan also has a natural wind mode where it changes the speed periodically between 2 and 6. I have that working as a separate select entity also. Couldn’t see how else to do it.
@mjanofsky I have tread through this whole thread and I am still very confused on what is going on with my setup and I would really appreciate some help. I purchased two of these last year:
Both work with Google Assistant and the include controller. But I can’t get them to work on Local Tuya for the life of me. This is what I see when I go to add the entity:
As you can see, I’m seeing ID instead of DPS# at the top. Not sure what to do about that. Toggling the fan in Devices does absolutely nothing, regardless of whether the fan is on or not.
In order to provide full details, I am running Home Assistant on my Windows NUC via VirtualBox.
Home Assistant 2022.7.6
Supervisor 2022.07.0
Operating System 8.2
Frontend 20220707.1 - latest
Local Tuya v4.0.1
I know Local Tuya works with my smart outlets as I had added one as a switch, which worked beautifully, even as a button on my dashboard.
My goal for this ceiling fan/light control in HA is a button for the light to turn on/off and a way to adjust the fan between the off/3 speeds (4 settings I guess).
I was facing too the problem about the fan speed. It was not working properly when sending a percentage. Looking at the code and debugging I was able to solve the issue.
I already have the lights and setup via localtuya working with HA. I just need to figure out how to add the mode: ‘normal, sleep, nature’ so that I won’t have to rely on the smart app to do so.
After hours of playing around with the LocalTuya, I was finally able to get this Smart Ceiling Fan 52’’ " to work with HA emulating the settings from the SmartHome app.
See Images
Settings to choose via LocalTuya: Select & DP2
Basically localtuya 4.1.1 has sought to address the issue, but for some reason I don’t see the new configuration option that allows you to choose str or int, and as the code assumes str type its essentially reverted to the issue state for me.
I’ve reversed the logic in fan.py as a workaround that suits my situation:
Changed line 78…
self._dps_type = int if self._config.get(CONF_FAN_DPS_TYPE) == "int" else str
To…
self._dps_type = str if self._config.get(CONF_FAN_DPS_TYPE) == "str" else int
I do see the option to choose string or int at the bottom of the fan configuration page. and int does seem to work for me where as i has the issue before same as others.
Last thing i’m trying to figure out is the fan modes. I can do it as a seperate entity but id love to have just one fan entity.