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
73.78k stars 30.88k forks source link

Tuya; delayed/missing state updates: Confirmed Tuya Cloud issue, awaiting upstream fix #60034

Closed memphis3 closed 2 years ago

memphis3 commented 2 years ago

The problem

There is a long delay in updating the switch status. When the switch is physically turned on, the switch in the HA turns on and then turns off immediately. Then it takes a few minutes to update the status. These delays appeared after upgrading to HA core ver. 2021.11.4 (HA on Debian)

What version of Home Assistant Core has the issue?

2021.11.4

What was the last working version of Home Assistant Core?

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

Tuya (new version)

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tuya/

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

tuya documentation tuya source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @tuya, @zlinoliver, @metisu, @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)

Aligatorru commented 2 years ago

I also faced this issue in Home Assistant 2021.11.5. While there was version 2021.11.0, after turning on the physical switch, on the panel the switch turned on after 5-10 seconds. Now he does not change his state at all. It is sad. If I change the state in HA, it immediately comes back, but in reality it switches.

Fab-svg commented 2 years ago

Hey,

same issue for me: with HA 2021.11.4, tuya module is not working very well... Sometimes i turn on (or off) a switch which turns back some seconds later. If i restart the service, it works or not: depends.

BR

Bisdale commented 2 years ago

Same for me

memphis3 commented 2 years ago

HA core-2021.11.5 - problem still exist

irekzielinski commented 2 years ago

simillar issue for me with Aircon unit - was working ok in 2021.11.2, upgraded to .5 and state of the device is not reflected correctly in HA. Control seems to work - but HA thinks AC is constantly ON.

pjtxxx commented 2 years ago

same issue here it varies from 5 to 25 secs to never until i restart

System Health

version core-2021.11.4
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.17-v8
arch aarch64
timezone Europe/London
Home Assistant Community Store GitHub API | ok -- | -- Github API Calls Remaining | 5000 Installed Version | 1.17.2 Stage | running Available Repositories | 974 Installed Repositories | 29
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | 13 December 2021, 00:00 relayer_connected | true remote_enabled | true remote_connected | true alexa_enabled | true google_enabled | false remote_server | eu-west-2-0.ui.nabu.casa can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 6.6 -- | -- update_channel | stable supervisor_version | supervisor-2021.10.8 docker_version | 20.10.8 disk_total | 219.4 GB disk_used | 8.8 GB healthy | true supported | true board | rpi4-64 supervisor_api | ok version_api | ok installed_addons | Duck DNS (1.14.0), MariaDB (2.4.0), Mosquitto broker (6.0.1), Samba share (9.5.1), Studio Code Server (3.7.0), deCONZ (6.10.0)
elyobelyob commented 2 years ago

Glad it's not just me. I also noticed that the power information from my smart plugs has become more unreliable with the latest update. Have spoken to Tuya, they said to just re-install. However, that's quite a lot of work all my entities have been renamed.

pjtxxx commented 2 years ago

Glad it's not just me. I also noticed that the power information from my smart plugs has become more unreliable with the latest update. Have spoken to Tuya, they said to just re-install. However, that's quite a lot of work all my entities have been renamed.

I have reinstalled tuya 3 times and even reinstalled home assistant using a backup from when it was working it made NO difference

irekzielinski commented 2 years ago

it was working in 2021.11.2 for me - so looks like a recent regression

elyobelyob commented 2 years ago

I have reinstalled tuya 3 times and even reinstalled home assistant using a backup from when it was working it made NO difference

Useful to know, thanks. After all the glitz and glamour about the new Tuya integration, it's a bit frustrating to be kept in the dark with the issue.

pjtxxx commented 2 years ago

just updated core to 2021-11-5 and now state does not update at all have set tuya logs to debug and get the following logs i'm not sure if this is useful to post but here it is for those who understand it (it's well above my pay grade)

