-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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 - no status update after changing a switch state #65758
Comments
tuya documentation |
Hey there @tuya, @zlinoliver, @METISU, @frenck, mind taking a look at this issue as it has been labeled with an integration ( |
Same for me, since I installed Core version 2022.2.0. I'm now on 2022.2.2 and the problem persists. |
Can confirm here too. Not sure if it's related, but I've disabled the device and now don't seem to be able to re-enable it. Tuya IOT interface says it's online. It also works fine / is available in Google Home, so this definitely seems like it's an issue with the HA integration. Diagnostic Info from HA if it helps. |
Same here, started after updating from the latest core 2021 to 2022.2.2. Update: Turned off the entity, status remained on in the UI but the entity (light bulbs) were off. Rebooted HA, went back to HA UI and the status showed off. Toggle the switch and the status and the light are in sync, functioning properly. |
Same here. I suspect a Tuya server issue, as I'm using an older release of the integration (I've customized it) and getting the same issue. It's been happening on and off for a few days for me, but it's especially bad today. |
My dehumidifer is showing the same behavior as reported by original poster. |
i've open a ticket on tuya support and they are checking. |
I have the same problem |
mee too, same problem .... sometimes works correctly, but often at least 1 device state is not changed on H.A. |
I am also experiencing the same issue. Indeed it was fixed in 2021.12.6 as someone previously mentioned, but in every single core update since that it has been broken, and continues to be so in 2022.2.3 that I installed today. As with many other, a reload of the integration sorts it for a few minutes, then it breaks again. If you mash the switch for a light it will eventually agree with you that indeed, it IS off/on, but it sure does resist. It's making me regret going down the route of Tuya with all my lights and outlets! |
I also have the same issue... It was indeed fixed for a brief release, but now is broken again.. Welp.. I re-enabled an automation I made to reload the tuya integration every few hours and it helps, but it's really annoying... |
I'm looking again in tuyalocal. Already have partial fix for the zigbee sensor with tuya gateway. If the other works great, i'll go to tuyalocal to have the fully control of it instead of the servers from tuya |
Same problem here. As described by Anarkistic, problem started with Tuya Integration, then was "solved" for a short period of time and startet new with some releases ago... hope it will be addressed and solved soon?! |
I can't say anything about the switches, since they work for me through local tuya. basically the problem is with the door opening sensors and leak sensors. |
Same issue here, its like 2021 all over again !! |
@tuya @zlinoliver do you have any suggestions here? Tuya lights are unusable much of the time now. This is definitely a Tuya and not an HA issue. Status updates are not being delivered a lot of the time, meaning lights are stuck showing an incorrect state. I have a lot of Tuya lights, and this is a big pain, as my automations are failing. |
FYI: for the people who are interesting. I'm testing out localtuya to support Zigbee protocol: |
Same behavior here. Looks like status update is hit and miss |
I have had the same issue since I upgraded to the latest tuya integration since Christmas. I Never has an issue before. But now it pointless. The state never updates you can reload the integration. But it does not stay working for long. |
@frenck sorry to call you out directly, but it seems Tuya has abandoned us. Do you have any suggestions on how to proceed? Sad as it would be, it would almost be better to remove the integration entirely from HA core, as it feels like it will be a long time before it's able to be used without issues. Automations fail constantly because the device state is incorrect, and the state machine doesn't send commands if the device is already in the state the automation is calling for. |
@craigrouse I suppose they are the device on your Zigbee? normally wifi device shouldn't have the problem? |
Mine are all WiFi devices and I have the problem big time. On a separate note though, I notice states update perfectly fine in the Smart Life app, just not in HA. |
@leeyuentuen Mine are all wifi. |
@Anarkistic I believe the smart life app uses local communication to devices, which is why it usually works. |
For those, who do not want to wait for a solution from Tuya, there is a workaround, to reload tuya-add-on every n-minutes. To create an automation, which is loading tuya-configurtion, every n-minutes:
Tutorial: https://smarterkram.de/1162/shell_command: then alias: Tuya AddOn (restart every 1min)
|
The only problem that was notice and anoying me was my motion sensor of tuya didn't work well will tuya server. I've open a ticket on tuya support but after 2 weeks still not really an answer. Only that they are looking at the problem. On the meantime, i've got enough time to testout localtuya and it solved my zigbee sensor. I have now use localtuya on my own repo: https://github.com/leeyuentuen/localtuya It works for my smartplugs and most of my zigbee sensors like temp and motion sensor. Now i have tuya and localtuya using together. And set my motion sensor automatio'non both enitity. So if tuya failed to detect my motion sensor, localtuya will take over. Or if tuya response too late, localtuya can take over. |
The issue is still ongoing it seems and it really messes with automations that call for the device state as a condition, I think this is a Tuya issue but it's really disappointing as the vast majority of lightbulbs and other devices use Tuya so I'm sure this is affecting a few thousand people to say the least :/ |
@frenck can we consider adding polling to the Tuya integration to workaround all of these issues? When the issue occurs, the polled device state is actually correct. It seems only the state change notification isn't sent or sent with the wrong data. Polling every 30 seconds doesn't fully fix it but at least mitigates it sufficiently for vast majority of folks. tuya_iot provides a update_device_caches method on TuyaDeviceManager so it seems that calling it for all devices and triggering HA updates would be straightforward... Seems that polling is significantly better than what folks are doing with reloading the integration every 30 seconds, etc. |
@alexanv1 That is not a solution. |
If it solves the issue for vast majority of scenarios, it is a solution :) Anyway, just a suggestion, feel free to ignore. I run a custom fork of the Tuya integration anyway so will implement it there but won't be putting out a PR given that it won't be considered it seems like. |
It doesn't
Workaround are not solutions
I didn't, I just answered that I don't agree with doing that. There are tons of problems with adding polling to an infrastructure that is not designed for it. The most obvious case issues handling the number of requests coming in at Tuya's servers that are designed around a different principle: Push. Making changes and workarounds such as you are suggesting often end up with major problems. I would not be the first time a vendor starts blocking people and/or Home Assistant users because of such practices. So, while I get your suggestion, it has a major impact when doing things like that in integration with high usage like this one. Additionally, the workaround does not solve anything and tends to increase the maintenance burden over time (which no one will benefit from). |
I'm not sure if this would help. First we need a closer look what is going wrong! If we use the same method to do a status update as is done during changing the switch state than the issue would stillbexist! |
@martinw72 I'm not following that response? |
@martinw72, it would help. The device state reported when actually querying the Tuya Cloud API is correct. The state change notification that Home Assistant relies upon is missed or contains stale data. I literally have a switch right now that's reported as ON in HA when it's actually OFF and the cloud API returns the correct state when querying :) But, anyway, the powers that be won't consider this solution (for reasons that I completely disagree with but this isn't the first Tuya-related argument I simply give up on with respect to HA) so I guess folks are stuck waiting for Tuya to fix their cloud again... |
Yes, I cannot fix their code or service. Trying to break it by sending in tons of requests, will not help with that either. At best it will piss them off.
Sorry to hear that. I understand that Home Assistant might not be a fit for you in that case. It is one of the prices of cloud devices as well. In the end, I would definitely recommend consider buying product that work locally and do not rely on their cloud to function. |
Well, the recommended solutions that I've seen in multiple bug reports are to reload the integration every x seconds\minutes. That's probably worse than polling in terms of # of API calls but I guess the hope is that most folks won't implement that workaround.
Home Assistant is a perfect fit actually since it allows me to run anything I want as a custom integration (though rebasing is a pain every now and then). Though I do sometimes wish there was more of a customer\user focus vs. technology focus :) |
@frenck despite being a frustrated Tuya user, I do agree that sending lots of extra requests is likely to exacerbate the problem. Do you have any lines of communication with Tuya that might help to convince them to take the problem seriously? They don't seem to care when end users contact them - support requests just seem to go into a black hole. It's a shame, because I bought a lot of Tuya kit on the promise they made to support HA, and now I wish I'd spent a bit more on something that works. It's worth noting I have occasionally seen some slow responses in the official Tuya app regarding device status updates, so it's possible the issue doesn't just affect the HA/Python integration. 🤞 this can be resolved soon. |
@craigrouse I understand, and I hope the same (as someone who tries to help out on the Tuya integration, reading up on this is just frustrating for me too). We do have some lines open with Tuya. For me personally, I've not been able to reproduce the issue. I know there are quite a few reports, so I'm not saying nothing is wrong (something is very wrong for sure); but not being able to reproduce it myself makes it just a guessing game for me. |
For anyone willing to run Tuya as a custom\modified component and interested in the polling workaround discussed above feel free to pull in this commit - alexanv1@5584b25 |
polling is a workaround but if you do it every 30 seconds, the limit of your API call on tuya will be increased, (there is a limit free API call from tuya server, otherwise you need to change to paid service) |
Yeah, I did the math based on https://developer.tuya.com/en/docs/iot/pricing?id=Kazp2q5zpwdav |
Heureka! Looks like is working now again 😊 Works for me, since today.
Von: alexanv1 ***@***.***>
Gesendet: Freitag, 18. Februar 2022 20:07
An: home-assistant/core ***@***.***>
Cc: andreasbuff ***@***.***>; Manual ***@***.***>
Betreff: Re: [home-assistant/core] Tuya - no status update after changing a switch state (Issue #65758)
For anyone willing to run Tuya as a custom\modified component and interested in the polling workaround discussed above feel free to pull in this commit - ***@***.***<alexanv1@5584b25> Works well enough for me but, obviously, no support is offered so use at your own risk :)
polling is a workaround but if you do it every 30 seconds, the limit of your API call on tuya will be increased, (there is a limit free API call from tuya server, otherwise you need to change to paid service)
Yeah, I did the math based on https://developer.tuya.com/en/docs/iot/pricing?id=Kazp2q5zpwdav
Assuming extra ~90,000 calls a month (a single API call every 30 seconds), I am looking at $0.30/month or so. That's easily worth it for me to get updates working again. Perhaps my math is wrong though, I guess I will find out in a few weeks :)
—
Reply to this email directly, view it on GitHub<#65758 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ATCL4TIK65CE2IAUXDXI6OLU32KEFANCNFSM5NTTWCSQ>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.******@***.***>>
|
Mine seems to be working now too but I didn't see any bug fixes in the
latest release notes 🤔
…On Sat 19 Feb 2022, 12:17 andreasbuff, ***@***.***> wrote:
Heureka! Looks like is working now again 😊 Works for me, since today.
Von: alexanv1 ***@***.***>
Gesendet: Freitag, 18. Februar 2022 20:07
An: home-assistant/core ***@***.***>
Cc: andreasbuff ***@***.***>; Manual ***@***.***>
Betreff: Re: [home-assistant/core] Tuya - no status update after changing
a switch state (Issue #65758)
For anyone willing to run Tuya as a custom\modified component and
interested in the polling workaround discussed above feel free to pull in
this commit - ***@***.***<
alexanv1@5584b25>
Works well enough for me but, obviously, no support is offered so use at
your own risk :)
polling is a workaround but if you do it every 30 seconds, the limit of
your API call on tuya will be increased, (there is a limit free API call
from tuya server, otherwise you need to change to paid service)
Yeah, I did the math based on
https://developer.tuya.com/en/docs/iot/pricing?id=Kazp2q5zpwdav
Assuming extra ~90,000 calls a month (a single API call every 30 seconds),
I am looking at $0.30/month or so. That's easily worth it for me to get
updates working again. Perhaps my math is wrong though, I guess I will find
out in a few weeks :)
—
Reply to this email directly, view it on GitHub<
#65758 (comment)>,
or unsubscribe<
https://github.com/notifications/unsubscribe-auth/ATCL4TIK65CE2IAUXDXI6OLU32KEFANCNFSM5NTTWCSQ>.
Triage notifications on the go with GitHub Mobile for iOS<
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android<
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.******@***.***>>
—
Reply to this email directly, view it on GitHub
<#65758 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXEQDHUKC5ZWGB6OYGDZGCTU36C7DANCNFSM5NTTWCSQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID:
***@***.***>
|
@enchantedphoenix that's because this is a Tuya server issue and nothing to do with HA. Don't hold your breath - I expect it's only working temporarily. |
It does seem to be working much better for me now. I can only assume Tuya have fixed something on their end. Is everyone else seeing the same? |
They told me on the ticket that there was a message issue (disconnect) between HA en tuya server. |
Guys I did some tests this moring and at the moment the situation has improved. Seems 95% of the time the state is now updated. I switch very fast between states with one time a mismatch! But this could have other reasons, too! |
I would say this is 100% resolved. Status updates are now immediate and have been working flawlessly for a few days. I think we can close this for now... until next time! |
Only I have taya updated every other time today? Logger: tuya_iot Unexpected disconnection.16 |
Yeah, unfortunately 2022.3 seems to have broken the integration again 😕
…On Mon 14 Mar 2022, 09:59 DIMMonchik, ***@***.***> wrote:
Only I have taya updated every other time today?
—
Reply to this email directly, view it on GitHub
<#65758 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXEQDHWQD6VUJKKDP5723LDU74EYXANCNFSM5NTTWCSQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
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. |
The problem
When turning on or off a Tuya wifi Switch, there is no update in the gui. In the Tuya App the state has changed but the ha gui move back to the old state after e few seconds.
A refresh on the integrations page solves the problem and the state is updated correctly. But only for the current action.
What version of Home Assistant Core has the issue?
2022.1
What was the last working version of Home Assistant Core?
2021.11
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?
Additional information
No response
The text was updated successfully, but these errors were encountered: