[RELEASE] Web Pinger

Hi @bptworld Bryan,

Your apps are great, however Web pinger doesn't quite do what I need.

Would it be possible to add a setting to the child app that inverts the switching and adds a delay before restoring the switch state. i.e If the website isn't available then turn off a switch, wait for x number of seconds then turn the switch back on?

Hope you don't mind be asking.

Regards

Tim

Thanks

Sure :grin:

New version on github...

V2.0.1 - 09/06/19 - Add new section to 'Turn Switch(es) OFF if URL is not available, ON if everything is good'. Also added an optional reset timer.

One condition... you have to do the testing!

Thank you, that was amazingly quick.

I have it running currently and all seems to be fine. I’ll monitor it over the next week.

Tim

1 Like

Hello Sir !

First of all, thank you or such an awesome app !
It works great to ping websites such as https://google.com/, but when I try to ping a LAN device connect over WiFi, like 192.168.X.XXX (which pings well from PC), the log says "Request failed to 192.168.X.XXX"...
Is there any way to ping LAN devices ? Maybe I am missing something..

PS : it's to be able to reboot my router independently from my internet box if the router's WiFi fails.

Best Regards,
Theodore

Sorry, not with this app

Ooooh damn :confused:
Do you think there could be any way to adapt it to make it work with LAN devices ?

Might want to try [RELEASE] iPhone WiFi Presence Sensor mentioned above. It works on local devices.

Woaw thank you for this, it should work !
When I first red this thread I was like damn it's all about iPhones their.. But it's all about devices :smiley:

1 Like

Is there a particular website that is consistently not reachable that i can use to test that web pinger is working correctly on my hub?

I'm guessing this should do it...

http://igcsuvsuvibdbobfihirbivruvjvj123.com

:smile:

4 Likes

Well that was easy...

1 Like

Ha ha ha :smile:

2 Likes

Hi Bryan
I'm testing Web Pinger here and it looks amazing except because I can't adjust the time between pings. I checked the code and it looks it pings every 5, 10, 15, 30 and 59min (lines 93 and 210 drove me to think that. I'm sorry I don't know groovy yet).

Is there a way to change those times? the condition from line code 210-214 makes me think is not trivial.

Those times are too long for me...I would like to check internet connection every 30sec at most.

Thanks you in advance for your time on this and for this great app

New version on GitHub...

V2.0.2 - 12/03/19 - Added more time options. Cosmetic changes

Thanks Bryan
I just installed it but I'm getting false positives from the app.
I don't know if the cause is my ISP gives me www access through a captive portal.

I made some test using MS-DOS console and while I am not logged I can't get a ping from the URL and when I get logged I got ping (as expected)... but I realize that when I'm not logged and I make ping I can see the IP address of each website so I guess my ISP is actually denying me acces to the gateway but not to its DNS.

I saw in the code these lines and I understand here the code actually check if the URL is valid (is not pinging actually), am I right? (just to learn my friend I'm not trying to critizy :wink:)
If this is the case then the app actually check for a valid URL but not necessarily pinging.

Any solution for my case? :thinking:

try {
        		httpGet(reqParams) { resp ->
					if(logEnable) log.debug "In Poll - Response was ${resp.status}"
            		if (resp.status == 200) {
                		if (state.downHost == "true") {
            				if(switches) turnOffHandler()
                            if(switches2) turnOnHandler()
                    		if(logEnable) log.debug "Successful response from ${state.website}"
                		} else {
							if(switches) turnOffHandler()
                            if(switches2) turnOnHandler()
                    		if(logEnable) log.debug "Successful response from ${state.website}"
                		}
            		} else {
            			if (state.downHost == "false") {
                			if (state.pollVerify == "false") {
        						runIn(60*threshold, pollVerify)
            					state.pollVerify = "true"
            				}
                			if(logEnable) log.debug "Request failed to ${state.website}, calling pollVerify with a ${threshold} minute threshold"
                		} else {
                			if(logEnable) log.debug "pollVerify already called"
                		}
            		}
        		}

You completely lost me with this... :upside_down_face:

But this is what the app does in a nutshell.

  • It looks at the URL entered in the app and makes sure it's formatted correctly for use in this app
  • In then makes a request to the website.
  • The website should return a 3 digit response
  • Based on that response, this app can turn a device on/off and/or send a push notification.

Some responses that the app could receive:

  • 200 OK
  • 301 Moved Permanently
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found
  • 500 Internal Server Error

There are more but you get the idea. This app only cares about whether a '200' is received or something else and then acts on it.

Hope that helps

LOL... thanks anyway, I know it can be confusing but it is the only way to get internet here :no_mouth: .

I guess when your app makes a request to the website my ISP do not block that request, it just dont let me surf the web while I'm not logged in the captive portal.

Do you know any other solution where the app or driver really ping the website or external ip?

I mean an app that evaluated the response time in ms of a ping request response?

1 Like

Not that I know of, sorry

Hello,

Just started using the the web pinger, and testing it.

My intended use: turn off a zigbee plug (router) when internet goes down and back on after 20 seconds.

I have set the URL to monitor to my network Printer so that I can turn it on and off manually and look at the response on the zigbee plug. Ping is set to 1 minute, safety net 0 minute and 20 s to reset plug.

So when I turn off the printer, the zigbee plug does turn off within a minute. But never turns back on.

If anybody can help me, I would greatly appreciate it. I actually bought this hub, and an Ikea zigbee plug just for this fonction.

Thank you very much
Geoffroy

Here is the log

This doesn't work on network devices. So it is only seeing that the device is off, but never comes back on.

You need something like the iphone Wifi Presence Sensor mentioned in post #17.