2021-11-21 14:06:52 DEBUG (SyncWorker_4) [homeassistant.components.tuya.base] Sending commands for device bf5f95c9932f59fed2cvh3: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:07:00 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bf5f95c9932f59fed2cvh3: {'switch_led': False, 'work_mode': 'colour', 'bright_value_v2': 456, 'temp_value_v2': 1000, 'colour_data_v2': '{"h":240,"s":1000,"v":102}', 'countdown_1': 0, 'control_data': ''}
2021-11-21 14:07:09 DEBUG (SyncWorker_6) [homeassistant.components.tuya.base] Sending commands for device bf5f95c9932f59fed2cvh3: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:07:09 DEBUG (SyncWorker_7) [homeassistant.components.tuya.base] Sending commands for device bf5f95c9932f59fed2cvh3: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:07:10 DEBUG (SyncWorker_3) [homeassistant.components.tuya.base] Sending commands for device bf5f95c9932f59fed2cvh3: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:07:10 DEBUG (SyncWorker_0) [homeassistant.components.tuya.base] Sending commands for device bf5f95c9932f59fed2cvh3: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:07:14 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bf5f95c9932f59fed2cvh3: {'switch_led': True, 'work_mode': 'colour', 'bright_value_v2': 456, 'temp_value_v2': 1000, 'colour_data_v2': '{"h":240,"s":1000,"v":102}', 'countdown_1': 0, 'control_data': ''}
2021-11-21 14:07:21 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bf5f95c9932f59fed2cvh3: {'switch_led': False, 'work_mode': 'colour', 'bright_value_v2': 456, 'temp_value_v2': 1000, 'colour_data_v2': '{"h":240,"s":1000,"v":102}', 'countdown_1': 0, 'control_data': ''}
2021-11-21 14:08:20 DEBUG (SyncWorker_3) [homeassistant.components.tuya.base] Sending commands for device bf597262d63363f79fo1zn: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:08:34 DEBUG (SyncWorker_4) [homeassistant.components.tuya.base] Sending commands for device bf597262d63363f79fo1zn: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}, {'code': <DPCode.WORK_MODE: 'work_mode'>, 'value': <WorkMode.COLOUR: 'colour'>}, {'code': <DPCode.COLOUR_DATA: 'colour_data'>, 'value': '{"h": 345, "s": 1, "v": 1000}'}]
2021-11-21 14:08:51 DEBUG (SyncWorker_3) [homeassistant.components.tuya.base] Sending commands for device bf597262d63363f79fo1zn: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:08:53 DEBUG (SyncWorker_5) [homeassistant.components.tuya.base] Sending commands for device bf597262d63363f79fo1zn: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:08:59 DEBUG (SyncWorker_0) [homeassistant.components.tuya.base] Sending commands for device bfe7c9e07793b09860p7kz: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:09:04 DEBUG (SyncWorker_2) [homeassistant.components.tuya.base] Sending commands for device bf597262d63363f79fo1zn: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:10:01 DEBUG (SyncWorker_6) [homeassistant.components.tuya.base] Sending commands for device bfe7c9e07793b09860p7kz: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:10:02 DEBUG (SyncWorker_5) [homeassistant.components.tuya.base] Sending commands for device bfe7c9e07793b09860p7kz: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:10:11 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bfe7c9e07793b09860p7kz: {'switch_led': False, 'work_mode': 'colour', 'bright_value': 1000, 'temp_value': 1000, 'colour_data': '{"h":60,"s":1000,"v":1000}', 'scene_data': '{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}', 'countdown': 0}
2021-11-21 14:10:15 DEBUG (SyncWorker_1) [homeassistant.components.tuya.base] Sending commands for device bf4e67a4dd2aa32fe5t8a6: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:10:16 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bfe7c9e07793b09860p7kz: {'switch_led': True, 'work_mode': 'colour', 'bright_value': 1000, 'temp_value': 1000, 'colour_data': '{"h":60,"s":1000,"v":1000}', 'scene_data': '{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}', 'countdown': 0}
2021-11-21 14:11:19 DEBUG (SyncWorker_0) [homeassistant.components.tuya.base] Sending commands for device bfe7c9e07793b09860p7kz: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:11:25 DEBUG (SyncWorker_2) [homeassistant.components.tuya.base] Sending commands for device bfe7c9e07793b09860p7kz: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:11:28 DEBUG (SyncWorker_4) [homeassistant.components.tuya.base] Sending commands for device bfe7c9e07793b09860p7kz: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:11:28 DEBUG (SyncWorker_1) [homeassistant.components.tuya.base] Sending commands for device bfe7c9e07793b09860p7kz: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:11:29 DEBUG (SyncWorker_6) [homeassistant.components.tuya.base] Sending commands for device bfe7c9e07793b09860p7kz: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:11:29 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bfe7c9e07793b09860p7kz: {'switch_led': False, 'work_mode': 'colour', 'bright_value': 1000, 'temp_value': 1000, 'colour_data': '{"h":60,"s":1000,"v":1000}', 'scene_data': '{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}', 'countdown': 0}
2021-11-21 14:11:39 DEBUG (SyncWorker_2) [homeassistant.components.tuya.base] Sending commands for device bf4e67a4dd2aa32fe5t8a6: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:11:44 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bfe7c9e07793b09860p7kz: {'switch_led': False, 'work_mode': 'colour', 'bright_value': 1000, 'temp_value': 1000, 'colour_data': '{"h":60,"s":1000,"v":1000}', 'scene_data': '{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}', 'countdown': 0}
2021-11-21 14:11:48 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bfe7c9e07793b09860p7kz: {'switch_led': False, 'work_mode': 'colour', 'bright_value': 1000, 'temp_value': 1000, 'colour_data': '{"h":60,"s":1000,"v":1000}', 'scene_data': '{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}', 'countdown': 0}
2021-11-21 14:13:01 DEBUG (SyncWorker_7) [homeassistant.components.tuya.base] Sending commands for device bf4e67a4dd2aa32fe5t8a6: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:13:06 DEBUG (SyncWorker_1) [homeassistant.components.tuya.base] Sending commands for device bf4e67a4dd2aa32fe5t8a6: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:13:06 DEBUG (SyncWorker_6) [homeassistant.components.tuya.base] Sending commands for device bf4e67a4dd2aa32fe5t8a6: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:13:24 DEBUG (SyncWorker_2) [homeassistant.components.tuya.base] Sending commands for device bfe931848c469ec6bbjuux: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:13:28 DEBUG (SyncWorker_0) [homeassistant.components.tuya.base] Sending commands for device bfe931848c469ec6bbjuux: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:13:31 DEBUG (SyncWorker_4) [homeassistant.components.tuya.base] Sending commands for device bfe931848c469ec6bbjuux: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:13:33 DEBUG (SyncWorker_6) [homeassistant.components.tuya.base] Sending commands for device bfe931848c469ec6bbjuux: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:13:36 DEBUG (SyncWorker_5) [homeassistant.components.tuya.base] Sending commands for device bfe931848c469ec6bbjuux: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:13:38 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bfe931848c469ec6bbjuux: {'switch_led': True, 'work_mode': 'colour', 'bright_value': 980, 'temp_value': 1000, 'colour_data': '{"h":300,"s":1000,"v":1000}', 'scene_data': '{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}', 'countdown': 0}
2021-11-21 14:13:42 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bfe931848c469ec6bbjuux: {'switch_led': True, 'work_mode': 'colour', 'bright_value': 980, 'temp_value': 1000, 'colour_data': '{"h":300,"s":1000,"v":1000}', 'scene_data': '{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}', 'countdown': 0}
2021-11-21 14:16:00 DEBUG (SyncWorker_0) [homeassistant.components.tuya.base] Sending commands for device bfe931848c469ec6bbjuux: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:16:10 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bfe931848c469ec6bbjuux: {'switch_led': False, 'work_mode': 'colour', 'bright_value': 980, 'temp_value': 1000, 'colour_data': '{"h":300,"s":1000,"v":1000}', 'scene_data': '{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}', 'countdown': 0}
2021-11-21 14:16:13 DEBUG (SyncWorker_5) [homeassistant.components.tuya.base] Sending commands for device bfe931848c469ec6bbjuux: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:17:00 DEBUG (SyncWorker_4) [homeassistant.components.tuya.base] Sending commands for device bf589e02ddc5d2a6a5hekk: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:17:06 DEBUG (SyncWorker_2) [homeassistant.components.tuya.base] Sending commands for device bfe931848c469ec6bbjuux: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:17:06 DEBUG (SyncWorker_5) [homeassistant.components.tuya.base] Sending commands for device bfe931848c469ec6bbjuux: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:17:06 DEBUG (SyncWorker_1) [homeassistant.components.tuya.base] Sending commands for device bfe931848c469ec6bbjuux: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:17:07 DEBUG (SyncWorker_3) [homeassistant.components.tuya.base] Sending commands for device bfe931848c469ec6bbjuux: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:17:15 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bfe931848c469ec6bbjuux: {'switch_led': True, 'work_mode': 'colour', 'bright_value': 980, 'temp_value': 1000, 'colour_data': '{"h":300,"s":1000,"v":1000}', 'scene_data': '{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}', 'countdown': 0}
2021-11-21 14:17:25 DEBUG (SyncWorker_2) [homeassistant.components.tuya.base] Sending commands for device bfe931848c469ec6bbjuux: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:17:28 DEBUG (SyncWorker_1) [homeassistant.components.tuya.base] Sending commands for device bfe931848c469ec6bbjuux: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:17:31 DEBUG (SyncWorker_3) [homeassistant.components.tuya.base] Sending commands for device bfe931848c469ec6bbjuux: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:17:33 DEBUG (SyncWorker_6) [homeassistant.components.tuya.base] Sending commands for device bfe931848c469ec6bbjuux: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:17:35 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bfe931848c469ec6bbjuux: {'switch_led': False, 'work_mode': 'colour', 'bright_value': 980, 'temp_value': 1000, 'colour_data': '{"h":300,"s":1000,"v":1000}', 'scene_data': '{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}', 'countdown': 0}
2021-11-21 14:17:39 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bfe931848c469ec6bbjuux: {'switch_led': False, 'work_mode': 'colour', 'bright_value': 980, 'temp_value': 1000, 'colour_data': '{"h":300,"s":1000,"v":1000}', 'scene_data': '{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}', 'countdown': 0}
2021-11-21 14:17:44 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bfe931848c469ec6bbjuux: {'switch_led': False, 'work_mode': 'colour', 'bright_value': 980, 'temp_value': 1000, 'colour_data': '{"h":300,"s":1000,"v":1000}', 'scene_data': '{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}', 'countdown': 0}
2021-11-21 14:22:15 DEBUG (SyncWorker_3) [homeassistant.components.tuya.base] Sending commands for device bf589e02ddc5d2a6a5hekk: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:23:05 DEBUG (SyncWorker_4) [homeassistant.components.tuya.base] Sending commands for device bf99a43e1cae07eca80t2g: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:23:23 DEBUG (SyncWorker_2) [homeassistant.components.tuya.base] Sending commands for device bf99a43e1cae07eca80t2g: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}, {'code': <DPCode.WORK_MODE: 'work_mode'>, 'value': <WorkMode.COLOUR: 'colour'>}, {'code': <DPCode.COLOUR_DATA_V2: 'colour_data_v2'>, 'value': '{"h": 120, "s": 1000, "v": 1000}'}]
2021-11-21 14:23:29 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bf99a43e1cae07eca80t2g: {'switch_led': True, 'work_mode': 'colour', 'colour_data_v2': '{"h":120,"s":1000,"v":1000}', 'scene_data_v2': '{"scene_num":1,"scene_units":[{"bright":0,"h":46,"s":1000,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":716}]}', 'countdown_1': 0, 'music_data': '', 'control_data': ''}
2021-11-21 14:23:29 DEBUG (SyncWorker_4) [homeassistant.components.tuya.base] Sending commands for device bf99a43e1cae07eca80t2g: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:23:40 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bf99a43e1cae07eca80t2g: {'switch_led': False, 'work_mode': 'colour', 'colour_data_v2': '{"h":120,"s":1000,"v":1000}', 'scene_data_v2': '{"scene_num":1,"scene_units":[{"bright":0,"h":46,"s":1000,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":716}]}', 'countdown_1': 0, 'music_data': '', 'control_data': ''}
2021-11-21 14:23:43 DEBUG (SyncWorker_0) [homeassistant.components.tuya.base] Sending commands for device bf99a43e1cae07eca80t2g: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:24:34 DEBUG (SyncWorker_2) [homeassistant.components.tuya.base] Sending commands for device bf99a43e1cae07eca80t2g: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:24:56 DEBUG (SyncWorker_4) [homeassistant.components.tuya.base] Sending commands for device bf99a43e1cae07eca80t2g: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:24:57 DEBUG (SyncWorker_2) [homeassistant.components.tuya.base] Sending commands for device bf99a43e1cae07eca80t2g: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:25:12 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bf99a43e1cae07eca80t2g: {'switch_led': True, 'work_mode': 'colour', 'colour_data_v2': '{"h":120,"s":1000,"v":1000}', 'scene_data_v2': '{"scene_num":1,"scene_units":[{"bright":0,"h":46,"s":1000,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":716}]}', 'countdown_1': 0, 'music_data': '', 'control_data': ''}
2021-11-21 14:25:37 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bf4e67a4dd2aa32fe5t8a6: {'switch_led': False, 'work_mode': 'colour', 'bright_value': 1000, 'temp_value': 1000, 'colour_data': '{"h":225,"s":1000,"v":1000}', 'scene_data': '{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}', 'countdown': 0}
2021-11-21 14:25:38 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bf4821dd95fabb3d05cypo: {'switch_led': False, 'work_mode': 'colour', 'bright_value': 1000, 'temp_value': 1000, 'colour_data': '{"h":60,"s":1000,"v":1000}', 'scene_data': '{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}', 'countdown': 0}
2021-11-21 14:25:40 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bf4e67a4dd2aa32fe5t8a6: {'switch_led': False, 'work_mode': 'colour', 'bright_value': 1000, 'temp_value': 1000, 'colour_data': '{"h":225,"s":1000,"v":1000}', 'scene_data': '{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}', 'countdown': 0}
2021-11-21 14:25:43 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bf4821dd95fabb3d05cypo: {'switch_led': False, 'work_mode': 'colour', 'bright_value': 1000, 'temp_value': 1000, 'colour_data': '{"h":60,"s":1000,"v":1000}', 'scene_data': '{"scene_num":1,"scene_units":[{"bright":200,"h":0,"s":0,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":0}]}', 'countdown': 0}
2021-11-21 14:26:32 DEBUG (SyncWorker_7) [homeassistant.components.tuya.base] Sending commands for device bf99a43e1cae07eca80t2g: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:26:36 DEBUG (SyncWorker_4) [homeassistant.components.tuya.base] Sending commands for device bf99a43e1cae07eca80t2g: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:26:37 DEBUG (SyncWorker_2) [homeassistant.components.tuya.base] Sending commands for device bf99a43e1cae07eca80t2g: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:26:37 DEBUG (SyncWorker_3) [homeassistant.components.tuya.base] Sending commands for device bf99a43e1cae07eca80t2g: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:26:39 DEBUG (SyncWorker_0) [homeassistant.components.tuya.base] Sending commands for device bf99a43e1cae07eca80t2g: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:26:40 DEBUG (SyncWorker_4) [homeassistant.components.tuya.base] Sending commands for device bf99a43e1cae07eca80t2g: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:26:44 DEBUG (SyncWorker_6) [homeassistant.components.tuya.base] Sending commands for device bf99a43e1cae07eca80t2g: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:26:45 DEBUG (SyncWorker_5) [homeassistant.components.tuya.base] Sending commands for device bf99a43e1cae07eca80t2g: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': True}]
2021-11-21 14:26:45 DEBUG (SyncWorker_1) [homeassistant.components.tuya.base] Sending commands for device bf99a43e1cae07eca80t2g: [{'code': <DPCode.SWITCH_LED: 'switch_led'>, 'value': False}]
2021-11-21 14:26:46 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bf99a43e1cae07eca80t2g: {'switch_led': False, 'work_mode': 'colour', 'colour_data_v2': '{"h":120,"s":1000,"v":1000}', 'scene_data_v2': '{"scene_num":1,"scene_units":[{"bright":0,"h":46,"s":1000,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":716}]}', 'countdown_1': 0, 'music_data': '', 'control_data': ''}
2021-11-21 14:26:57 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device bf99a43e1cae07eca80t2g: {'switch_led': False, 'work_mode': 'colour', 'colour_data_v2': '{"h":120,"s":1000,"v":1000}', 'scene_data_v2': '{"scene_num":1,"scene_units":[{"bright":0,"h":46,"s":1000,"temperature":0,"unit_change_mode":"static","unit_gradient_duration":13,"unit_switch_duration":14,"v":716}]}', 'countdown_1': 0, 'music_data': '', 'control_data': ''}
2021-11-21 14:29:56 DEBUG (Thread-10) [homeassistant.components.tuya] Received update for device 07304453a4cf12e17f0d: {'switch': False, 'fan_speed_percent': '5', 'light': True}
sicknesz commented 2 years ago

