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.41k stars 29.9k 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

Huxinator commented 1 year ago

So is there a way to reload only the tuya integration with an automation? maybe every minute or so? just as a workaround

jkitney commented 1 year ago

image

choose any tuya device in target

almirus commented 1 year ago

same problem air conditioner work fine via lovelace (switched on for heating), but not updated status for example: image

image

2023-05-06 13:15:35.128 DEBUG (SyncWorker_4) [tuya_iot] Request: method = POST, url = https://openapi.tuyaeu.com/v1.0/devices/HIDDEN/commands, params = None, body = {'commands': [{'code': <DPCode.SWITCH: 'switch'>, 'value': True}, {'code': <DPCode.MODE: 'mode'>, 'value': 'hot'}]}, t = 1683368135128 2023-05-06 13:15:35.465 DEBUG (SyncWorker_4) [tuya_iot] Response: { "result": true, "success": true, "t": 1683368135438, "tid": "HIDDEN" } 2023-05-06 13:16:07.372 DEBUG (Thread-10 (_thread_main)) [tuya_iot] _on_log: Sending PINGREQ 2023-05-06 13:16:07.419 DEBUG (Thread-10 (_thread_main)) [tuya_iot] _on_log: Received PINGRESP

gfn256 commented 1 year ago

@jkitney

