[Deprecated] Web Pinger

I'm guessing this latest update probably just hides me from seeing those extra responses in my log lolol, but you gave an old man some piece of mind - Much appreciated!

The code is there for you to freely dissect. Nothing is hidden. :wink:

Oh gee Bryan, I'm sorry, i meant no disrespect. I was just joking by saying this old guy ( me)wont let it go until these responses go away. I upgraded and works perfectly now. I dont know how you keep up with all the great apps and the requests, but I know we ALL appreciate your hard work

1 Like

non taken! It's all good. I'm an over the hill guy too! Well, at the top of the hill, lol.

Always good to hear. Thanks

3 Likes

I am having some trouble with this.. maybe I am doing this wrong.. basically I want a switch to powercycle if "google.com" cant be reached.. I added the switch to the "Turn Switch(es) OFF if URL is not available, ON if everything is good." and then "auto reset switches" set to 5 seconds.. That way if URL is not found it should shut off the switch for 5 seconds then turn it back on.. am i doing something wrong?

I see this in the logs..

config


UPDATE: I guess i should have scrolled through the comments cause someone else thinks the same way i do.. if the url is not detected it will turn off the switch, but will it turn it back on without the auto reset checked?

G'day @bptworld,

Just installed the app, great work as always.

One question / request... I notice you have options around switches for when the internet connections goes down and comes back up. But the notifications only appear to be for when it goes down. Is there a way to configure a notification in the app when it comes back up? Not a major issue, I've setup a simple rule using the switch I setup, but just thought it would be nice to manage it all in the app.

Thanks,
Simon

Added to the list

2 Likes

New version on GitHub...

2.1.6 - 08/25/20 - Added notifications when website is available again, other enhancements

(don't have time to test this, actually have something to do this morning! lol)

3 Likes

Wow, thanks for such a speedy reply @bptworld. Much appreciated.

Hi Bryan. I wanted to chime in here to say that I think the issue still exists, and what we have now is just a workaround. I think I agree with @rjb.bob that the "Auto Reset Switches" isn't working the way we'd expect. I had a quick look at the code, and I can see that currently, the logic goes something like this when pinging and getting a good result:

  • Ping the website
  • If all good, run the turn on handler for switches group 1
  • The handler first checks each switch in group 1, and if OFF, switch it ON
  • It then moves to the reset switches option (and this is where I find the unexpected bahaviour)
  • After the specified delay time, it checks each switch in group 1, and if currently ON, switches it OFF

If I've followed it correctly, it will always end up switching the group 1 switches back OFF, which is not what we would expect. Is this the way you intended it to work, or was it an oversight when you coded this part? :slight_smile:

My assumption would be that the Reset Switches option should never actually turn any switches off, only back on.

Reset means to put back the way it was. So if the app turned the switch on and you selected the Reset option, after x seconds it will turn it back off.

If you don't want that to happen, simply don't use the Reset option.

Only if you select the Reset option. Don't use the Reset option and the light will stay On until you manually turn it off or the URL is available again.


New version on GitHub..

Cosmetic changes. Added more descriptions.

OK, but that's not exactly what's happening. ie. The switch in question was already on before Web Pinger checked the URL. After checking the URL and getting the "all good" signal, Web Pinger doesn't need to turn on the switch, because it's already on. But 30 seconds later, it then proceeds to switch it off. That's not really "resetting" the switch in my mind.

But it's no big deal. I guess that option wasn't for the purpose I thought it was. I'll just continue without it.

I think this app must be intended for a setup where the router and modem are two separate devices. In my case I have a single device, so obviously the "turn back on when the Internet becomes available" option will never be true since the router/modem is off and no Internet connection is possible. As with @jason-lane, I expected the reset option to turn the switch back some amount of time after it gets turned off, but that's apparently not what @bptworld intended.

I worked around it by using the app primarily for the ping function and turning off a virtual switch and using that to trigger a Rule that toggles the physical plug off and then on again.

You can connect a stand alone router to that all in one unit. I do it here with mine.

Is there a way to turn a switch on/off when the internet comes back on? I see the option to turn on a switch when the ping fails but I'd like to turn it back off when the ping succeeds again. I saw the option to auto reset switches but that says it will reset the switch after a set amount of time even if the ping is still failing.

I'd like to be able to see how long an internet outage was based on the switch events.

Thanks.

Go read the option again... it already does this. :wink:

2 Likes

Ok, I see that now thanks!

Clarification please. The false alarm safety net time, should it be more than 2 times the ping interval? In other words if I have the ping interval set for 15 minutes, then the safety net should be longer than 30 minutes?

Yes so you get more than one try at it. In worse case would need 31 minutes to ensure it catches the last one.

Thank you. That was what I thought. One more question. The switch I have to turn on it wouldn't come on then till after the safety net time? Assuming the internet was still down.