Latest update 2021.11.5 and i still have this issue, Switch going back to previous state on the gui but sometimes stay on in reality sometimes not.

OmegaX-NL commented 2 years ago

Same problem here, worked in the previous version, but since 2021.11.3 this is happening.

Bettinaglio commented 2 years ago

Same here. Introduced in either 2021.11.4 or 2021.11.5.

bartplessers commented 2 years ago

Same here. Few weeks ago I was playing with tuya devices and it's integration. Although not happy with cloud dependency, I was very impressed with responsiveness. This resulted in an very impulsive attack on my local store :-) IMG_5716

so little bit disappointed this responsiveness is gone...

vdbosch commented 2 years ago

Same problem, big delay with update of status of Zigbee lamps. Also slow reaction on switching on /off Even after switching off or on, you have to wait quite long before you can switch it off/on again. Looks that the new Tuya API from Tuya is giving problems / very slow performance. core-2021.11.5 Home Assistant OS 6.6 supervisor-2021.10.8 Currently 21/11/2021 only my test Home Assistant is using the latest version core-2021.11.5 But this problem was also with previous version core-2021.11.4 And according me also with previous version like 11.3 etc (but it looked that problem became bigger and bigger).

My operational environment is now back again to the version of 8/10/2021 core-2021.9.7 Home Assistant OS 6.6 supervisor-2021.10.8 Here the old Tuya integration works fast en reliable.

