Cycle off/on zigbee Smart Plug if internet goes down

Is there a way to set up a rule that will switch a zigbee smart plug off and on if the internet connection is lost?

I currently have a new router that is randomly freezing and cutting the internet. If you switch it off and on it is good to go again.

Still working on the cause of the router freeze but in the meantime if I can set up a local zigbee smart plug to switch off and on again it will get the internet going if no one is home at the time the router goes down.

In RM you should be able to periodically ping a cloud-based site / address to confirm Internet connectivity, then control the switch. Alternatively, Hub Info may even include some status for this.... I can't remember.

I would proceed with caution, though... If some other factor is resulting in your Internet being down, you may restart your router unnecessarily and potentially cause other issues or inconvenience. I would, at the very least, include some delay between potential power cycling of your router, plus a manual override, if only to provide you with an opportunity to intervene in circumstances where you don't want the restarts to keep happening. Admittedly, you could always just remove the smart plug from the equation as a manual intervention, but for times when you are not around, perhaps a max of 3 reboots would be a worthwhile safety net.

Yeah, a delay is a good idea. I can set a 1/2 hr delay and if the internet has not come back on in that time then cycle the plug.

Currently it has been running for 8 days without a dropout so maybe I am getting close to fixing the problem. It might be something to do with the 160MHz/320MHz and DFS channels.


I have Xfinity cable Internet which has been quite stable. So my Arris modem and TP-Link router rarely go off line. However, I have a number of WiFI connected devices such as Amazon Echo Alexa devices that can occasionally lose connection. I use Hubitat Ping to ping the reserved IP address of each device every 10 minutes. If the pings are not returned, I turn off power to the device and then turn it back on 30 seconds later using an inexpensive Zigbee Smartplug for each device.

You can do exactly the same thing for your cable modem and router. You can ping an Internet address such as (CloudFlare public DNS) or (Google public DNS) to see whether modem and router are online. If you have an integrated modem/router, you only need one smartswitch/plug. If you have separate modem and router as I do, it is best to have two smartplugs. If the Internet ping is absent, turn off power to both plugs for 30 seconds. Then turn on the modem power and wait another minute before turning on the router. You want the modem to boot up first. Be sure you use Zigbee or Z-wave smartplugs connected directly to Hubitat. If you try using a WiFi smartplug, once your router disconnects, you will lose control over the plug. Hubitat wil continue to function normally even without a connection to your router.

Yeah, that it why the topic heading says 'zigbee smart plug'.

Im on fiber so only a router so can just ping for one device. but I didn't think to check to make sure it is not just wifi that has gone down. So next time it happens I will also check to see if a computer connected with cat 6 is down as well.

I had an old Netgear R8000 running FreshTomato that virtually never went off line. This wifi 6/7 stuff has been giving me a headache.

When I respond to questions, I always write such that both the OP and anyone else reading will understand the issue. In this case, Zigbee is good.

Since you are on fiber, the signals come into your home as Ethernet over fiber, so you do not need a modem. You only need an ONT, optical network terminal. Some high end routers have them built in. I have a TP-Link WiFi6e router that has an ONT, but I have cable inbound. Unlike you, I do need a modem.

The ONT is a UPS powered 4 Uni-D / 2 Uni-V port GPON NTD so I can have 4 independent network providers if I wanted (one on each port). The Router is plugged directly into one NTD port and uses IPoE with a static IP. Generally speaking this is extremely stable. It is only since I upgraded the router that I have run into trouble. Still working out what the actual issue is. But I will have a look at the Hubitat Ping function which I haven't really looked at yet.