[Deprecated] Web Pinger

New version:
2.1.9 - 12/29/20 - More Adjustments

Tested and working. :upside_down_face:

If you are still having issues, I'll need to see how you have it setup and a debug log.

Thanks

That seemed to have did it. On my first try it did not seem to work. It did the same thing. I was in hurry as I was about to leave. I figured when I got back I would put together a post with logs but when I just set it up it worked great.

So thanks for your help.

1 Like

Tried the app for the first time. It seems to work well, but it doesn't seem to work with IP based polling, I tried both Google DNS polling (8.8.8.8), and an internal network IP polling (192.168.x.x). In both cases the app reported a valid web address when it was set up, but no valid response in operation. Changing the address to google.com corrected the problem. It appears from previous posts I should be able to poll my internal network without a DNS address, just want to confirm the proper format. From looking at the code it appears it is set to automatically correct the website format (HTTP:// or www.).

I thought maybe it requires a valid web-page response (you can ping the address, but there is no web code). The internal network IP I tried should have provided that (the IP for my HE hub, used for testing purposes).

I also found that the auto-reset can provide unpredictable results, I have another reset routine and the combination of the two caused the switch to flip/flop. The app was set to turn off the switch, and the reset set to 30 seconds (to reset the previous state). When turned on by another external source (RM code set to reset the switch after 10 seconds) the app appeared to turn it off instead causing the switch to go through the routine again. Easy to fix, just make sure there is only a single control resetting the switch. I suspect that switch settings (auto on / auto off) could also affect this behavior.

That's why it's called WEB pinger. :wink: It's not designed to work with IP based addresses. If you can find a work around, great. But it's not what this is for.

Also, strange things will happen when you try to control a setting from multiple sources. :eyes:

Understand the strange things!

Thanks for the clarification. Interesting that at least one previous post appears to show it working with IP based polling (@BrunoVoeten Dec '20) . For my purpose a web address works fine. However, the ability to just ping a local network IP (even without a valid HTTP response) would make it even more useful.

Hi @bptworld- This looks like a very cool app. Since it's designed to ping a website and not an IP address, if there's a DNS issue, there is a chance for a false negative (ie: the app reporting that a website is down, when it really might not be down). Is there any way to add the ability to ping more than one website in order to insure against that? (of course if DNS is really an issue, there's a chance that both websites would be affected by a DNS issue; but the chances are pretty slim).

I'm sure Bryan will consider/answer your request but in the meantime you can have 2 child instances of the app.
Each pinging a different site.
You can then write a rule that will notify that there is an issue when both sites are down.
Just a thought.

4 Likes

I must be missing something. I've setup google.com as the URL to ping. I've set 5 mins between pings and 5 mins for the false alarm. I've also selected the "Turn Switch(es) OFF if URL is not available, ON if everything is good" and turned ON the Auto reset Switches and it's set to 60 seconds.

When I run the app, even though there's a good ping to google.com, the switch keeps cycling OFF and back ON... :man_shrugging:

Did you use the same device in both options? Screenshot please.

Thanks for the quick response -

I only selected 1 device in that option. Here are screenshots...

First thing that jumps out is if your 'Time between pings' is 5 minutes, than your 'False alarm safety' should be at least 10 minutes.

ok- thanks, I made that change. I'll test again.

1 Like

Also, with this type of setup, there should be no need to use the 'auto reset switches'. That was put in for a very specific case. I need to put something else in for this at some point.

Just to make sure we're on the same page. I'm trying to use this app to power cycle my modem (via the smart switch) if the connectivity has stopped. So unless the switch turns itself back on after X seconds, I will never get connectivity back.

This wasn't designed to do that but I think others have set it up for that purpose. Check back in this thread to see how they may have done it.

1 Like

ok- will do.

1 Like

I do it like this...
"Modem" is a label I use for a smart switch that the modem is plugged into.

@markbellkosel84- Thanks for your input. How do you have the "Time between pings" and "False alarm safety net" setup?

Just double-checking -- while it's called a "pinger", it actually makes an HTTP request to the URL given, right? Hence the "web" in the name I presume :slight_smile:.

Has anybody managed to do an actual real ping (ICMP ping) from an HE? I'm sure there are Java libraries that can but don't know if there's any way to use them in Hubitat. The systems I need to monitor don't expose any web functions, but they do respond to pings. I can tell with a dozen or so well-chosen targets if it's my router, or something in my ISP, or bits of the Internet backbone that are down, and I was hoping to funnel that information into HE.

Oh my; this might work, depending on what the underlying environment in HE is:

def proc = 'ping -c 3 localhost'.execute()
proc.waitFor()
println "Ping ${proc.exitValue() == 0 ? 'OK' : 'NOT OK'}"

According to the [Wiki] Hidden Features thread this endpoint should give you the functionality:

http://hubitat.local/hub/networkTest/ping/:ip

1 Like