Router restart & 'internet is back on' notification

Hi all, I am trying to set up a rule that restarts my router and once the internet is back, pings me a notification.

I am using 'WebPinger' community app that I've found here with the following switches:

"Working Internet" -- switch that is on when internet is on, off when it's off.
"Check Internet" -- switch that triggers WebPinger to look for internet.

Web Pinger setup:

My RM rule:

The rule sends me the initial notification, turns off the plug controlling router's power, waits 20s, then turns it back on.

However, it doesn't seem to be 'checking internet' so the 'working internet' switch remains off, even when internet is up & running again. When I flick the 'check internet' switch manually, the routine is completed, i.e. I get the notification 'the internet is now back on.'

So, it looks like my 'repeat' part of the rule is not quite right.... What am I doing wrong? Or is there a whole better way to achieve what I am trying to achieve...?

TIA!

Looking at your rule, you have no END-REP.
Without it the rule doesn't know when the repeatable actions are finished and to start the repeat sequence again.
Also, unless you put in a 'Stop Repeating Actions@#' it will carry on repeating indefinately.
So you need to workout within your rule, when you want the repeating actions to stop.

Here is an example for you to get ideas from.

1 Like

Agh, that's it! I was wondering about it and in fact that's the reason I put the repeat bit at the end. I couldn't figure out how to 'close it'.

I have 'Stop Repeating Actions' statement in there, so hopefully adding END-REP will fix things. I will test it again, once I am at no risk of being smacked by my wife for turning the internet off again...

Great stuff -- cheers @bobbles!

2 Likes

Unfortunately, that didn't fix it... I will give it another go tomorrow unless someone can spot any other issues with my rule in the meantime...

Good night Europe, good evening America. :slight_smile:

maybe try and stop repeating actions and an exit
followed by an end-if

This is how I do my rule, but after looking at yours I may try to figure out how to do it with waits instead as if I recall correctly, waits are more efficient than multiple if checks.


Note: The 2.5 minute repeat is how long it takes for my gateway to come online, and I turn it off after going online as I have a AT&T gateway that is terrible and as such I have a gateway bypass in place and have my Orbi system work as the main router.

Web Pinger Setup:

@bobbles, @cjkeenan, @kahn-hubitat - thanks a lot guys. So after trying out a few things I finally gave up on trying to use the 'wait' procedure. I either don't fully understand how it works (what can cancel it, etc.) or my syntax was simply incorrect. So I ended up implementing something that is more similar to what @cjkeenan has. Works well, so I am happy with it. Thanks again!

2 Likes

Very helpful post, however, have a problem with the "Repeat" procedure. The "Stop Repeating Actions" is ignored. With each repeat I continue to receive the message 'The internet is working' so the IF statement is TRUE as can be seen by the attached image. But doesn't actually stop or exit the repeat, continues to repeat until I pause the rule.

Thoughts?
image

You need to mark the Repeat as โ€œstopableโ€ so that the Stop Repeating Actions has an effect on it.

Welcome to the Hubitat community!

1 Like

Thanks!

The right mindset to remember is that Hubitat is event driven. Wait, Delay, and Repeat all schedule events at the end of their time. Stop Repeating Actions, etc., simply unschedule/cancel the previously-scheduled resumption events.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.