Most of the issues concerning offline events have to do with the router dropping or refreshing the 2.4ghz WiFi signal, channel, WAN or LAN IP’s.
Simple solution is to add a cheap 2.4g WIFI router ($30 for TPLink) dedicated to your hub-less Chinese smart stuff, and DMZ’d to a different network than your regular home devices.
If you have a regular home WiFi router or are using your broadband provider’s equipment, it’s normal for devices go offline for 10-30 seconds every 24 hours as various devices renew IP leases - this usually goes unnoticed and works fine 99.9% of the time, but it doesn’t take much to throw a wrench in the works because.....
Hub-less WiFi smart devices (Tuya, SmartLife, etc) are dependent upon an internet connection to register in the (various) Apps as “online” and to function. Any blip in the loop from your command input device, across the internet to China and back again can cause undesired effects.
Unless you have a truly static IP from your broadband provider (which nobody does), your broadband modem & router will be renewing their respective leases every 24 hours, both to your WAN Internet connection as well as local LAN / WiFi devices. Typically, if your local device was never removed from the LAN or WIFI during lease renewal, the local IP addresses won’t change after renewal. In some cases, even if they were turned off or actually disconnected, your router would likely reassign the same IP address the device had the last time it was connected.
Most home routers do fine with 15-20 devices connected simultaneously, and even more if they’re a phone, tablet, laptop, etc. (with a more advanced WIFI control system). But we’re talking about rudimentary IOT WiFi devices here, and that’s where the issue is. Those devices rely on an app on a server in China to control them and they try very hard to stay connected - bombarding your router with heartbeat requests every 10 seconds or so. Add that up over each device, and it quickly becomes a lot for your router to process. It is easier / less resources for your router to process large amounts of data to only a few devices versus tiny amounts of data repeatedly to numerous devices. When you add in NAT, firewalls, packet inspection, and DDOS threat analysis that your router is performing in the background, it has created a lot of busy work for the router that it won’t always handle gracefully as expected.
Dual/Tri band 2.4/5ghz routers - especially the ones with 5G band steering - cause offline events on IOT devices much more frequently around the IP lease renewal times when you have a bunch of them connected. I have a $350 Linksys router that started to offline EVERY device on my network (phones laptops and all) every 24 hours +\- 15 minutes like clockwork, requiring a manual restart or manual WAN IP release / renew - that happened once I hit over 50 devices connected simultaneously (45 on WiFi), the majority being my IOT smart stuff (around 30). Prior to that it was occasional, maybe 1-2x a month.
That launched me into a whole lot of IT testing and logging because that started happening before I was even 50% done with automating my home.
Keep the following in mind....
Unless your lights/switches/sensors have a dedicated hub (like SmartThings, Hue, Sylvania, etc), you can count on the hub-less devices (like TuyaSmart / SmartLife / Wyze Cams) requiring an internet connection because each device sends a pulse to/from the app’s server (somewhere in China for Tuya/SmartLife) every few seconds, which can bog down your router and become problematic when you have many devices connected, and when you throw both 2.4 and 5G WiFi signals going to the same network into play.
There is no way to get around the devices requiring an internet connection (without some advanced firmware flashing and custom server setup), and therefore there’s also no way to get around each device needing to communicate with its home server in China.
The offline events can be caused by the router changing 2.4G channels, renewing WAN or LAN IP Addresses, or simply running out of resources while trying to clear cache and handle a lot of devices at one time. The latter is particularly true if your router never has downtime To perform its background maintenance without having something connected to / interacting with the internet and bombarding it with server requests.
If you have an incoming / outgoing log on your router, check it and you’ll see requests from the same 3-5 servers every minute that an entry is created.
After much trial and error - weeks of time on my part - and over 75 devices connected to my home networks (43 smart home devices), I have a simple piece of advice that will reduce some headaches here.
If you’re going to use the cheaper Chinese stuff (they work great I have a lot of them) then put them all on their own dedicated network and router.
Add a cheap dedicated 2.4G WiFi router to your main router, DMZ the second router directly to internet with no firewalls, and create a dedicated / separate network for your hub-less IOT smart switches, plugs, cams and sensors - with different WiFi name and password, and different IP network. Let the second router act as its own DHCP server, and create a different IP numbering system than your original home router. If possible, use a VLAN. Even better, if your broadband provider doesn’t care if you pull 2+ WAN IP addresses, then add a gigabit network switch between your modem and first router, and bypass the connection of the second WiFi router to the first one all together. Your hub-less IOT smart devices don’t need to be on the same network as Alexa, google, etc. to work because you have to link them through the app and the commands are always sent through the internet anyway and processed on their server.
If your original home router does not have a DMZ option (most do) then set second router WAN IP manually (to one local to first router) and manually add firewall bypasses for it to the first router. You should also go ahead and turn off any firewalls on the second router since there is really no point in fire walking a device that is already unsecure and sending your info to China anyway.
Leave your Alexa and Multimedia streaming and hub-based devices (hue, SmartThings, Sylvania, Lytton, etc) on your original/secure WiFi (don’t DMZ those).
Having your hub-less IOT switches and stuff on a dedicated WiFi network that has no firewalls makes it faster, and more secure (provided that those are the only devices on that network) because you’re not giving away and sending your regular WiFi credentials to a Chinese server every 30 seconds and....only their devices are on that network so separation is the security mechanism, not inspection by the router.
It’s faster because your main router is not having to NAT and inspect the packets to the individual devices (only the one device IP to the second DMZ WIFI router). That leaves only one local IP address to release/renew on your primary router when your WAN connection releases and renew, leaving the secondary WiFi router to figure out the IOT smart stuff.
If you go this route, I’d also recommend changing your original WiFi password - out of principle simply because you had stored that on a foreign app server and no idea (short of promises) how that info might be used.
You can buy cheap 2.4G WiFi routers for under $30 on amazon. Signal strength and speed for these types of switches and devices doesn’t require much at all. Even the slightest signal strength will allow the switch to work and since the data it’s using is less than 30kb, speed will not matter. If you have a big home you could add a couple of them and set one as a WiFi repeater. Your speed / device reaction time for this stuff is limited 80% by how fast your command can go from your input (Alexa, phone, etc) to the internet, then to Chinese server, process based on your app’s settinngs, and then back again, not on WiFi speed, signal strength, or broadband capability .
The key to remember when adding a second router is to make sure it’s a completely different WiFi name and completely different network than your original home router - how you choose to separate them is up to you.