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
71.16k stars 29.83k forks source link

Tuya integreation don't update sensor, need to be reloaded... #91899

Closed Z4RR0 closed 7 months ago

Z4RR0 commented 1 year ago

The problem

Sometime, i need to go in device click on tuya and need to reload integration to update the sensor value. "the device work but the sensor are not update.

What version of Home Assistant Core has the issue?

2023.4.5

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

tuya integration

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

thecode commented 1 year ago

Please download the diagnostics from the device card in Home Assistant and attach it in a comment.

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

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.

(message by CodeOwnersMention)


tuya documentation tuya source (message by IssueLinks)

Voltbeat commented 1 year ago

I've been having the same issue since a couple of weeks but I can't say since when or what version it was still working on without issues. For me it's 3 spots and 1 lightbulb that sometimes take a lot of time to update their status or I have to force it by reloading the Tuya integration.

One thing I can say is that the issue remains after re-installing HA OS running on a Unraid VM, I loaded a backup which dates from December 2022. I had it re-installed since a few days ago after a power surge damaged the drive running HA OS.

Home Assistant 2023.4.6 Supervisor 2023.04.0 Operating System 10.0 Frontend 20230411.1 - latest

Diagnostic file

iotinkognito commented 1 year ago

Having issues similar.

Altycoder commented 1 year ago

Also having similar issues with 5 tuya switches (plug sockets) and sometimes a tuya integration reload works, sometimes not. (Shame you can't link an integration reload to a lovelace button!)

This is also affecting some schedules I have which are failing to turn off my fish tank lights (connected to a tuya plug socket).

I've added the following to my config but nothing useful returned:

homeassistant.components.tuya: error

or

homeassistant.components.tuya: debug

Home Assistant 2023.4.6 (docker) Frontend 20230411.1 - latest

Vjfrrbfubbvurbvr commented 1 year ago

Да да тоже самое, приходится перезагружать интеграцию tuya

21Development commented 1 year ago

I'm having the same issue, which seems to have started after installing 2023.4 (or at least around the time that was released). I've attached the diags from the Tuya plug socket which loses its status most frequently. This socket is on a calendar schedule which worked (turned on), however the last updated attribute didn't change for the socket and neither did the status. Reloading the Tuya integration updated the status. (I've also had the same issue with two bulbs)

tuya-c0939cbe28eda8f62ea3d1fd669b7483-SkyQ Socket-1ebf91c90adc2796b0498c9a828093a6.json.txt

leeboy22001 commented 1 year ago

Same issue, if I change from false to positive within a few seconds it switches back to false ! was running 2023.3... was running fine a few weeks ago

jkitney commented 1 year ago

Same here, have to reload tuya integration 3 time daily :(

gfn256 commented 1 year ago

Experiencing the same. I only have one Tuya temp/humd (wifi) sensor, and in the last weeks it often becomes unavailable or simply doesn't update. Usually (but not always) simply reloading integration helps for some period of time. Occasionally its not even available on the Tuya development site! I've really had enough with Tuya, and don't really think its worth the bother at all! It would appear of late that Tuya have stopped active involvement in the HA integration, something that's surprising following all the hype some time ago about the close work with HA.

Monk11th commented 1 year ago

Same thing, bought some sensors and found that they stop updating. The most interesting thing is that they are updating in the tuya app and my wired tuya sensor also is updating fine, but wireless (3AAA powered) not. Any chances that it will be fixed?

lagartujas commented 1 year ago

Same issue, my water heater is reporting ok to tuya app but I cant see any updates in HA. No logs with any interest in home assistant log. Reloading allow the integration to work some days but suddenly stops updating. I updated HA yesterday to last version (docker 2023.4.6): but same result. ¿Can we set debug "on" for tuya integration?

escobarin3 commented 1 year ago

Hello. I've been having the same issue for a couple of days now. My Tuya sensors stop updating from time to time... no log information... The only workaround is to reload the integration. While the Tuya/Smart Life app shows the correct state... HA do not show the same.

leeboy22001 commented 1 year ago

I fixed my issue by extending my Tuya trial, it had expired after a month. Now have an extra 6 months :)

jaccos commented 1 year ago

Same problem here tuya does not reconize any device. Reloading does not help and a new install either

thecode commented 1 year ago

Same problem here tuya does not reconize any device. Reloading does not help and a new install either

This is a different issue, please create a new issue

brunokelo commented 1 year ago

Hello. I've been having the same issue for a couple of days now. My Tuya sensors stop updating from time to time... no log information... The only workaround is to reload the integration. While the Tuya/Smart Life shows the correct state... HA do not show the same.

+1

Z4RR0 commented 1 year ago

After few day's i try to delete the integration...delete device etc etc but nothing change...sometime the integration stop responding in update the value so....i need to reload from the menu and starting working again...

the work time are varius....many days or few hour's i don't understand why

benyres commented 1 year ago

Same problem. Have extended IoT Core for 6m, removed IPV6, removed unnsessasry API (from tuya platform), and still have a problem with update sensors.

Is workaound, to do in NODERED - autoreload tuya service ~1h delay, but... its still workaround.

ADD; Even when sensors is not working correct, my automatizations works OK (for example: motion sensor (Xiaomi Auara) detect motion -> lights on (tuya) -> delay 1m -> check motions status -> turn off light (tuya)

Jabberwoky58 commented 1 year ago

Same problem. My Tuya sensors stop updating from time to time. The only workaround is to reload the integration.

lagartujas commented 1 year ago

Hi all. I thik I have a workaround while we discover real problem origin. I have set an automation to restart tuya integration daily. Perhaps it helps you too. I'm testing it but first impresion are good. Check sintax before paste to HA, due to markdown visualization:

alias: 00Tuya reload description: '' trigger: - platform: time_pattern hours: '23' condition: [] action: - service: homeassistant.reload_config_entry data: {} target: entity_id: climate.dt_ewh

mode: single

henrik-muehe commented 1 year ago

Explicit +1 on this, happy to provide any information that could help.

Similarly to @benyres my automations also keep working (and toggling from the UI also works) but the status displayed is completely off.

Huxinator commented 1 year ago

Hi all. I thik I have a workaround while we discover real problem origin. I have set an automation to restart tuya integration daily. Perhaps it helps you too. I'm testing it but first impresion are good. Check sintax before paste to HA, due to markdown visualization:

alias: 00Tuya reload description: '' trigger: - platform: time_pattern hours: '23' condition: [] action: - service: homeassistant.reload_config_entry data: {} target: entity_id: climate.dt_ewh

mode: single

so the entity you have chosen is explicity from a tuya device?

melton2 commented 1 year ago

iv got the same issue as everyone above.. except mine stops updating every few hours, and not just once a day.

im running HA core 2022.9.1 so i dont think this is an issue because of updates.

lagartujas commented 1 year ago

Hi all. I thik I have a workaround while we discover real problem origin. I have set an automation to restart tuya integration daily. Perhaps it helps you too. I'm testing it but first impresion are good. Check sintax before paste to HA, due to markdown visualization: alias: 00Tuya reload description: '' trigger: - platform: time_pattern hours: '23' condition: [] action: - service: homeassistant.reload_config_entry data: {} target: entity_id: climate.dt_ewh mode: single

so the entity you have chosen is explicity from a tuya device?

Yes, is the device that stops updating. I only have one device afected. I have already flashed with open belken or esphome cheap devices, but I dont want to Risk the warranty of mu Walter heater.

dahamsta commented 1 year ago

Same problem here, 2x Tuya devices. Reverting to 2023.3.6 fixed it for one device, the other is still acting oddly but I just added it to the network, it could have been added incorrectly. I'll try removing it and adding it again.

escobarin3 commented 1 year ago

I fixed my issue by extending my Tuya trial, it had expired after a month. Now have an extra 6 months :)

As "obvious" as it may sound... This was the issue. I just forgot that extending the "trial period" in Tuya was a thing. All is working as it should now.

21Development commented 1 year ago

I have 11 Tuya devices connected currently, in troubleshooting this I have added another 6months to my Tuya Dev account (it had expired 12 months ago but continued working in HA) and also added a automation which runs the reload_config_entry service each morning (I only specify one device but all briefly show as unavailable then back to their status in HA history when automation runs. Not sure if this is the same as reloading the integration manually though!?)

Despite the above changes, this morning most of my Tuya devices are not showing their correct status in HA 2023.4.4 - they are still accepting commands to operate e.g. I can turn on a bulb in HA via a switch but it stays ‘grey’ as if off in HA. A curtain automation operates the motor but the curtain position is not updated and the last updated time on neither device updates. Looking at the devices in SmartLife, I can both operate and see their correct status. Two temp/humidity sensors (which only connect after set changes happen) continued to update in HA.

In case it helps with further troubleshooting, my 11 devices are a mixture of bulbs, sockets and a curtain motor all on different Tuya f/w and connected on a separate UniFi VLAN network (which is also connected to HA). Reloading the HA Tuya integration manually temporarily fixes the issue and shows the correct status… until the next time.

EDIT: Without me making any changes, reloading HA or the Tuya integration, the status's are now back in HA for 10 out of 11 devices. Looking at the entities history in HA, no status changes were recorded for the bulbs / sockets until they suddenly started working again. Two things happened around that time; a Tuya bulb which was previously powered off overnight was turned on and a HA automation fully opened the curtain.

In summary

Huxinator commented 1 year ago

Dont think that just "extending the trial" is the main solution for this problem. My trial isnt expired and i have the same issues

motogon commented 1 year ago

+1 , I have similar problems with device status updates, after reloading the integration, for a while, everything works.

lagartujas commented 1 year ago

I have 11 Tuya devices connected currently, in troubleshooting this I have added another 6months to my Tuya Dev account (it had expired 12 months ago but continued working in HA) and also added a automation which runs the reload_config_entry service each morning (I only specify one device but all briefly show as unavailable then back to their status in HA history when automation runs. Not sure if this is the same as reloading the integration manually though!?)

Despite the above changes, this morning most of my Tuya devices are not showing their correct status in HA 2023.4.4 - they are still accepting commands to operate e.g. I can turn on a bulb in HA via a switch but it stays ‘grey’ as if off in HA. A curtain automation operates the motor but the curtain position is not updated and the last updated time on neither device updates. Looking at the devices in SmartLife, I can both operate and see their correct status. Two temp/humidity sensors (which only connect after set changes happen) continued to update in HA.

In case it helps with further troubleshooting, my 11 devices are a mixture of bulbs, sockets and a curtain motor all on different Tuya f/w and connected on a separate UniFi VLAN network (which is also connected to HA). Reloading the HA Tuya integration manually temporarily fixes the issue and shows the correct status… until the next time.

EDIT: Without me making any changes, reloading HA or the Tuya integration, the status's are now back in HA for 10 out of 11 devices. Looking at the entities history in HA, no status changes were recorded for the bulbs / sockets until they suddenly started working again. Two things happened around that time; a Tuya bulb which was previously powered off overnight was turned on and a HA automation fully opened the curtain.

In summary

  • Devices (Sensors/Bulbs) which are not permently connected, continued to update correctly when energized
  • Devices which were powered but turned off stopped updating their status in HA
  • Devices continued to turn on/off/operate but didn't update their status in HA
  • Suddenly all but one device started working correctly again without making any changes.

I think that there ara a lote of advantages of flashing tuya de ices with other firmware. So I prefer this radical solution to avoid depending a company to manager my gadgets. Only un special situations I would not do It, as for an device with an integrantes tuya controller like my Walter heater. This is not a cheap smart switch to Risk the warranty, but once the warranty expires... 👿

tbrasser commented 1 year ago

There are numerous issues open about this for more than a month already, where are the code owners? It seems evident this is not a simple bug on the HA side of things. It feels more like the whole integration is just given up on (by tuya?). Is there any comms between tuya and nabu casa? Any kind of info that can be given to us?

Forcing everyone that bought into tuya after the collaboration announcement to go (a combination of) localtuya/tuya-local/openbeken/libretuya seems unrealistic.

At the least we can do with some cleanup of the issues and have a single place where this is actually tracked.

jkitney commented 1 year ago

guys, my home is going crazy for more than 3 weeks, can't have that , can we? Please fix.

21Development commented 1 year ago

It looks like this could be a reoccurring problem, see this https://github.com/home-assistant/core/issues/62408 documented previously. Based on the info there, I’ve just updated one of the events mentioned to reload the service when a Unexpected disconnection occurs (which is present in my logs)


description: ""
trigger:
  - platform: event
    event_type: system_log_event
    event_data:
      level: ERROR
      name: tuya_iot
condition:
  - condition: template
    value_template: "{{ \"Unexpected disconnection.7\" in trigger.event.data.message[0] }}"
action:
  - service: homeassistant.reload_config_entry
    data: {}
    target:
      entity_id: switch.tuya_device
mode: single

and add the following to configuration.yaml

system_log:
  fire_event: true
oksakoor commented 1 year ago

guys, my home is going crazy for more than 3 weeks, can't have that , can we? Please fix.

Same here.

escobarin3 commented 1 year ago

I don't know, folks, but I don't think this issue is widespread. It may be very specific to each case or have some similarities between different cases. I use more than 30 TUYA devices in my HA installation, and aside from the hiccup last week when I forgot to renew my trial period, everything is working perfectly. I think it's worth clarifying that this is NOT something that is happening to all TUYA device users.

image

image

OperationJosef commented 1 year ago

I honestly think the best way for such Problem would be a HomeAssistant community discord server where we can meet and exchange properly.

Gesendet von Outlook für iOShttps://aka.ms/o0ukef


Von: escobarin3 @.> Gesendet: Monday, May 1, 2023 5:48:29 PM An: home-assistant/core @.> Cc: OperationJosef @.>; Manual @.> Betreff: Re: [home-assistant/core] Tuya integreation don't update sensor, need to be reloaded... (Issue #91899)

I don't know, folks, but I don't think this issue is widespread. It may be very specific to each case or have some similarities between different cases. I use more than 30 TUYA devices in my HA installation, and aside from the hiccup last week when I forgot to renew my trial period, everything is working perfectly. I think it's worth clarifying that this is NOT something that is happening to all TUYA device users.

[image]https://user-images.githubusercontent.com/85810778/235481167-91785793-9efc-47fb-aa27-97bc48e6f7e3.png

— Reply to this email directly, view it on GitHubhttps://github.com/home-assistant/core/issues/91899#issuecomment-1529854529, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7QWANGONTHFJJVRXLUSD53XD7LM3ANCNFSM6AAAAAAXIQKSWU. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Sujimichi commented 1 year ago

I am having the same issue. (This is NOT to do with Tuya subscriptions). a few weeks ago all devices were working correctly and reporting status etc. But in the last 3 weeks I have had to constantly reload the integration in order to keep getting device status. What's interesting is this isn't like a connection failure that breaks everything. In some cases I can still switch a device on and off, I just don't get it's status back. So HA doesn't know if it's on or not.

I've had the same issue running HA OS and as a docker container, fresh installs and new setups haven't fixed it.

All my non Tuya devices work without issue (status info etc)

It's not a Tuya subscription issue

To me what this "feels like" is some form of request rate limiting. If requests to change a devices state and requests for devices status are handled differently (ie as POST and GET request), it may be that there is a limit to POST and GET requests and because status requests are more numerous that limit get reached sooner. However the fact that a reload of the integration "fixes" it suggests that's not the case (unless it's a badly implemented rate limit). I do think that my problems started after I started trying to monitor the power usage of various devices more frequently. Perhaps I will try an reduce the amount of status request that are being made and see if that improves things.

dahamsta commented 1 year ago

Same problem here, 2x Tuya devices. Reverting to 2023.3.6 fixed it for one device, the other is still acting oddly but I just added it to the network, it could have been added incorrectly. I'll try removing it and adding it again.

For reference, removing and re-adding the 2nd Tuya device corrected the problem, both devices are fine now. Might be worth having a crack at reverting to 2023.3.6, at least until the problem is resolved.

Please don't move the issue to Discord. This is the big tracker.

cypherbits commented 1 year ago

Having the same problem: 3 devices and starting having problems some weeks ago. State updates not working sometimes.

CiarogSoftware commented 1 year ago

Hi all

After struggling with this issue regularly for the past few months, I resolved it through the Tuya IoT platform. As others have mentioned, my account was not expired - but digging deeper, my access to a particular API was expired.

Log into Tuya IoT and select Cloud > Cloud Services image

Find "IoT Core" in the list and see the Expiration Time (mine is already extended but it was expired). Click on View Details. image

You will see a link to request an extension of your trial license. Fill out the form and your license should be extended within a few hours.

After this, everything worked perfectly. I didn't need to reload the integration or restart HA, the state just began reporting correctly for all entities running through Tuya.

For anyone experiencing this issue, I would strongly recommend this is the first step they take.

Update After ~40 hours it's still working fine. I've also added a test dashboard to monitor this. It has various different cards showing the state of one of the sockets, just to see if it's a problem with a particular card.

Update 2 Everything worked fine for almost 3 days, then Home Assistant stopped reporting state again. My test dashboard showed the same state on all cards (so it's not an issue with card type). Automations all work fine as usual. Tuya app reports state correctly, Google Home app reports state correctly.

dennisbrouwer91 commented 1 year ago

Yesterday I migrated from Tuya cloud to Tuya local and that also fixed all issues!

Op do 4 mei 2023 om 08:40 schreef Ciaróg Software @.***>

Hi all

After struggling with this issue regularly for the past few months, I resolved it through the Tuya IoT platform. As others have mentioned, my account was not expired - but digging deeper, my access to a particular API was expired.

Log into Tuya IoT and select Cloud > Cloud Services [image: image] https://user-images.githubusercontent.com/7656133/236127838-06e4b6d8-0347-4e8b-9df1-b04814ffadea.png

Find "IoT Core" in the list and see the Expiration Time (mine is already extended but it was expired). Click on View Details. [image: image] https://user-images.githubusercontent.com/7656133/236128003-7d0d4ed3-b4db-40ef-b735-95f980bb089e.png

You will see a link to request an extension of your trial license. Fill out the form and your license should be extended within a few hours.

After this, everything worked perfectly. I didn't need to reload the integration or restart HA, the state just began reporting correctly for all entities running through Tuya.

For anyone experiencing this issue, I would strongly recommend this is the first step they take.

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/91899#issuecomment-1534165213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEFOO7HHEJ6YYEKMZ4JGMW3XENFPLANCNFSM6AAAAAAXIQKSWU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Dennis

Verzonden vanaf mijn iPhone 12

benyres commented 1 year ago

@CiarogSoftware Still have a problem (wrote this week ago), extended IOT do nothing: obraz

21Development commented 1 year ago

I also updated my subscription and it didn’t fix the issue. I’ve just noticed that Tuya implemented a major upgrade around the same time issues started to happen (11th April). Could this be related and something needs updating due to this?

Major Functional Upgrades for Tuya Smart OEM App Announcement Dear Customer,

To provide App users with a better smart experience, the Tuya OEM App will launch the latest template 4.9.0 on April 11th.

This upgrade includes the following important features:

The Matter capability has been iterated and improved, and Matter over Wi-Fi and Matter over Thread have reached a stable and highly available state. The user experience has reached the optimal level under the current protocol.

The App's multi-module functions and interactions have been upgraded for whole-house smart users, improving the experience of whole-house scenarios and the large number of devices controlled. Users can also customize their interface (requires purchasing the advanced version of the OEM App or Custom App Tool service).

The personalized brand building of the App has been further upgraded, with increased flexibility in interface configuration and new configurable sections such as content center and community, enhancing user interactivity and brand loyalty.

Other known issues have been fixed and App security has been upgraded.

As the new template has significant feature upgrades compared to previous versions, we recommend that you update your App to the latest template as soon as possible and relaunch it. Thank you for your continued support and trust in Tuya.

https://iot.tuya.com/mobile/bulletin/detail?id=0000000wfl

gfn256 commented 1 year ago

Updating my Trial period, seems to have solved my issue.

jkitney commented 1 year ago

Here i am again! Licence up to date, HA up to date but still HA is out of order not even hourly TUYA restart is enough now! Nice new features yes, but on a malfunctioning system they are useless?? Can you guys imagine how serious this is? Water remains closed or not opening, water heater cold or fails to switch off, sockets don't switch off............... come on guys we can't throw away our pride and home automation, please fix!

gfn256 commented 1 year ago

@jkitney Your problems are probably network related.

What I would do in your case:

  1. Power down EVRYTHING; Devices, HA, Modems, Routers, AP's - Easiest way is to turn main breaker in house OFF.
  2. After a short time (maybe 2 mins), turn everything (BUT NOT HA) back on.
  3. After everything is back up after some time (maybe 10 mins) - and ONLY then - turn HA back on.

Lets see what happens.

jkitney commented 1 year ago

@gfn256

you mean 35 devices offline? and i wouldn't notice? and they work fine with smart life? naaah , the problem her is the rush to implement new feature without testing... bugs everywhere, sorry but having my HA not functioning is making me very nervous.

The problem is that i install updates :(

oksakoor commented 1 year ago

I agree that is a big headache. It is down for weeks now. Reloading Tuya integration helps to get device status back for temporarily. Every time when i want to do something then i need reload integration. Thats silly.

Does Tuya local integration makes anything better?

jkitney commented 1 year ago

Local Tuya is very limited