Open WarrenSchultz opened 1 year ago
Hey there @tuya, @zlinoliver, @frenck, mind taking a look at this issue as it has been labeled with an integration (tuya
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
tuya documentation tuya source (message by IssueLinks)
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
This is still an issue.
A mí me ocurre lo mismo. En ninguno de los dispositivos con ventilador y luz funciona el ventilador, la luz sí funciona
I have the same problem for two of the fans I have. Light works great. The controls from the Tuya IoT cloud works fine, but on HA the switch for the fan is grayed out and not able to be selected.
I have the same problem for two of the fans I have. Light works great. The controls from the Tuya IoT cloud works fine, but on HA the switch for the fan is grayed out and not able to be selected.
+1
I am having the same problem as you. The light portion works great but the fan entity has an error. Might be an issue with the Fan speed % ?
2024-02-07 15:01:00.799 ERROR (MainThread) [homeassistant.components.fan] Error adding entities for domain fan with platform tuya
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 533, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 782, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1325, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 989, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1110, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1049, in __async_calculate_state
attr.update(self.state_attributes or {})
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 426, in state_attributes
data[ATTR_PERCENTAGE] = self.percentage
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/tuya/fan.py", line 253, in percentage
return ordered_list_item_to_percentage(self._speeds.range, value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/percentage.py", line 32, in ordered_list_item_to_percentage
raise ValueError(f'The item "{item}" is not in "{ordered_list}"')
ValueError: The item "2" is not in "['1', '2', '3', '4', '5', '6']"
2024-02-07 15:01:00.805 ERROR (MainThread) [homeassistant.components.fan] Error while setting up tuya platform for fan
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 352, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 533, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 782, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1325, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 989, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1110, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1049, in __async_calculate_state
attr.update(self.state_attributes or {})
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 426, in state_attributes
data[ATTR_PERCENTAGE] = self.percentage
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/tuya/fan.py", line 253, in percentage
return ordered_list_item_to_percentage(self._speeds.range, value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
same issue, I have multiple Fans w Lights, only then Light works and it works well, But the Fan is greyed out. Tried local Tuya for the Fan and it works, but wish it just works with Tuya cloud integration.
Logger: homeassistant.components.fan Source: helpers/entity_platform.py:576 integration: Fan (documentation, issues) First occurred: 4:30:30 AM (3 occurrences) Last logged: 4:30:30 AM
Error adding entity fan.living_room_fan_2 for domain fan with platform tuya
Error adding entity fan.wallace_room_fan_2 for domain fan with platform tuya
Error adding entity fan.master_bedroom_fan_2 for domain fan with platform tuya
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 576, in _async_add_entities
await coro
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 865, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1328, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 992, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1113, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1052, in __async_calculate_state
attr.update(self.state_attributes or {})
^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 426, in state_attributes
data[ATTR_PERCENTAGE] = self.percentage
^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/tuya/fan.py", line 253, in percentage
return ordered_list_item_to_percentage(self._speeds.range, value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/percentage.py", line 32, in ordered_list_item_to_percentage
raise ValueError(f'The item "{item}" is not in "{ordered_list}"')
ValueError: The item "5" is not in "['1', '2', '3', '4', '5', '6']"
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Unfortunately, this issue still exists.
if it sheds some light I have two tuya ceiling fans. Different brands. They both have the same interface yet one is working while the other is not.
Watching the APIs this is what I see in the debug options.
The one that works has fan speed declared like this:
fan_speed_percent | Integer | { "unit": "档", "min": 1, "max": 6, "scale": 0, "step": 1 } -- | -- | --While the one that doesn't works looks like this:
fan_speed | Enum | { "range": [ "1", "2", "3", "4", "5", "6" ] } -- | -- | --So basically one is an int and the other is an enum that is taking it's value as a string instead of an int.
Still having this same issue.
Yes, still the same... fan portion is not working.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Sadly this is still an issue. There was a related fix on 2024.10.2 with #127860 but sadly it didn't seems that the issue is fixed. I'm still getting the same error after updating to the latest version.
Here you can see the detailed error.
2024-10-30 22:48:12.112 ERROR (MainThread) [homeassistant.components.fan] Error adding entity fan.ceiling_fan_with_light for domain fan with platform tuya Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 595, in _async_add_entities await coro File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 909, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1366, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state self.__async_calculate_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1069, in __async_calculate_state if state_attributes := self.state_attributes: ^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 255, in __getattribute__ return super().__getattribute__(__name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 522, in state_attributes data[ATTR_PERCENTAGE] = self.percentage ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 255, in __getattribute__ return super().__getattribute__(__name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/tuya/fan.py", line 258, 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 "2" is not in "['1', '2', '3', '4', '5', '6']" 2024-10-30 22:48:13.072 WARNING (MainThread) [homeassistant.components.netatmo] Webhook not registered - https and port 443 is required to register the webhook 2024-10-30 22:48:30.036 ERROR (MainThread) [homeassistant.helpers.dispatcher] Exception in async_write_ha_state when dispatching 'tuya_entry_update_bfb7e686aea4514141tgo5': () Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1005, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1130, in _async_write_ha_state self.__async_calculate_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1069, in __async_calculate_state if state_attributes := self.state_attributes: ^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 255, in __getattribute__ return super().__getattribute__(__name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 522, in state_attributes data[ATTR_PERCENTAGE] = self.percentage ^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/fan/__init__.py", line 255, in __getattribute__ return super().__getattribute__(__name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/tuya/fan.py", line 258, 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 "2" is not in "['1', '2', '3', '4', '5', '6']"
The problem
Installed a new ceiling fan, added to existing Tuya dev account. Light on the fan works great in HA as well as the existing lights I have already working in HA.
The logs show two issues, and I've attached the API debug code below. Please let me know what additional data would be helpful.
What version of Home Assistant Core has the issue?
core-2023.7.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Tuya
Link to integration documentation on our website
https://www.home-assistant.io/integrations/tuya
Diagnostics information
config_entry-tuya-316d98b503531be03fb470264599afd5.json.txt
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
From the API debug panel, these are the status and setting configuration values
`
switch | Boolean | "{true,false}" -- | -- | -- mode | Enum | { "range": [ "normal", "sleep", "nature" ] } fan_speed | Enum | { "range": [ "1", "2", "3", "4", "5", "6" ] } fan_direction | Enum | { "range": [ "forward", "reverse" ] } light | Boolean | "{true,false}" bright_value | Integer | { "min": 0, "max": 100, "scale": 0, "step": 1 } temp_value | Integer | { "min": 0, "max": 100, "scale": 0, "step": 1 } countdown_set | Enum | { "range": [ "cancel", "1h", "2h", "4h", "8h" ] }`