lopiv2 commented 2 years ago

I can confirm this problem too. Indeed if you have some automations involving these devices, for example a switch, when the switch is off, you still see on in the frontend, and the automation keeps believing is on so doesn't turn off the switch....For example

rfjschutte commented 2 years ago

Same here, my automations with Tuya lights became useless. I tried turning on Device Status Notification but no effect.

craigrouse commented 2 years ago

Same issue here. I thought it was an issue with my HA installation, as it had been working perfectly until recently. Glad others are seeing the same issue. Very frustrating. Same symptoms sometimes things update quickly, sometimes they take 30 seconds, and sometimes never until I restart the HA server. I may have to move some of my automations back to Alexa routines, as they work flawlessly. I hope it can be fixed, as I have a lot of Tuya lights and sensors. If I can help test anything, let me know.

tabaza-1 commented 2 years ago

I confirm, also I'm affected with lack of responsiveness of my Tuya smart switches. More less i do confirm issues listed by colleagues above:

julianjd-uk commented 2 years ago

I'm suffering the same issues. All was working fine, but now my flows are having issues deciding what to do. I don't want to have to change them so that they just sent the payload to the device, i want to reduce traffic to the servers not increase it. Switches, lights etc don't maintain their new status, it can be done by toggling them several times. This happens for real and virtual devices. Restarting clears it for a little while, but that isn't a valid option as it would need to be done on a very regular basis, several times a day,

