Tuya V2 - Ceiling fan with Light. Light entity OK but Fan entity is unavailable

Hi every one,

Just got a ceiling fan with integrated light that I successfully paired with the Tuya app.

The device shows up into Hass and created 2 devices as you can see below:

So the light entity works just fine. I can turn on the light, set the temperature and dim it.

The Fan entity shows up but the switch on/off shows up as “unavailable”
The Speed settings is ok as well as the mode selection
image

What is funny is that both the speed setting and mode selection are working if and only if I turn on the fan beforehands using the remote or the tuya app on my phone.

So long story short, this disabled switch will prevent me to actually fully control the fan.
Is there anything I am doing wrong?

Thanks!

Hi,

I’ve been deleting and adding the fan again and again with no success.
It works perfectly through the Tuya app but still wont’t work in hass

Any idea?

Thanks!

Did you ever figure this out? I have a Reiga fan, same issue. I thought the fan entity was working but I might be mistaken. It definitely isn’t now.

same here, light is working but fan is unavailable. I tried with local tuya as well but can’t seem to control fan speeds correctly (fan on/off and light on/off works)

exactly the same here!
Really looking forward for any tips or hints or hopefully an integration update to fix this

Use local tuya. It is faster and u can control fan and light

What is local Tuya? Do not understand…

traceback say an error in a variable format?

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 608, in _async_add_entities
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 927, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1384, in add_to_platform_finish
    self.async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1087, in __async_calculate_state
    if state_attributes := self.state_attributes:
                           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 402, in state_attributes
    data[ATTR_PERCENTAGE] = self.percentage
                            ^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/tuya/fan.py", line 257, in percentage
    return ordered_list_item_to_percentage(self._speeds.range, value)
  File "/usr/src/homeassistant/homeassistant/util/percentage.py", line 29, in ordered_list_item_to_percentage
    raise ValueError(f'The item "{item}" is not in "{ordered_list}"')
ValueError: The item "1" is not in "['1', '2', '3', '4', '5', '6']"