Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuya needs reloading as they stop working #90661

Closed
christopherazzopardi opened this issue Apr 2, 2023 · 154 comments
Closed

Tuya needs reloading as they stop working #90661

christopherazzopardi opened this issue Apr 2, 2023 · 154 comments

Comments

@christopherazzopardi
Copy link

The problem

Tuya integration needs reloading almost daily as devices become unresponsive on HA only.

What version of Home Assistant Core has the issue?

2023.3.6

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Tuya

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

https://community.home-assistant.io/t/tuya-not-refreshing-status-entities/357650/26

I found this but there is only a crude workaround not a solution

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Apr 2, 2023

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)

@bes1967
Copy link

bes1967 commented Apr 2, 2023

Hi all. I have the same problem. All devices in the Tuya application are working normally. But in HA power or current sensors of Wi-Fi outlet, for example, begin to show the same value. If I try to control the switch (turn it on or off), it responds as expected, but the state of the switch does not change. I have tuya temperature and humidity sensors and it seems that in HA they continue to work as usual at the same time. If I restart the tuya integration everything works immediately. If I don't restart the integration, the outlet sensors may start working after 2/3/4 hours. If I add the same sensors to the LocalTuya integration, they show true values even when the tuya integration sensors freeze. HA version is 2023.3.6 and I have this problem since 2023.3.5.

@osql1
Copy link

osql1 commented Apr 2, 2023

Same here

@petragom
Copy link

petragom commented Apr 2, 2023

I’ve had the same problem for the last week or so. My tuya plugs are still working, and (usage) showing in the Smart Life app. In HA it visually freezes, so it shows a constant power usage even when not in use anymore. Reloading the app fixes it for a while, but it freezes again.

@aaklan
Copy link

aaklan commented Apr 2, 2023

I had the same problem for the last week or so too exactly as petragom stated! Thanks!

@christopherazzopardi
Copy link
Author

christopherazzopardi commented Apr 2, 2023 via email

@coulicoulaser
Copy link

Hello,

I have the same problem too, except that this morning, restarting the extension and Home Assistant do nothing. I can't get the Tuya Cloud integration to work again.

@richardcastle
Copy link

Definitely something up with Tuya at the moment. Lot's of reloading of the Tuya module and this morning required a full restart of HA to get power measurements and switch states to refresh in the UI. Hard to tell whether it's a recent HA update or something up with the Tuya back end. For what it's worth, the Smart Life App seems to have had no issues with reporting correct state, so leaning on the public API/cloud from Tuya or something in HA that's broken in last update. Running Home Assistant 2023.3.6 here.

@VIMVa
Copy link

VIMVa commented Apr 3, 2023

Same here: devices disconnecting all the time, especially late night - early morning CET.
I have an automation now to reload the integration upon device disconnection.
That automation does not fire every time: seems that connection is sometimes lost without being reported.
I therefore have an automation that reloads the integration every hour so that I have at least an update from my temperature sensors regularly.
But that is a horrible workaround, isn't it?
Controlling switches also often fails.

However, reloading integration does not solve it every time. Rebooting HA helps sometimes but for some hours only.

PS: the Tuya Integration in Samsung SmartThings does not suffer any disconnections as far as I can see.

@BrackenAlistair
Copy link

I have the same problem, started about a week ago and it seems to be getting worse (first restart solved the problem for few days, now it seems to fail daily). This morning I had to reload tuya integration twice, first reload did get actual values but didn't update after that, second worked (at least for now). Also it seems that it usualy stops working when the sensor values don't change for a while, for example during the night.

@JoErTo
Copy link

JoErTo commented Apr 3, 2023

I have the same problem. Every now and then I loose the status of my tuya devices. Reloading the integration works but that is a workaround and not a solution.

@ntzb
Copy link

ntzb commented Apr 3, 2023

my devices do not show up at all since 12 hours ago.
what's going on?

@SirDragonClaw
Copy link