@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 :(

Have you tried what I suggested?

21Development commented 1 year ago

@gfn256 to ensure we stay on track, can you elaborate on what you believe this will prove? My feeling is this is a API issue either with the integration or server side but open to other root cause analysis. I think we need to identify the root cause to solve the issue.

jkitney commented 1 year ago

don't believe that suddenly all these people have network issues at once.... restoring 3 months back but unfortunately operating system won't revert back to 3 months ago :(

image

restored to this version, fingers crossed

gfn256 commented 1 year ago

@jkitney So you are rather obstinate in refusing to even try what I suggested. @21Development In my experience, Tuya integration - and specifically Wifi Tuya devices - require a "clean" network to operate in, which includes but not limited to, stable LAN, DHCP and WAN. It definitely doesn't like NAT's, extenders and the likes. In the past when I "reset" my whole system - this definitely helped. I'm just trying to be helpful - and based on my personal experience - sharing it with others. If @jkitney refuses to even try, that's his right.

jkitney commented 1 year ago

ok restore still with problems think due to operating system not reverted?

anyway back to latest updates

image

now did as @gfn256 instructed .... we'll see. So far all my devices are online and HA switched on (with latest updates pre installed) after had all devices online.

Devices :

image

jkitney commented 1 year ago

Great, 20 min uptime and already f*** Rebooting everything surely made no difference, UPDATES DID!

KINDLY FIX. STOP ANY FURTHER NEW FEATURES AND FIX. USELESS HAVING NEW FEATURES ON A MALFUNCTIONING SYSTEM WHICH CANNOT BE TRUSTED OR HAS TO BE SWITCHED OFF TO KEEP THE LIGHTS OFF AT NIGHT!!

ty

cypherbits commented 1 year ago

Please don't shout to HA devs. Maybe the issue is on Tuya side. Remember they want it all on the cloud so they can earn money by services and selling your data, if not, they would be developing Local Tuya.

gilsonbeckman 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)

Exactly the same... Issue started on Sun, Mar 26 2023 (I dont remember what release was updated at this day but I remember the specific date because of my notes)

MH-CODES commented 1 year ago

Also having the same issue for a month and found this page today. Have also rebooted full network. Issues remain. FWIW, I logged into Tuya Cloud today and my sub expired in 2022-10-05 ... so it could not be that since it works after integration is restarted.

Hopefully this helps :-

This is what I noticed. The issue for me seemed to start after Mosquito Broker 6.2.0 was auto installed on my HA-VM. I had forgotten to disable auto-update. My VM is backed up every two days and when it started after a backup after which 6.2.0 was installed, all the fun started - none of the MQTT sensors (Solar Assistant as an example) on my side were reporting data. Tried everything including going back to an old backup but a similar issue. I only then realised that the Broker was auto updated (because I saw the alert it was available to update and chose to ignore it. So after restarting the Mosquito broker integration data immediately appeared in HA.

Since 6.2.0 , I lose MQTT data everytime the VM is started (it feels like after 2023.04 / 6.2.0 some start order must have changed). I normally need to restart the Mosquito integration and then it works. It could be tied to this too?

jkitney commented 1 year ago

hi,

been a while with this tread open and still unfixed... so that's it, my ha broken? broken since 26th March and to date still broken? Devs don't use tuya? Haven't noticed this? Way forward?

:( :( :( :(

gilsonbeckman commented 1 year ago

hi,

been a while with this tread open and still unfixed... so that's it, my ha broken? broken since 26th March and to date still broken? Devs don't use tuya? Haven't noticed this? Way forward?

:( :( :( :(

Hi jkitney, is your tuya broken since 26th May as well? Mine stopped to work this day that was the first daylight summer day in Ireland (I am from Ireland). Is it a coincidence ? maybe it will get fixed when the summer time is gone đŸ€Ł

jkitney commented 1 year ago

hi, been a while with this tread open and still unfixed... so that's it, my ha broken? broken since 26th March and to date still broken? Devs don't use tuya? Haven't noticed this? Way forward? :( :( :( :(

Hi jkitney, is your tuya broken since 26th May as well? Mine stopped to work this day that was the first daylight summer day in Ireland (I am from Ireland). Is it a coincidence ? maybe it will get fixed when the summer time is gone đŸ€Ł

I don't know the exact date but since you know i quoted yours. Yes been too long broken.... :(

antro31 commented 1 year ago

Hi all, same issue here on my side. Device updates at every restart but then also randomly. Waiting for your feedbacks on a potential update.

Vinceman74 commented 1 year ago

Bonjour à tous, comme vous j'ai des problemes de remontées de mes capteurs. j'avais mis en place une automatisation afin de recharger HA 4 Fois par jours mais meme comme ça de temps en temps j'avais des loupés, j'ai donc fait une restauration sur la version 2023.3.6 et plus de probleme. Donc pour moi le probleme viens de HA et non pas Tuya IoT

Update on May 15. 2023, I still have the issues 😭

PetrolHead2 commented 1 year ago

Looks like Tuya are working on a fix for some problems in the integrations, hopefully it will help this issue as well. https://github.com/home-assistant/core/issues/90661#issuecomment-1547230607

jkitney commented 1 year ago

image

Seems fixed 👍 đŸ„‡ :) :)
THANK YOU

gilsonbeckman commented 1 year ago

image

Seems fixed 👍 đŸ„‡ :) :) THANK YOU

Not for me. I've just updated and after restart and few hours late, the same issue. :(

jkitney commented 1 year ago

image Seems fixed 👍 đŸ„‡ :) :) THANK YOU

Not for me. I've just updated and after restart and few hours late, the same issue. :(

10 hours and still good for me, Licence on Tuya ok?

gilsonbeckman commented 1 year ago

image Seems fixed 👍 đŸ„‡ :) :) THANK YOU

Not for me. I've just updated and after restart and few hours late, the same issue. :(

10 hours and still good for me, Licence on Tuya ok?

Yes. I am not able to renew device status notification but IoT Core is renewed.

Device Status notification status: "The service API calls will consume basic resources. Please make sure that there is a basic resource pack available under your account. You can subscribe to the IoT core service to get a free basic resource pack."

image
antro31 commented 1 year ago

Hi all, I confirm I still have an issue even with the latest version and licence renewal. For example, one of my sensor did not receive any update between 18:55 and 20:50 today.

Bobby2ee commented 1 year ago

I have Same issue since march and still having with newest Update 5.3.. 😔

GregEdge commented 1 year ago

Update: Trying to add the integration again and I get error 2009 login error not support this device. Can't find this error. What device, rpi 4, Windows browser, tuya devices??? Mine also stopped working. I received an email from Tuya to say the 6 month trial was over and needed to be extended but in the same email said to ignore if a non commercial account. Integration hasn't worked since that time for me. I logged into tuya but can't see anything I need to renew.

jkitney commented 1 year ago

image Seems fixed 👍 đŸ„‡ :) :) THANK YOU

