I have a vacation house with a Hubitat connected to a router that must be restarted when internet service is restored after a blackout. The internet service is Ziply fiber (500 Gb/s up and down, except when it's zero, which happens often). Normally I would expect a router to reconnect automatically after an outage, but this does not seem to happen. Neither I nor Ziply know why. Invariably it does reconnect with a power cycle.
My thought is to plug the router into a Zwave switch, and create a rule that triggers if the Hubitat detects the internet is lost. The rule would periodically power cycle the router, and then leave the switch on if internet is detected.
I see that Web Pinger is deprecated, and I could find no other way of having the Hubitat trigger if internet is lost. Does anyone have a solution to suggest?
Make sure the Hubitat is on a UPS. Use @thebearmay 's ping tool. Have it ping lets say 8.8.8.8 every 10 mins. On a failure have it turn off then turn on a z-wave/zigbee outlet that the router is on. Don't put the router on a ups.
I have a rule that does maybe what you want. The router is plugged into a zigbee outlet.
Every hour it checks if the internet outlet (router) and my POE cams outlet. If they OFF for some reason then turn ON, escape rule.
If the internet outlet (router outlet) is ON already then ping 8.8.8.8, if it fails the ping then turn OFF router outlet for 15 sec and back ON. I found that a power cycle recovers it if hung up. Then send me a notification that it had to be reset.
If you have a device like the Ring range extender you can sense when the power is out and then try to restart the router once the power comes back on (after a suitable delay).
Sorry, I may have confused the issue. It's not that the electrical power to my router or hub is lost, it's the internet connection to my router that is lost and then is restored, but my router doesn't detect that. My router and the hub remain fully powered during these events. If I power cycle the router (OFF for a few seconds, then ON), the router reconnects to the internet just fine. I just want to automate that process because I'm not always at this vacation home.
Aha, understood.
We were having a discussion on Remote Reboot earlier today.
I kind of like:
[https://www.amazon.com/dp/B081TKJJBS/ref=emc_b_5_t]
This what I use at a location where the router needs to be reset to restore the internet, it works great! I use one plug for the router and he other for the modem. It's highly configurable. Ping locations, frequency, timing for reset, etc...
Yes, that's the part of your rule I would like to try first, but as a newcomer I'm having trouble making a rule that looks like your's. Specifically,
(1) is pingValue a Local Variable you've declared, or something else? I can't reproduce your second line in the ELSE clause.
(2) I have declared InternetRebootCounter as a local variable (number) and seems to be counting up (Log %InternetRebootCounter% displays it value correctly.
(3) I don't understand how the results of the Ping(8.8.8.8) are determined or used for logic to stop pinging.
Here's what I have so far...
After a trigger this is all you need to make this power cycle your switch or outlet. Off, delay 15sec, On.

ping Value = 100 is what the Hubitat developers designate as a ping fail.
The rest of that rule is so I can track how many times it resets and send me notifications
Swap "R Outlet Internet" with your switch name.
Got it. Key for me was to make pingValue a Hub variable, and not a private variable as I had it. This allowed me to make your second line. My intent was to check the internet connection a number of times a day, and if it's up, do nothing. If it's down, then try a router restart every 5 minutes until it's up. Here's what I got now (and thanks to all for your helpful suggestions):
Oops, I had to add a 2 minute delay after restarting my router to allow it to reconnect successfully....
That's neat and exactly what I am looking for (and also really should be an app!)
Quick question: I am unsure I understood how you captured the ping results. What is TestSwitch, and how do the ping results get assigned to it?
I think TestSwitch is a “left over” from his testing. The current version of his code never uses %device%.
The ping results go into %value%.
i would put the router on an ups and the zigbee or zwave switch between the ups and router.. why would not not want your router on an ups.. surges and ups/downs can fry them or more readily the radios.
I use a two port Zwave plug connected to my ups.
Modem in one and router in the other.
I restart the modem if ping of 8.8.8.8 fails and check 5 minutes later.
If it fails 3 times in a row, I restart the router and check in 10 minutes.
Rinse and repeat until success.
Tom
I have a BrightSpeed/CenturyLink fiber modem which tends to go silent whenever I’m not around for a while.
Thanks all for your inputs. I have a couple of weeks now operating with a close variant of the rule I posted above, and it seems to work well. As I did electrical and LAN wiring work on my house for other matters, I interrupted both electrical power and internet connectivity a number of times, and service always restored itself. I haven't (yet) installed an UPS on the router nor the Hubitat. I did make a number of IP addresses static on my router.
I did create a companion Rule to simply restart my router each day at 1 AM, but I stopped using it because it seemed to cause a curious problem: My wife likes the Hallmark Channel, and we stream that service as an app on an Amazon 4K Firestick in our Oregon house. Every time the router recycled, that app got confused and we had to logout, then go through a stupidly-hard procedure to restore service with Hallmark. Same thing happened if I manually recycled the router power, so Hubitat wasn't causing the problem. Probably just a badly-implemented security protocol by the Hallmark software gurus. No other Amazon apps were affected in any way.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.



