core icon indicating copy to clipboard operation
core copied to clipboard

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

Open StefanoGiu opened this issue 1 year ago • 26 comments

The problem

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

  • Before, with 2024.1.2 the status update of the devices was immediate. I click on switch to turn it on and the status is promptly updated
  • After with 2024.2.1 when I click on a switch, the switch turns on, but the status is not reflected in the entity on HA. There is no error in the log, and the Tuya IOT apis are working properly and they are not expired...

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

StefanoGiu avatar Feb 12 '24 15:02 StefanoGiu

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)

home-assistant[bot] avatar Feb 12 '24 15:02 home-assistant[bot]

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.

TiborJaszi avatar Feb 12 '24 22:02 TiborJaszi

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.

codegeek avatar Feb 13 '24 01:02 codegeek

I also have the issue under 2024.1.6

albanleandri avatar Feb 13 '24 20:02 albanleandri

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": [] } }

LoekSmeets98 avatar Feb 14 '24 14:02 LoekSmeets98

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

froachy avatar Feb 14 '24 16:02 froachy

I have the same issue on 2024.1.2.

Geel-Sponsie avatar Feb 15 '24 18:02 Geel-Sponsie

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.

Kiphouder avatar Feb 15 '24 19:02 Kiphouder

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.

Mike5357 avatar Feb 16 '24 19:02 Mike5357

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

Kiphouder avatar Feb 18 '24 17:02 Kiphouder

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

nmotapar avatar Feb 18 '24 21:02 nmotapar

Same problem

RedOrMad avatar Feb 20 '24 17:02 RedOrMad

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

mohansuv avatar Feb 21 '24 08:02 mohansuv

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.

talik31 avatar Feb 25 '24 17:02 talik31

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ị !

transon123A avatar Mar 01 '24 02:03 transon123A

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

rjullien avatar Mar 10 '24 21:03 rjullien

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.

rairulyle avatar Mar 24 '24 19:03 rairulyle

+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.

nirmalnpatel avatar Mar 25 '24 03:03 nirmalnpatel

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.

paul-g-ionescu avatar Apr 01 '24 14:04 paul-g-ionescu

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.

Mike5357 avatar Apr 24 '24 02:04 Mike5357

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.

mehulboricha avatar Apr 27 '24 00:04 mehulboricha

Issue still persists.

Mike5357 avatar Jun 08 '24 22:06 Mike5357

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

AUSPhoenix78 avatar Jun 24 '24 00:06 AUSPhoenix78

Nope Issue Still Persists!

mehulboricha avatar Jun 24 '24 03:06 mehulboricha

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)

Mike5357 avatar Jun 24 '24 04:06 Mike5357

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.