Not for me. I've just updated and after restart and few hours late, the same issue. :(

10 hours and still good for me, Licence on Tuya ok?

Yes. I am not able to renew device status notification but IoT Core is renewed.

Device Status notification status: "The service API calls will consume basic resources. Please make sure that there is a basic resource pack available under your account. You can subscribe to the IoT core service to get a free basic resource pack."

image

Started again, no updates have been done and back to square 1 :( I am very disappointed in system, should be rectified within days not months :((( not reliable..

escobarin3 commented 1 year ago

I haVe seen a lot of people complaining about this issue for a long time... They all claim the have updated the IoT Core... but looking at the latest images shared, I see that most of them have the "Device Status Notification" service expired... For example 2023-01-30 is January guys... Please update the service and tell us how it goes. I updated mine a while ago... and everything is working since then. Do no get fooled by the green "In service" status... If your expiration time is due... things will not be working probably,

image

21Development commented 1 year ago

Could one of the devs provide some insight into where the issue might be and who if anyone is looking into it / what we can do to help get the issue resolved?On 20 May 2023, at 20:06, escobarin3 @.***> wrote:ï»ż I haVe seen a lot of people complaining about this issue for a long time... They all claim the have updated the IoT Core... but looking at the latest images shared, I see that most of them have the "Device Status Notification" service expired... For example 2023-01-30 is January guys... Please update the service and tell us how it goes. I updated mine a while ago... and everything is working since then. Do no get fooled by the green "In service" status... If your expiration time is due... things will not be working probably,

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

Huxinator commented 1 year ago

I haVe seen a lot of people complaining about this issue for a long time... They all claim the have updated the IoT Core... but looking at the latest images shared, I see that most of them have the "Device Status Notification" service expired... For example 2023-01-30 is January guys... Please update the service and tell us how it goes. I updated mine a while ago... and everything is working since then. Do no get fooled by the green "In service" status... If your expiration time is due... things will not be working probably,

image

So i know that i'm not living in the future @escobarin3 but my device status notification is not expired and i have the same problems about the most people here are talking tuya

Bobby2ee commented 1 year ago

Same Here, every licence ist active. I tried to make a completely new instance, Same problems. Till now, nothin can solve it except a restart of tuya service. That helps for a couple of hours, Sometimes only minutes...

gilsonbeckman commented 1 year ago

Same here, device status notification valid and home assistant broken.

jkitney commented 1 year ago

I set a monitor for readings so if tuya service stops it will restart Tuya automatically. The counter is safe guard for false or missed readings.

temporary (i will keep tho) workaround until someone notices and fix:

image

image

upper switch: image

lower switch: image

image

image

image

image

image

PetrolHead2 commented 1 year ago

I set a monitor for readings so if tuya service stops it will restart Tuya automatically. The counter is safe guard for false or missed readings.

temporary (i will keep tho) workaround until someone notices and fix:

image

image

upper switch: image

lower switch: image

image

image

image

image

image

Nice! Can you see how often it reloads Tuya? Have you seen any changes in frequency the last couple of days?

jkitney commented 1 year ago

Nice! Can you see how often it reloads Tuya? Have you seen any changes in frequency the last couple of days?

It only reloads if and when needed.... My tuya devices always working fine since i put this. It will reload Tuya 5 min after it stops Can increase polling rate or decrease last switch number (5) if want less than 5 min

Vesa62 commented 1 year ago

I got _reload_configentry running once in the hour. Still the integration stops. I try your way, I hope it helps.

lagartujas commented 1 year ago

I recently updated HA to last version (docker) and i noticed this new log: 2023-05-24 15:58:06.343 ERROR (Thread-28 (_thread_main)) [tuya_iot] Unexpected disconnection.7 Perhaps tuya integration can manage internally that event/exception and reconect? Thanks

gilsonbeckman commented 1 year ago

Happy days, I am not sure if it is too early to celebrate BUT for the last 3 weeks I have had no issues with my Tuya devices. Status and everything else working properly since then. It worth to mention that I didnt do anything, no update, upgrade, patch, nothing.. Just started to work as in the past. What about you ? Have you had any issue ?

jkitney commented 1 year ago

Same here, all good :) :)

PetrolHead2 commented 1 year ago

Happy days, I am not sure if it is too early to celebrate BUT for the last 3 weeks I have had no issues with my Tuya devices. Status and everything else working properly since then. It worth to mention that I didnt do anything, no update, upgrade, patch, nothing.. Just started to work as in the past. What about you ? Have you had any issue ?

Same here, no issues the last couple of weeks.

cypherbits commented 1 year ago

Seems resolved for me too.

RLB7777 commented 1 year ago

It had resumed working, but seems have stopped again in the last 36hrs. Is it still working for others?

Z4RR0 commented 1 year ago
For me working but i made a automation that reload configuration o tuya every 8 hr Inviato da Posta per Windows Da: RLB7777Inviato: giovedì 8 giugno 2023 13:24A: home-assistant/coreCc: Z4RR0; AuthorOggetto: Re: [home-assistant/core] Tuya integreation don't update sensor, need to be reloaded... (Issue #91899) It had resumed working, but seems have stopped again in the last 36hrs. Is it still working for others?—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***> 
bartplessers commented 1 year ago

No issues anymore for last couple of weeks.

Regards, Bart Plessers

PetrolHead2 commented 1 year ago

It had resumed working, but seems have stopped again in the last 36hrs. Is it still working for others?

yes, still works ok.

RLB7777 commented 1 year ago

Strange. I reloaded and all fine. But it stopped updating again about 24hrs ago. Have manually reloaded. Will implement an automation but it seems very odd if this is only me.

luidgiguidini commented 1 year ago

I've also had to restart my automation to enable tuya integration to work again properly


De: RLB7777 @.***> Enviado: domingo, 11 de junho de 2023 08:01 Para: home-assistant/core Cc: luidgiguidini; Manual Assunto Re: [home-assistant/core] Tuya integreation don't update sensor, need to be reloaded... (Issue #91899)

Strange. I reloaded and all fine. But it stopped updating again about 24hrs ago. Have manually reloaded. Will implement an automation but it seems very odd if this is only me.

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

RLB7777 commented 1 year ago

Mine is still not updating. It did resume working a few days back, but stopped again. I’ve written an automation which checks if it’s been more than 30mins since a Tuya sensor updated, and if so reloads the integration (also counts the number of reloads via a counter I created in ‘helper’).

The Tuya sensor needs to be one that isn’t ‘low power’ so fires off near constant updates. Normally that means USB powered and not battery. The reload command can point at any Tuya device.

alias: Restart Tuya if failed for 30min description: "" trigger:

RLB7777 commented 1 year ago

I'm still having a huge amount of trouble with Tuya not updating. Having dug around in the Tuya IoT platfrom, I found that despite having renewed my trial, my system was over the monthly quota (in the Centre Europe data centre, which is the one needed for the UK). See the screenshot. It says my system (60 Tuya devices) have made about 54,000 API calls in the first 19 days of June, which takes me up to the Tuya $0.2 monthly limit for a trial subscription. Can anyone else take a quick look at their IoT platform and let me know what your API call rate is? My 54,000 seems very high for 19 days so I wonder if it's not resetting evey month as it should. 60 devices is quite a lot but it's not crazy. Screenshot 2023-06-19 09 16 49

21Development commented 1 year ago

I've just checked mine and I have 1762 API calls with 16 devices so 1762 / 16 / 19 = average of 6 API calls per device per day. However, looking at my API calls, I have a few devices which are making more calls and some making very little i.e. some sockets are reporting Power / Current and Voltage alot when being used.

Looking at your stats; 54,000 / 60 / 19 = average of 48 API calls per device per day

Take a look at the Cloud / Development / Open Project / Devices / Debug Device section - you can look through your devices to see what API calls are being made.

RLB7777 commented 1 year ago

Thanks, @21Development That’s very helpful. I looked and I’ve got two air quality sensors (USB powered) that seem to report 7 different datapoints every five seconds! I’ve disconnected them and will see how things go next month.