I am having the same issue, everything has stopped working. Devices show as offline but they still work via tuya app.

@VIMVa
Copy link

VIMVa commented Apr 4, 2023

It's not a good workaround. It's not even a poor workaround but my temperature sensors keep connected with this 'trick':
I have a spare plug and made an automation that switches it off every minute. Not on and off, just off.
I also see that my other plugs do not disconnect any more contrary to the few seconds that the integration reloaded every hour with my earlier workaround.
It's early hours that I'm running this poor 'workaround'... so there are no guarantees but might help for some, awaiting a real solution.

Edit: running for 5 hours and zero interruptions of sensors and plugs.

@Reinqusito
Copy link

Same here.
I hato to reload integration Tuya to have update states of devices.

@midadami
Copy link

midadami commented Apr 4, 2023

Same. Happening for a few days already. My energy meter gets stuck until integration is reloaded or HA restart and then lasts for few hours.

@ntzb
Copy link

ntzb commented Apr 4, 2023

restarting HA or reloading the integration doesn't help.

2023-04-03 22:34:13.594 ERROR (Thread-2) [root] Uncaught thread exception
Traceback (most recent call last):
File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.10/site-packages/tuya_iot/openmq.py", line 161, in run
time.sleep(self.mq_config.expire_time - 60)
AttributeError: 'NoneType' object has no attribute 'expire_time'

@elimardom
Copy link

Same, I have two projects where I use contact sensors and both block after a while working properly. I need to recharge tuya entity to get it working again.

Today both projects have stopped working at the same time, I will analyse if there is any pattern of time during which they work normally and the logs of the entity in case they give clues. Thank you

@loetech1
Copy link

loetech1 commented Apr 4, 2023

im also experiancing same issue

@elimardom
Copy link

Today I am having several tuya stops every hour / 2 hours in two different projects (with different cloud accounts tuya) so the problem seems global.

It's not normal, normally when I recharge the entity works well for a few days and then loses synchronisation again...

@VIMVa
Copy link

VIMVa commented Apr 4, 2023

It's not a good workaround. It's not even a poor workaround but my temperature sensors keep connected with this 'trick': I have a spare plug and made an automation that switches it off every minute. Not on and off, just off. I also see that my other plugs do not disconnect any more contrary to the few seconds that the integration reloaded every hour with my earlier workaround. It's early hours that I'm running this poor 'workaround'... so there are no guarantees but might help for some, awaiting a real solution.

Edit: running for 5 hours and zero interruptions of sensors and plugs.

Anyone else who tried this temporary 'workaround'?
I have not had any interruptions since I started to run that automation.
It's not a solution by any means but it may be useful for some who are depending on a stable integration and it may point the developers to a possible cause.

Edit: workaround is not stable anymore either: disconnecting but less frequently than before.

@vladica
Copy link

vladica commented Apr 4, 2023

Same here.
Have to reload the integration to have synced states on devices.

@GHPhil
Copy link

GHPhil commented Apr 4, 2023

Same problem for me. It started a couple of days ago. Started with two temperature sensor now all Tuya linked devices frozen in HA but still working normally in Smart Life App. I have tried to reload the Tuya Integration but makes no difference.

@christopherazzopardi
Copy link
Author

This issue seems to be there for years but I did not find anyone who knows why this is happening. Any clues?

@aaklan
Copy link

aaklan commented Apr 5, 2023 via email

@ikreis
Copy link

ikreis commented Apr 5, 2023

I have the same issue. So far, my 4 tries to reload the integration fixed it for a few hours.

@VIMVa
Copy link

VIMVa commented Apr 5, 2023

Hi, I tried this workaround for two days now, but no luck, the problem remained (even worse today, I need to reload the whole Tuya integration in every 20 minutes) VIMVa @.***> ezt írta (időpont: 2023. ápr. 4., K, 13:42):

