tuya / tuya-home-assistant

Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
MIT License
871 stars 206 forks source link

Home Assistant 2021.11.x breaks Tuya light strip #684

Open bkr1969 opened 2 years ago

bkr1969 commented 2 years ago

I have under cabinet lights that run in the Tuya app. (Torchstar brand) They have worked fine in HA until updating the core to 2021.11.2. My power cords still work but the lights now only show in the configuration as a device, but not an entity. They say “unsupported” next to them. I restored 2021.10.x and they fine again. Why would they not work in HA if they still show/work in the Tuya app? I have also confirmed the device type as "dj" which is definitely listed under supported devices.

Moustik2002 commented 2 years ago

Hello i've same problem with all my Zigbee lights handled by Tuya protocol image

Log error :

Logger: homeassistant.components.light Source: components/tuya/light.py:400 Integration: Lumière (documentation, issues) First occurred: 11:58:51 (1 occurrences) Last logged: 11:58:51

Error while setting up tuya platform for light Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform await asyncio.shield(task) File "/usr/src/homeassistant/homeassistant/components/tuya/light.py", line 316, in async_setup_entry async_discover_device([*hass_data.device_manager.device_map]) File "/usr/src/homeassistant/homeassistant/components/tuya/light.py", line 309, in async_discover_device TuyaLightEntity( File "/usr/src/homeassistant/homeassistant/components/tuya/light.py", line 400, in init device.status_range[self._brightness_dpcode].values KeyError: <DPCode.BRIGHT_CONTROLLER: 'bright_controller'>

Find some Pull request which is talking about it, but still do not know how to fix it.

--> https://github.com/home-assistant/core/pull/58280

almighty059 commented 2 years ago

@Moustik2002 @bkr1969 I've had this problem for months. It doesn't affect me that much because I use LocalTuya however I would still like to figure out what's wrong and how to fix it. I think it's a Tuya issue but I'm not sure. I currently have a ticket open and they're working with me to try and find out but I don't think we're making much progress. If either of you figured out the problem please let me know. Thanks.

Moustik2002 commented 2 years ago

Hi @almighty059 unfortunately i'm not able to help i've switched to zigbee2mqqt 6 months ago

almighty059 commented 2 years ago

@Moustik2002 I actually just figured it out. Two of my Tuya devices were causing the Tuya integration to break but I don't know why yet. When I remove them all of the lights come back and function correctly. The devices were two switches, one was an outlet socket that gets plugged into the wall outlet and the other was a hardwired switch that gets put inside of the electrical box.

I actually just noticed that you said your "power cords" still work correctly. I assume that they were Tuya smart power cords and probably considered switches just like mine. If that is all that you were using then I bet if you would have removed the power cords from the Tuya integration the lights would have started working correctly again. If that's true then the power switches are breaking the integration of any devices that use the light domain.

Thanks for the response though because I think your issue confirmed what's happening with with devices.