Home Assistant 2021.11.5 Home Assistant OS 6.6 supervisor-2021.10.8 Tuya integration is at the latest version

steve1011011 commented 2 years ago

Same issue. Device updates to the HA gui are lagging heavily for Tuya devices using the official Tuya integration.

TheGabeMan commented 2 years ago

Following, because same issue (2021.11.4 and .5)

mrchappell100 commented 2 years ago

Same issues here in 11.5 update. I have tried uninstalling, reinstalling tuya multiple times. Tried starting from fresh install of HA. made sure that the device notification is authorized on developer site yet I still get state change lag where sometimes the state changes then change back even though the device has turned on. Motion sensors are also taking a long time to detect motion but on the tuya app all the devices are changing as normal. You can't make an automation with the integration in this state as everything either fails or breaks...

waseltzer commented 2 years ago

I thought I had authorized "Device Status Notification" but it was not. Authorized, restarted HA, and now Tuya appears to be working correctly again. Follow this instructions carefully and be sure you have authorized the "Device Status Notification" API for your service: https://www.home-assistant.io/integrations/tuya/

Wondering if the Tuya integration would be able to provide an error message in the log if the "Device Status Notification" has not been authorized.

Erickclee commented 2 years ago

Same for me 2021.11.5 issue.

achuman commented 2 years ago

