Help with rule for rebooting router if no Internet

Hi all. Seeking some help writing a rule that will power off and then power on a switch if no Internet is detected. I've found some old discussions of how to do this, so I know it's possible.

Sadly I've been unable to penetrate RM to figure out how to set it up. Here are a couple of discussions where the idea comes from, but they're old and closed.

I can set up ping in rule machine, but have not been able to find any means of setting a ping value. And then since I can't set a ping value I can't set and IF variable equals THEN.

This is probably simple for the experienced, but impenetrable for the way my brain is wired.

Any RM 101 help would be appreciated.

Thanks in advance!

What about just a simple reboot rather than a full power down/up cycle?

I believe the OP is wanting to power down the router, wait at least 30 seconds then turn on router power.

After reading the posts you have linked I realize that you need help getting started.

First step is to install Rule Machine if you haven't done it already.

To create a rule click on RM in the app list. You'll get this type of response.

Enter your Rule name and then select the Continue button RM wi) create your first rule and you'll get this response.

This is the rule from the linked post.

Please review the documentation for RM and ask questions.

Good luck

1 Like

I guess I see them as one in the same. The router needs to be turned off and then a moment later turned back on. There is no elegant way to do this, so power off and then back on needs to be the approach. Or maybe I'm missing something.

i would not write it this way why wait 10 minutes. i would use the ping app and write a separate rule that says if ping missed maybe 2 or 3 pings ie down for 20 minutes or a half hour. off/on immediately.

ie

just use the ping device that way can set it to more that one errant ping.

replace the notification i have with off, on delay say 10 secs. to get it to go off then on..

1 Like

Thanks JimB

I can get started, but I'm lost after the Ping step. I can't figure out how to set the Ping variable and all that follows. Here's a screen shot of what I have. My trigger looks a bit different, but I can't find a way to match the example.

Here's a screen print of the original, which I'm not trying to copy exactly, but I think is close to what I'm after. The circled and arrowed bits are the ones I can't figure out how to find and incorporate in RM.

And yes, I've read all the documentation and have put together many rules, apparently none have had this level of opagueness to my mind.

Appreciate the assistance.

@kahn-hubitat The delay is for 10 seconds not 10 minutes
Also, please remember that the OP will be writing their first RM rule. Not the time to be fancy.

granted but i am not sure dealing with a variable first time is easier than dealing with a device and a simpler rule.. but to each his own.

First create a string variable.
You'll need open the Action list The Variable list is at the bottom. Click on the green+ sign to create a string variable.

Progress. Hadn't been able to find that on my own. Now seems obvious. I'll do some more poking around and see where I end up.

Thank you!

IMO I would be looking at the logs of the router and try to identify and correct the problem there.

While I agree with you, I'd thought that a quick back up just in case would be helpful in the meantime. Not sure if my problem is a firmware or hardware problem, but others are or have had the same issue.

Haven't had a chance to work through the Rule Machine puzzle any further, but will at some point in the next few days.

Thanks

I have a RM scripts that runs once a week at 3 am;
Send POST to http://192.168.0.11:8080/hub/reboot
Simple

I'm having the exact same issue as the OP, but while it seems like they've given up for now, I am struggling to continue myself. Can you please help me? This is also my first rule in RM, and also relatively new to Hubitat. How do I set the variable, and what variables are needed to accomplish this same task as OP. I can set the "PingValue" to 100, but not sure where to go from there. How do I set "PingValue" to %value%? How does any of this equate with a ping failure? Can you please step by step this for me, like your talking to a newbie to all this? And for what it's worth, I'm usually pretty tech savvy, but this I just cannot figure out for the life of me. I've already spent 8 hrs now today trying to figure this out :frowning:

This is my rule to reboot when the internet it down.

How do I add photos so I can post what I have so far? It keeps saying I can't add embedded media to a post...

I've essentially gotten the actions listed above by JimB, at comment 3/16 ... will that work as intended? I've got it setup temporarily with just a light bulb to test with, so I don't turn off my actual modem until I know it works... but also I guess I won't know until a ping fails

Once you have tested your rule on a light, then create the actual rule to toggle the router power.
You can test that rule by disconnecting the Internet from the router. Make sure that you have logging turned on in the rule before the do the test.
Suggest that you check the log right after you disconnect the*Internet

My rule is a bit simpler. Using hub info driver.

It reboots if cloud connection is down..

Thanks, appreciate the response. Could you elaborate on what your script does. I'm not familiar with POST, but guess it must send request to reboot your Hubitat. I'm looking to reboot my gateway/router using Hubitat.

1 Like