home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
69.7k stars 28.86k forks source link

Tuya Integration is not reliable anymore after upgrading from 2024.1.2 to 2024.2.1 #110357

Open StefanoGiu opened 4 months ago

StefanoGiu commented 4 months ago

The problem

Tuya Integration is not reliable anymore after upgrading from 2024.1.2 to 2024.2.1

What version of Home Assistant Core has the issue?

core-2024.2.1

What was the last working version of Home Assistant Core?

core-2024.1.2

What type of installation are you running?

Home Assistant Core

Integration causing the issue

tuya

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 4 months 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!

Code owner commands Code owners of `tuya` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign tuya` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


tuya documentation tuya source (message by IssueLinks)

TiborJaszi commented 4 months ago

I face similar issues with my cover status. It remains open even if the SmartLife app shows it as closed. Restarting home assistant usually solves the issue for a while.

codegeek commented 4 months ago

I am also experiencing issues after the update to 2024.2.1. My automations are working for a tuya-enabled wall switch, lights turn on at dusk, and off at dawn, but the status of the light switches no longer updates on the dashboard. When I updated, I had to re-login to Tuya and ended up having to re-add the device. I am looking at the diagnostics, and I do see the status of the switches correctly, but they are not reflected on the UI.

albanleandri commented 4 months ago

I also have the issue under 2024.1.6

LoekSmeets98 commented 4 months ago

Same issue here. This is my Tuya config file:

{ "home_assistant": { "installation_type": "Home Assistant Core", "version": "2023.7.3", "dev": false, "hassio": false, "virtualenv": true, "python_version": "3.11.5", "docker": false, "arch": "x86_64", "timezone": "Europe/Amsterdam", "os_name": "Linux", "os_version": "4.4.302+", "run_as_root": false }, "custom_components": { "enphase_envoy": { "version": "0.0.19", "requirements": [ "pyjwt", "xmltodict", "httpx", "envoy_utils" ] }, "dyson_local": { "version": "1.3.10", "requirements": [ "paho-mqtt" ] }, "hacs": { "version": "1.34.0", "requirements": [ "aiogithubapi>=22.10.1" ] } }, "integration_manifest": { "domain": "tuya", "name": "Tuya", "codeowners": [ "@Tuya", "@zlinoliver", "@frenck" ], "config_flow": true, "dependencies": [ "ffmpeg" ], "dhcp": [ { "macaddress": "105A17" }, { "macaddress": "10D561" }, { "macaddress": "1869D8" }, { "macaddress": "381F8D" }, { "macaddress": "508A06" }, { "macaddress": "68572D" }, { "macaddress": "708976" }, { "macaddress": "7CF666" }, { "macaddress": "84E342" }, { "macaddress": "D4A651" }, { "macaddress": "D81F12*" } ], "documentation": "https://www.home-assistant.io/integrations/tuya", "integration_type": "hub", "iot_class": "cloud_push", "loggers": [ "tuya_iot" ], "requirements": [ "tuya-iot-py-sdk==0.6.6" ], "is_built_in": true }, "data": { "endpoint": "https://openapi.tuyaeu.com", "auth_type": 0, "country_code": "31", "app_type": "smartlife", "mqtt_connected": null, "disabled_by": null, "disabled_polling": false, "devices": [] } }

froachy commented 4 months ago

I am experiencing this same described issue on 2024.1.6. Restarting the container fixes temporarily.

Geel-Sponsie commented 4 months ago

I have the same issue on 2024.1.2.

Kiphouder commented 4 months ago

Same problem - no status updates/feedback loop - reloading integration is only way to get status update.

Here's some information to help diagnose the issue: (in my situation), the integration to send commands seems to be working, the problem seems to be in the status updates.

When I send hardcoded commands to turn something on or off (via automations), the socket will turn on and off, but the state of the device control in HA is only updated for 1,5 seconds and than it falls back to the state it was when last reload off integration.

When I use the device controls in HA, same problem:

  1. a socket is turned off and the state in HA is also off
  2. I change the state to on via HA, since HA thinks it's off, it send the command to turn the socket turns on
  3. the socket turns on, HA shows this on state BUT AFTER +-1,5 seconds the state in HS changes back to off (the socket stays on)
  4. now HA is out of sync (socket is on, HA states it's off)
  5. when I change the state to on in HA again (so turn it on, but socket is already on), the state is on again for +- 1,5 seconds
  6. nothing happens on the socket side, since probably the command to turn it on has been send and the socket was already on
  7. HS is still out of sync (socket is on, HA states it's off)
  8. when I change the state in HA to on and off within the 1,5 seconds, the socket turns off and we are in sync again

Changing the state on the socket side also doesn't show in HA. Only when the integration is reloaded the correct states are shown. Same problem with sensor data like for example power consumption; only shows the Watt at the moment of reload of the integration.

Mike5357 commented 4 months ago

I face similar issues with my cover status. It remains open even if the SmartLife app shows it as closed. Restarting home assistant usually solves the issue for a while.

Exact same issue here- Status updates correctly in the SmartLife app for my garage doors, but never changes back to Closed in HA.

Kiphouder commented 4 months ago

Same problem - no status updates/feedback loop - reloading integration is only way to get status update.

Here's some information to help diagnose the issue: (in my situation), the integration to send commands seems to be working, the problem seems to be in the status updates.

When I send hardcoded commands to turn something on or off (via automations), the socket will turn on and off, but the state of the device control in HA is only updated for 1,5 seconds and than it falls back to the state it was when last reload off integration.

When I use the device controls in HA, same problem:

  1. a socket is turned off and the state in HA is also off
  2. I change the state to on via HA, since HA thinks it's off, it send the command to turn the socket turns on
  3. the socket turns on, HA shows this on state BUT AFTER +-1,5 seconds the state in HS changes back to off (the socket stays on)
  4. now HA is out of sync (socket is on, HA states it's off)
  5. when I change the state to on in HA again (so turn it on, but socket is already on), the state is on again for +- 1,5 seconds
  6. nothing happens on the socket side, since probably the command to turn it on has been send and the socket was already on
  7. HA is still out of sync (socket is on, HA states it's off)
  8. when I change the state in HA to on and off within the 1,5 seconds, the socket turns off and we are in sync again

Changing the state on the socket side also doesn't show in HS. Only when the integration is reloaded the correct states are shown. Same problem with sensor data like for example power consumption; only shows the Watt at the moment of reload of the integration.

For now seems to work correctly... maybe due to HA update, need to test for longer time to be sure

nmotapar commented 4 months ago

this is still an issue even after updating HA to most recent version. Toggle on a switch works from HA, but status not reflecting in HA.

Core - 2024.2.2 Supervisor - 2024.01.1 Operating System - 11.5 Frontend - 20240207.1

RedOrMad commented 4 months ago

Same problem

mohansuv commented 4 months ago

HA dashboard shows all switch 'on' on reloading Tuya devices. This behaviour is after the 2024.2 update

talik31 commented 4 months ago

Same issue for me in 2024.2.2 (and faced since 2024.2.0, when we have switched from dev api to more user friendly configuration for the integration). It mainly impact the refreshing of some smart power sockets (konyks) that are linked to a virtual thermostat in HA so even when HA tries to set it off, it from time to time continue to be on and the radiator continue to heat but for HA traceability it's off (even if the icon shows it as on). I'll probably Switch those power sockets to some zigbee ones to avoid electrical risks.

transon123A commented 4 months ago

Tích hợp này là vô dụng với tôi ...không tự động cập nhật trạng thái thiết bị !

rjullien commented 3 months ago

Hello I have the same issue with a SY2-ZigBee metering switch Puissance, it is not up to date, some days I have 0 consumption whereas into the app it was on for 6 hours with 5KW used, some days I see a consumption for half of the time, some days, it's ok, correct consumption. Same problem with SY2-ZigBee metering switch Courant, however SY2-ZigBee metering switch Tension seems alway up to date and the switch itself is correct (SY2-ZigBee metering switch Switch) I have the feeling it is linked to the problem reported into this issue

rairulyle commented 3 months ago

Same issue. It's really hard to control my Tuya automations now especially if the automation relies on the device state. I hope there's an easy workaround as I jave a lot of Tuya devices.

For now I just have an automation that reloads Tuya every 3 hrs.

nirmalnpatel commented 3 months ago

+1 - Facing the issue with device state including helpers/groups for lights and scenes for lights. After switching on the light, device state flicks back to off. Even though the lights are ON. I have 100+ lights and user experience is very poor right now. Please help to fix it.

paul-g-ionescu commented 3 months ago

Same problem here. With the new Tuya integration, some of the devices status are not updated in HA, and even some switches are not working. From the Tuya App they work normally as before.

Mike5357 commented 2 months ago

Is there any hope of this being resolved soon? Having devices reporting incorrect states for over 2 months now has been incredibly frustrating and renders the devices useless to me.

mehulboricha commented 2 months ago

HA dashboard shows all switch 'on' on reloading Tuya devices. This behaviour is after the 2024.2 update

Exactly the same issue since we moved from the Dev API Integration to the Smart Life Based Integration.

Mike5357 commented 3 weeks ago

Issue still persists.

AUSPhoenix78 commented 1 week ago

Same issue here.... is anything happening to resolve this issue ????

mehulboricha commented 1 week ago

Nope Issue Still Persists!

Mike5357 commented 1 week ago

I gave up on waiting for a fix to this and switched to Tuya Local a few days ago- A little annoying having to switch over all my entities, but well worth it to finally have my devices reporting correct states again after several months. (Plus the added bonus of devices updating much faster now without relying on the cloud is very nice)