Tuya integration hangsup

some months have passed and my tuya devices start becoming unresponsive again.
How about you guys?

Now it is 3 days ago that I got an hick-up, but the week before that last occasion was terrible, it made me activate my “auto-reload-on-Tuya-stuck” (Tuyatest) automation again.

as of today, what type of automated reload mechanism would be the best?

update: Just tried your Tuya Test v2.2 automations script :slight_smile:

Can you tell me where in the script the tuya integration gets reloaded? I cannot find it.

It is loaded by this mechanism (you can find it in the just updated script in message 31 above):

              - service: homeassistant.reload_config_entry
                data: {}
                target:
                  entity_id: switch.yyyyy_child_lock

thank you very much :slight_smile:

I accidently tried the 2.2 version, just saw there is 2.5, so I just installed it.
Habe been looking at the logs from last few hours:

tuya

This means a reload almost every hour? I dont get the failure counter. It inkrements to 1 and ist then set to 0 again.

No, that doesn’t mean that it reloads every hour, it means that it does a retry every hour. Which is precisely the interval Home Automation is “refreshing” the connection with Tuya and that causes a dip. That means your automation works! If the fail counter goes above 1 then a reload will be performed and your success-counter will be reset to 0.

ahh OK, thanks for the explanation.

@SvanGool
I am trying to use the Tuya Test v2.5, but I keep getting this error:
The automation “Tuya Test v2.5” (automation.tuya_test_v2_5) has an action that calls an unknown service: telegram_bot.send_message.

I fixed the message problem by deleting the service call :grinning:

Because some Tuya devices report an incorrect condition while others respond normally, this solution unfortunately does not work for me. So I have now set an unconditional reload every hour.

The device I’m using as a “reference” always is down when Tuya is down, so it works for me, you are right you could also reload every hour, but the less the better (it causes short outages). Last week and now Tuya is unstable again, the last 7 days I had 20 reloads (it is a kind of ridiculous!).

I’m having this same problem for long (and I see there are many threads for as long as from 2021 with this problem happening. Many being automatically locked at github, which is a shame about something that is not fixed on december 2023 yet). I have one plug that sometimes do what I order, some other times obeys to ON, but come back to off linmediattly, keaving the real socket in ON and not being able to operate again through HA until reload tuya integration.

also having the ‘not updating watts or amps’ on some sockets.

So. as I see that this has been for long, I’m trying SvanGool automation v2.5 right now:

tuyatest

As the reference entity I’m using a socket that I know to be failing from time to time with the ‘not working ON/OFF’ thing… I have selected the child lock entity as SvenGool does. I haven’t realized that that entity becomes unavailable when the failure is happening… but I suppose it does, as it is used in your automation to check for the problem.

I have also added my ‘target:’ number in the telegrams service to be alerted when shit happens. Also fulfill de entity_id, and created the 2 counters and the 1 boolean.

Not sure yet If the automation will keep me going when the failure happens, but SvanGool automation, seems very nice made and complete. THANKS A LOT FOR THE EFFORT!!!. I will post if I start receiving telegrams of tuya eructations in the next days.

I have had a ticket open on the tuya IOT site for months about this. I just asked again on there when this is going to be resolved, and they pointed me at this beta of their new integration which is installable via HACS - GitHub - tuya/tuya-smart-life: Tuya Smart Life Home Assistant Integration

They said, I quote, “it will improve the issues about the device Status updates”.

I have installed it alongside the existing integration, so I have lots of duplicate “_2” suffixed entities for now, if I decide to convert then it is going to take some work to remove the old and then re-install the new and check the entity names everywhere…

It is far easier to install, no messing around with IOT projects, you just enter a code from the smart life app, then scan a qrcode that the integration puts up using the smartlife app to authorise, and you’re in. It picked up all my devices. Only just got it running so can’t say if it has fixed the problem yet.

1 Like

I have been investigating some days to solve my problem. And it is a good moment to comment what I have check so far.

About the beta of smartlife addon, I read you that they told you to test it… but I decided not to try, when saw that it was not fixing the auto-updating Amps and Watts of some smart plugs. Don’t remember where I read it.

I try the Svangool automation. It doesn’t work. Reason: My two failures are:
1.-some plugs stop working turning On, then they auto-off and never get conecction again until tuya oficial reloaded. This was fix by the automation of Svangool.
2.-some plugs are not sending updates about current or power consumed unless you open the app on the phone (which always update ok). This was not fixed. Even restarting the addon. So the automation doesn’t work for me 100%.