I thought I had authorized "Device Status Notification" but it was not. Authorized, restarted HA, and now Tuya appears to be working correctly again. Follow this instructions carefully and be sure you have authorized the "Device Status Notification" API for your service: https://www.home-assistant.io/integrations/tuya/

Wondering if the Tuya integration would be able to provide an error message in the log if the "Device Status Notification" has not been authorized.

Even with that enabled it doesn't work. This is a new issue since 2021.11.4 as everything worked perfectly before that.

Gessink commented 2 years ago

Same issue in 2021.11.2

D33M commented 2 years ago

In my case if I change the entity status to on/off, the slider goes to that status then gets rolled back to the original one (but the actual light changes the status). Sometimes it gets refreshed in the UI, but often does not.

I have searched for error logs but to no avail, there are just debug ones with information about sending the status, no response.

tubalainen commented 2 years ago

Not working 100% for me either.

Here is some examples of how it behaves for me: https://youtu.be/K1Su63SmXNg

Docas09 commented 2 years ago

the status problem is not only happening with switches, but also with door and motion sensors. Also the current, power and intensity information only update when they feel like it. I have a power outlet indicating the HA 1500w for 2 days and nothing is connected there... I have the status service active and it worked on Tuya V2 I'm a little unlucky with tuya. First, in Tuya v2, there was an ID change and I had to redo all automations and node red, there are more than 200. Then I went to official and didn't recognize the door and movement sensors, I went back to Tuya v2. (luckily with backup) Tuya v2 released version 1.6 and there I lost everything again. I went back to v1.5, which worked, but it started to have delays. I switched to official, went back to correcting all automations, and I'm full of problems because of status, power, current and intensity. In the app from tuya and smartthings everything works perfectly. I'm trying to switch to Shelly or devices zigbee.

vdbosch commented 2 years ago

I and I am afraid that we all have exactly the same problems!

Michaelzil commented 2 years ago

Same problem here. Would downgrading the system back to 2021.11.2 solve the problem?

Gessink commented 2 years ago

Same problem here. Would downgrading the system back to 2021.11.2 solve the problem?

This problem is present on my 2021.11.2 system as well, so won't work I guess

CrashyNL commented 2 years ago

I've reverted back from 11.5, to all previous versions up to 11.1, the bug still exists.

Not sure if this is related, but also brightness and Color Temperature both do not work for any of my lights

jlsjonas commented 2 years ago

@tuya is this being investigated??

CrashyNL commented 2 years ago

I just set-up a new Cloud project and connected the app and added the new account to HA. Same problem...

christianzappa commented 2 years ago

Same issue here. Running the latest. 2021.11.5

Erickclee commented 2 years ago

2021.11.0 confirm no issue.

CrashyNL commented 2 years ago

Just downgraded to 2021.11.0, same issues, sorry...

vdbosch commented 2 years ago

I downgraded to core-2021.9.7, (old Tuya integration), here it works OK. I will wait for the solution that fix current issues (might be an Tuya API problem of new integration?) before to upgrade again to the latest version.

Janu89 commented 2 years ago

I have the same issue. Running 2021.11.5

