(local)Tuya Smart Plug goes 'unavailable' for 7min once or twice a day

Hello all,

I have a slight problem with my Tuya Smart Plug/Socket.

About 2-3 weeks ago, I connected the plug to HA using the localtuya integration.
It works perfectly overall, but I notice it goes ‘unavailable’ once or twice a day. It stays ‘unavailable’ for ca. 7 minutes, and then comes back online. This 7min period is the only constant/pattern I can see. There is no clear pattern in when it goes ‘unavailable’ other then once or twice per day.

What could be the reason of this? Where could I find a logfile to see what is happening? Thanks all!

You could check the network signal strength, via the smartlife app…I have 3 tuya devices and all are quite poor on wifi connection (I stopped buying them)

I will check. But this plug is 0,5m from the WiFi router. It’s literally right next to it. So I think even the worst WiFi range should not be a problem here.

Edit: Signal strength in Tuya app is -38dBi. So that should be more than fine.
Can I also view/log the signal strength from HA (so I can log it in case there are sudden drops around the same time it goes unavailable)?

So that is not-it…and for my devcies I donot have the sigstr visible.
I looked at your log and it seems to be either ‘on’ or ‘unavailable’, no ‘off’ …might that be the case?

The plug does stay (physically) ON the whole time. It does not turn off when it goes unavailable. So it makes sense to me that when it comes back online, it shows its actual state, which is ON.
When I turn it off by the physical button or by HA switch, the log does show “turned OFF”.

Since its always approx. 7min of downtime, I was wondering if the plug maybe does some ‘maintanance’ in its firmware, which temporarily disconnects it.
I did notice once that when it went unavailable, 3min after that I reloaded the localtuya integration, which made it come back online immediately. Maybe this is a clue?

I’d like to monitor the internet traffic of the plug somehow, but not sure how. Maybe it’s “phoning home” during those 7min, or sneakily working as part of a botnet in that period?
I’ll open a new thread for that, since it’s a bit off topic here.

You story made me look at mine too now and lo and behold…I have a similar behavior for my powerplugs (always on) between 3 and 10 times day…

Also always 7min (± 30s) of downtime?
3-10 times per day is definitely a lot more than mine. Here it’s mostly 1-2 times per 24h. The 3 times in the attached log was an exception.

Did not analyse all, mostly 30s… exceptional up to 1.5 min but this may also be due to restarts of HA

I just checked the Tuya app when it went ‘unavailable’ again in HA. In the Tuya app it showed “offline” during that time. So I guess it’s Tuya-related. Correct?

I donot have this info, did check all my devices and only one has a large amount of unavailable, yst 20+ times. When the app provides the same info then it is at least not HA, if it is Tuya or the router to which it is connected to, I cannot tell. For me, the powerplugs are ‘unavailable’ but still ‘on’ (else my HA machine would die)

The device is often offline, the device or device indicator keeps flashing, and the device cannot be controlled. What should I do? (tuya.com)

What is the reason for offline offline heartbeat in the background? (tuya.com)

What is the device offline rule? (tuya.com)

Yesterday evening I changed the dhcp leasetime on my router from 1 day to 7days. And knock on wood today is the first day it has not gone unavailable in the past 24h.

But its weird, because if that’s the problem, I’d expect it to go offline exactly once per day. And not sometimes once, sometimes twice, and sometimes trice.

Indeed… why would I have one that changes 20+ times and 3 others (same make) 1-2 and sometimes not…same router too

I have a similar problem with 4 GU10 light bulbs, but the odd thing is that in the Tuya app, they are online, but via local Tuya, one 3 out of the 4 or sometimes 2 out of the 2 or none will be online. At times restarting Home Assistant sorts that out. I personally think it is an issue with the Local Tuya integration. I haven’t really sat down to assess the logs in HA or not, but I cannot think otherwise.

I should’ve knocked the wood harder. It went unavailable 3x again. Once yesterday at 2307. Then again at 0021. And again at 0730.

I think (in my case) I can rule out HA or localtuya. Since the same happens in the official Tuya app in the same timeframes. On the other hand. The only time it came back online after 3min instead of 7min, was when I “reloaded” the localtuya integration.
So sunmerized, I still have no clue what’s going on. Maybe when it goes offline, localtuya doesn’t check in real-time if it’s back online. But perhaps every 5min or when you reload the integration.

I tried to make an automation to send me a android notification when the state changes from ON to unavailable. But for some reason its not triggering.

Careful conclusion for me would be to stop buying the absolute cheapest Tuya stuff on aliexpress. xD
Would it be a good idea to move over to zigbee? Or could that have the same problem since it still works via a Tuya hub?

Regardless of all this, my devices work but I fully agree… dump Tuya, I never liked the need to be connected to Chinese stuff (and neither would I be with other countries, let’s not kid ourselves)

Yesterday I learned that the iot account for Tuya, required for e.g. localtuya, changed to run with monthly free renewals (I had a 1 year), all other subscriptions are expensive beyond words. The expiration will hit me in 4 days and if this indeed brings down the devices then for me the choice is clear…
Zigbee has always been OK for me but you will also find many people favorizing zwave, I just donot want yet another dongle dangling :slight_smile:

I bought another (WiFi) Tuya smart plug a couple days ago. This time not from aliexpress but from the local “Action” store. LSC Smart Connect branding.

I noticed this plug does NOT go unavailable. At least not in the past 4 days.

So I guess we can carefully conclude it is a device/firmware problem, and not HA or even Tuya.

I tried to “remove and wipe” the plug from the Tuya app and added it again.
The behaviour now changed. It still goes unavailable in HA, but no longer for 7min but for 1s. I guess that’s a large improvement and a non-issue now.

Sigh…
I just don’t have luck with these smart plugs…

The second smart plug I bought (LSC Smart Connect) seems to have a different problem. And this one does seem more LocalTuya related:

The plug stays online in the Tuya app and I can still control it from there. But it goes “unavailable” in Home Assistant. And stays that way for hours. It does not come back online. Reloading the localtuya integration does not fix it. The only way it comes back is when I unplug, and replug it into the power socket. I did not try to restart Home Assistant yet to see if that fixes it aswell.
Another difference is it does not leave a “smart plug 2 became unavailable” in the HA Logbook like the first smart plug does.

This is almost even more annoying than the first plug that goes offline in both Tuya app and HA, because I use it to turn my bedroom heater on/off with the HA generic thermostat. So last night I woke up all sweaty in a fricking sauna because it went “unavailable” while it was turned on. So the generic thermostat could not turn it off to keep a stable temperature.

Which logs should I check to find out what is happening and where can I find them?

Thanks!

Local tuya disconnects devices but cloud is working. This tuya seems to be something that I shouldnt add to my smarthome anymore.

I would 100% agree with that.
Recently I added 2 more tuya bulbs to my home that I bought years ago. They also keep going unavailable. So it’s definitely the end of Tuya for me. Zigbee only from now on. It’s just unfortunate the zigbee products are 2-3x more expensive. A Tuya (WiFi) lightbulb costs €3,50 at Action, while I can’t find a Zigbee equivalent cheaper than 8-10 euro/piece.
Thankfully the 2 old Tuya bulbs are old enough to still be based on a esp8266 IC, so I’ll try to flash them to Tasmota with Tuya Convert when I find out where I put my RPi. It’s unfortunate that is not possible with newer Tuya products.

It’s kinda hit and miss. Other Tuya bulbs I bought at Action more recently do work flawlessly. Both cloud and localtuya. But overall its just too much headache. A smart home is supposed to work for me, not the other way around.