I try localtuya addon. Some time ago I used localtuya, before the Tuya official. But because of this problem I retry this days. It didn’t work for me neither. Some plugs are not detected. My guess is that the more modern ones (protocol 3.5) are not detected/working. (I only see mention to 3.4 on configuration, so could be that localtuya is not being yet supporting 3.5 devices on dec 2023, not sure)

And Finnaly the path I’m into now and that has really good possibilities of being the solution: Tuya-Local addon.

I will buy some coffees to this guy. I have test 3 of my plugs so far, including some bought this days (december 2023 which has 3.5 protocol version on firmware). And they worked flawlessly.

-It updates readings, at least 1 time per minute. Enough for me.
-Recongnise by now my smart plugs that were not recogniced with other addons.
-plug switch worked perfectly and fast. I suppose they are operated on the local network, so they will work even when no internet connection is up.

The only little problem, is that when you ADD one new plug, it asks for the protocol that the device use. You usually don’t know, and if you set it to AUTO. It doesn’t get it correctly, so I have to go switching from v3.1,v3.3, v3.4, v3.5, etc… until one of them pass and I end the device config. Not really a big problem.

One final comment. I reviewed my iot tuya console configuration. I have a project created on first days of 2021, and read somewhere that to work with Tuya 2.0 official, project should be created after May 2021… so I create a new project and linked it with my phone tuya app as per documents. And got all tokens green and working… but that was not fixing the Tuya offical addon neither. They way for me is tuya-local.

Hope my research this days, reduce your time investigating.

‘blunderingabout’… don’t forget to comment here your experience with the beta smartlife addon (I haven’t tested it). About Watts and Amps updating and about loosing switchs on/off breaking after two hours, which are the problems I have been suffering with the Tuya Offical addon. Thanks.

Well… after 24 hours, I am still running with the two integrations side by side. Even though I have not updated any entities yet (so all my automations and node red stuff is using the Tuya entities still), since I activated the new smartlife integration, I have not had a single problem with either the new entities on the new integration, OR the original entities on the “old” Tuya integration. Status updates have been completely reliable. Right up to the point I started the new integration, the Tuya one had been really terrible for the past few days, lucky if it would run for an hour before status updates started failing. So something going on under the covers due to how the new integration works is also causing the original Tuya integration to work perfectly once again too.

I have enabled some of the power monitoring entities on the new integration, and I am seeing those update correctly too, so I will soon be ripping out the old Tuya integration and converting everything to the new one. I plan to remove both, restart HA until all the entities from both are gone, and then re-install the new one, at which point hopefully the entities will (mostly) be named the same as the original instead of having the “_2” suffix, which will minimise the amount of work I have to do elsewhere.

…that’s a good find. Maybe that has sense, because if you think about the problem of entities not updateing when only running with Tuya official… if you open up the phone app, they start updating in the HA instance.

So, that could be the reason of your behaivour, that when you have the smartlife beta installed, maybe the tuya devices get ‘excited’ too and update ok in the official app.

I think that to have a clean install, it will be better to have only one of the addons (smartlife beta for what you say, which is the one that updates and force the official to update). Or in any case… some devices in one addon and other devices in the other addon. Not repeating them in both sides, in case, that for example a camera is compatible with official and don’t have any problem, but not with smartlife beta (just an example, don’t have to be that way).

In any case, remember that you can disable an integration, and that way you are not forced to remove the whole offical config. You can disable it to test, and devices and entiities get unavailable and you can re-enable the integration later and recover them. I have disabled official for my tests with tuya-local, like that:

(right now, I’m working ok with my smart plugs on tuya-local (not localtuya), updating once each minute perfectly).

Well, after several weeks of running both integrations and not having ANY status updates failures, I finally got around to switching over to the new (still beta) integration (see my link to it above).

I deleted BOTH integrations to completely remove all the entities, and then re-installed just the new one in order to avoid all the “_2” suffixed names, and so MOST of the entity names it created were the same as the old Tuya integration was using, only a few were different due to device renames on the Tuya side - so I did not have as much work updating entity names in cards/automations/node red etc. as I feared there would be.

And the result is, it is an absolute breeze to install compared to the old Tuya integration, no messing around with IOT projects or having to re-auth etc. You just enter a code from the smart life app, scan a qr code, and it picks everything up. And it just works.

Great. Thanks for sharing. I will do the same.