zlinoliver commented 2 years ago

Hi guys, really sorry for the inconvenience! Will investigate the issue and fix it ASAP.

Bisdale commented 2 years ago

Hi guys, really sorry for the inconvenience! Will investigate the issue and fix it ASAP.

Great news @zlinoliver looking forward to your update =)

Fab-svg commented 2 years ago

Exactly ! Thank you for bug fixing.

BR

trevortrevor commented 2 years ago

I was suffering from long delays. Don't know if it's coincidental but since disabling ipv6 through Supervisor->System->IP Address the responsiveness is much better. Around 3 seconds as opposed to the 2-10 minutes before.

mrchappell100 commented 2 years ago

Just tested that but no change. Thanks for trying 😊

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows

From: @.> Sent: 25 November 2021 10:16 To: @.> Cc: @.>; @.> Subject: Re: [home-assistant/core] Tuya switch not keeping its state when toggled - delay in switch state updating after last HA core update 2021.11.4 (Issue #60034)

I was suffering from long delays. Don't know if it's coincidental but since disabling ipv6 through Supervisor->System->IP Address the responsiveness is much better. Around 3 seconds as opposed to the 2-10 minutes before.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/home-assistant/core/issues/60034#issuecomment-979061479, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AR5FILCJCQUPFDWEOMCYROLUNYEHHANCNFSM5IOGRFUA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

tabaza-1 commented 2 years ago

Hi All, Just waiting for final fix I implemented nice workaround, which fits perfectly my needs. I use only few Tuya switches and I decided simply to trigger Tuya integration reload. I follwed very good thread of Mariusthvdb: https://community.home-assistant.io/t/add-service-integration-reload/231940

I hope this small "manual" targeted for Tuya integration reload help at least few of us. I'm using core-2021.11.5 at the moment.

Here's my live setup:

  1. add to configuration.yaml:
shell_command:
  reload_tuya: | 
    curl -X POST 
    -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyssc3MiOiIzZmQyZTkzNzA0Mjg0MjTtYmUyZjk5ZDVkODkzM2RlNyIsImlhdCI6MTYzNzgyODA4NSwiZXhwIjoxOTUzMTg4Maa1fQ.lOujbx0BaUEmvUEctbsNPltTYlwkaUlmjYAD5dUyAFw" -H "Content-Type: application/json" 
    http://[HA_ip]:8123/api/config/config_entries/entry/e4d06c57be14e2c893d3c416c1dfe58b/reload

where: 1st long string after (Authorization: Bearer) is a long-lived access token created in HA UI > Profile (your name) > create token (at the very bottom of the page) 2nd string before (/reload) is just the entry_id of your tuya integration retrieved from .storage/core.config_entries file in the HA /config directory

  1. create automation with trigger that fits your needs. automation.yaml:
    - id: '1637792981074-whatever'
    alias: tuya reload
    description: ''
    trigger:
    - platform: time_pattern
    minutes: '57'
    condition: []
    action:
    - service: shell_command.reload_tuya
    mode: single