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.
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..
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.
@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.
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.
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.
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
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
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.