I know, sorry: I edited my last post: it worked for a while but I'm back to reloading too. We could but try...
:-(

The automatic reload even interfered with my other Tuya automations. One must make sure that the other automations fire (at least seconds) outside the reload periods (or vice-versa). An automation for a plug that switches on and/or off on the hour or minute could fail because the integration is reloading at that very moment.

Let's hope this gets solved very soon.

@PedroDelCargo
Copy link

Same issue here with a temperature/humidity sensor. I have to reload Tuya integration to values refreshed.

@tfhansen
Copy link

This is the latest news from Tuya
image

@applegeeks
Copy link

applegeeks commented May 15, 2023

This is the latest news from Tuya image

ah nice...hopefully this new version doesnt delete or re-do all the entities and hard work people have put into their setup.
otherwise, its going to be alot of late nights getting it all configured again. lol

image

@bes1967
Copy link

bes1967 commented May 15, 2023

I have just opened a new ticket with Tuya, just asking if they have any news on this. Quite incredible that they seem to be fully aware of this, and yet for 2 months or so (maybe longer) they have done nothing. I am for now reloading the integration every 20 mins but even so still have issues with automations not always kicking in due to lack of sensor updates from Tuya. I can accept a bug, but getting e.g. sensor updates, seems to me to be crucial, so having to wait this long for a fix is just not acceptable. I am getting rid of everything Tuya but obviously a bit of an investment. I live in a smallish apartment and have approx 30 Tuya devices but can imagine others having far more. For anybody who wants to start their smart home journey from scratch, I can only recommend to stay away from Tuya.

At the beginning, I was really happy with Tuya and the smartlife app, simply because it was super easy and Tuya devices in general are cheap. But at some point, many users will want more that the app can offer so integrating with HA seems like a great option. Such a shame that Tuya doesnt seem to take the HA integration seriously.

I managed to get most devices added to localtuya and from the smartplugs also managed to get power consumption (hidden at first??) but just a few days ago, all power consumption sensors i had became unavailable and now can no longer be added.

Great work Tuya !!

tfhansen, this is probably a LocalTuya issue - as of version 2023.5 of Home Assistant they removed the async_get_registry method (it was priviously declared as deprecated), and custom integrations should use the async_get method instead but LocalTuya still uses the removed method. There is already a PR in the LocalTuya repository

@HanSyt
Copy link

HanSyt commented May 15, 2023

At this moment sometimes al my devices are gone, reload brings them back. Decided that Tuya had become to a "not to be trusted" system. So replaced all switches with Zigbee switches, now only remote temperature sensors, a smoke alarm and an infra red transmitter are left in my Tuya range.

@Huxinator
Copy link

So we have to wait until someone (tuya developer?) fix this problem?

@dpgh947
Copy link

dpgh947 commented May 23, 2023

I am not aware of any fix being issued by tuya, but my automated re-load of the integration (triggered by operating a plug and then checking its reported status) has not fired for 2-3 days now (possibly since I updated to 2023.5.3 but not sure), it seems to be working reliably again (I will probably regret saying that out loud)... What are other folks seeing?

@applegeeks
Copy link

applegeeks commented May 23, 2023

I am not aware of any fix being issued by tuya, but my automated re-load of the integration (triggered by operating a plug and then checking its reported status) has not fired for 2-3 days now (possibly since I updated to 2023.5.3 but not sure), it seems to be working reliably again (I will probably regret saying that out loud)... What are other folks seeing?

its definitely alot less than a few weeks ago but according to the counter configured in my automation my last one was yesterday.
Note, the counter was accumulated over a few weeks and I only usually only manuallyreset it to gauge if a specific HA release is more stable than the other.
image

@PetrolHead2
Copy link

I am not aware of any fix being issued by tuya, but my automated re-load of the integration (triggered by operating a plug and then checking its reported status) has not fired for 2-3 days now (possibly since I updated to 2023.5.3 but not sure), it seems to be working reliably again (I will probably regret saying that out loud)... What are other folks seeing?

Yes, same here. Since 15th of May my reload has triggered only two times. And I do the check every 30 minutes. I have not upgraded, still on a very old version: 2023.1.7

@tfhansen
Copy link

@dpgh947 I have a super primitive automation, just reloading every 20 mins, but I disabled after I saw your comment - everything seems to be working for me so far without reloading so fingers crossed.
I have not changed my mind though, so am replacing as much as I can with Zigbee :-)

@PedroDelCargo
Copy link

Same here. I stopped reloading automation and so far so good...

@tfhansen
Copy link

Just curious as to whether this is still not working for everybody - for me, I have ditched nearly all of my Tuya devices, left with just 2 brightness sensors. Things have certainly improved but sensors still gets stuck once in a while, but not nearly as frequent as they used to and localtuya works. Looking around to replace these sensors too and then i will be done :-)

@ikreis
Copy link

ikreis commented Jun 14, 2023 via email

@RLB7777
Copy link

RLB7777 commented Jun 14, 2023

It did start working about a week ago, then stopped and started a few times. But when it stopped, it would be for 24hrs or more. I have an automation which checks every 30mins and reloads if Tuya has failed (and increments a counter). It’s triggered every 30mins for the last two days until 2hrs ago - when Tuya resumed working. Let’s see how long that lasts.

Since it works for some and not others, I assume at least in part it is related to my setup but I can’t work out what. All the sensors used to work, there’s nothing in the logs etc.

@issue-triage-workflows
Copy link

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.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2023
@felipecrs
Copy link
Contributor

Just to mention that this problem is still happening.

@MacJoSch
Copy link

I am also experiencing the problem again. In June it had disappeared. I am not sure what could be the cause. Latest Home Assistant version? A recurring TUYA problem? My TUYA trial-account is registered correctly and valid until April 2014.

Switches don't show current state and automations don't turn lights on/off even though the automation was triggered correctly.

@Alex-Chist
Copy link

Alex-Chist commented Oct 15, 2023

Want to share that it's still a problem, but it just fixes by itself without reload.
image

While from tuya side only good request can be seen, but understandable, they wouldn't log failed.
image

@dpgh947
Copy link

dpgh947 commented Oct 16, 2023

I have also been getting occasional problems again for the past few days. Devices respond immediately to commands ok (they turn on or off) but the status update is sluggish, sometimes instant, sometimes takes several seconds, sometimes doesn't update at all. But I am seeing this not just on tuya devices, but also on Drayton Wiser smart plugs, which are nothing to do with tuya, so I am starting to wonder if this is something else entirely and not specific to tuya, maybe something in the recent HA updates.

@craigmcfly
Copy link

I thought I'd searched github well, but apparently not as I raised #102124 as a duplicate.

This is really irritating and completely puts me off using Tuya for any more devices.

@jmcollin78
Copy link

This is really irritating and completely puts me off using Tuya for any more devices.

Certainly the best thing to do. Never have cloud based Tuya devices. With localtuya is it more stable.

@kilrgt
Copy link

kilrgt commented Oct 18, 2023

This shouldn't be closed, Lots of people are still experiences issues.

I have 30 Light switches, working on Tuya..... many automatons, Its been months for me. I just want a answer to know if i have to change out all of those stitches.

Local tuya for me is really unstable as well. Im so frustrated with this issue, I wish i was smarter to fix this myself

@jmcollin78
Copy link

Localtuya works fine for wired (no battery) devices from what I can experience at my home.

@PetrolHead2
Copy link

This issue is closed but this #91899 is open, are they similar? Last time a update from Tuya solved the issue, could be on their side again. But I have not experienced any problems lately.

@dpgh947
Copy link

dpgh947 commented Oct 19, 2023

See my comment #91899 (comment)

@Alex-Chist
Copy link

See my comment #91899 (comment)

I think you are right. And it looks like problem on Tuya side currently.
I was able to catch that from smart life app sockets were unavailable, but turn green after a bit.
image
image

What I also notice that it is a problem for smart sockets for me, while temperature sensors are ok.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests