[Deprecated] Web Pinger

If you use the Auto reset option, then the switch will reset to whatever state is was before the app changed it. So if the switch was on and the url was not found, the app would turn the switch off, The Auto reset switch would then turn it back on in however many seconds you have it set to. Make sense?

Also, the pause option was removed from all of my apps since it was no longer needed. Any app can be disabled within the HE apps list.

Thanks

1 Like

This is great - thank you!

@bptworld did this ever make it to your github? I would love to have these option not over written when I update...

THX!

Also, the pause option was removed from all of my apps since it was no longer needed. Any app can be disabled within the HE apps list.

I'm sure I'm losing my sight BUT I'll be darn if I can find on the APP list in Hubitat where I can pause any app. I've looked up and down lolo

Did you check? It's been false. :wink:

Hit the 'X' in the upper right hand corner, then use the 'Disable' box.

2 Likes

Good Heavens I know I'm old and my eyes aren't the greatest but gee you think the powers to be could at least darken that "X" on the top right lolo. My screen shows it barely visible just grayed out, but when I finally found it and clicked on it the disable options appeared.

Your ALWAYS there for us. Wont bother ya again. Stay well Tony

4 Likes

lol, I agree. It can be hard to see.

Have a great day!

Could I please get some tip on how to get the pinger working? I originally set it up for www.google.com and when I disconnect the cable modem nothing happens. I switched to a full URL using https://www.ibm.com with no change and finally I put a bogus URL - the pinger still shows "200 OK in the logs" even though internet is down and that URL does not exist and the office plug says ON instead of going OFF and back ON. You can see in the log that HE can't get to Alexa API (cable modem is powered off). It must be something stupid, but I can't find it, any ideas please?

Give the new version a try...

2.0.7 - 05/25/20 - Little adjustments here and there

I also use google.com with no issues. I may be in left field but check the two options "Time between Ping" and "False alarm safety net".Possibly you didn't give the app enough time to read the router disconnect .

Thanks but I don't think that's the problem as I tried time between pings set as 10 minutes and false alarm set to 2 minutes while the modem was off for 45 minutes.

Looking at the logs I posted above it seems strange to me that no matter what I put in the website field, including the https://www.sdfsdfsdfsdfsdf.com (which is non existent) the log always shows "200 OK"

Installed the new 2.0.7 version (delete the previous user app first) - still the same result


Setup seem to be fine, except web pinger says "200 OK" when the website obviously does not exist

This really is a long shot . You said you disconnected your modem . if you have a seperate Router could you try unplugging that? I know unplugging the modem should do the same but give it a try. I've had no issues what so ever and again i also use google.com

Not sure why your setup isn't working. Here's a screenshot of mine working just fine.

You can see google.com checking in just fine and then I change it to kajfsdlkfjasdklf.com and it fails, 4 min later it sends me a text that the internet is down.

This is interesting - when I replaced the value with the same of yours - it works (except I never get the notification, not important at this point)

However when I change back to google.com and disconnect it's back to 200 OK even though there is no internet connection. The only difference I can find in my terminal is that for some reason my router will point to a non routable IP for google.com but will say "host unknown" for kajfsdlkfjasdklf.com But the HTTP request never gets there it timeouts on my router

EDIT: Found the culprit!!

For anyone else, check your router settings to make sure "redirect on WAN is DISABLED" This was added feature to my Asus a while back when I auto updated the router and until now I never noticed it. After turning it OFF I tested and everything works as expexcted

4 Likes

@bptworld
I was checking your code and there is a few things that I am not sure understand.

A few times you have a code like
if(switches) turnOffHandler()
if(switches2) turnOnHandler()
if(logEnable) log.debug "Successful response (${resp.status}) from ${state.website}"

but inside for example turnOnHandler

image

You turn ON de switches and switches2, Why?

Another comment, every time you detect that the device your are "pinging" is available, your are forcing to turn ON, could be more optimal to check the status of the switch and only turn ON if is OFF?

I have now 7 devices that I am checking in a second HUB, and this is generating an update in the second HUB and retransmitting the info to the first HUB,

Thanks!

Sorry, but I'm not going to explain how the app works line by line. :wink:

If you have a way to make it better, I'm open to suggestions. And if something doesn't work, please post a log and let me know what's happening.

Thanks

Don't know how much more 'optimal' doing two things will be but that's an easy enough change.


New version on GitHub...

Child:
2.0.8 - 06/05/20 - Minor adjustments

Thank you @bptworld for the version 2.0.8

Sorry my English is not so good, but let me explain the code problem, this is one example, I am checking my LUTRON Hub (I did not install version 2.0.8)

As you can see I create 2 switches one for ON and one for OFF and auto reset is OFF

My Lutron is ONLINE and as expected I have

One ON and the other one OFF

I disconnect my Lutron and both switches are ON

I imagine because in the turnOnHandler() function you are switching both switches and switches2

As you can see in my log

image
the switches are Turning ON an OFF, same thing with the other switch

image

I hope this clarifies what was my question.

No problem at all. There was a lot of changes to the on/off functions so give version 2.0.8 a try and let me know how it goes.

Thanks

So I am trying to use this to detect if my internet goes down and restart my gateway in an attempt to reconnect, but no matter what URL I give it, google.com or 1.1.1.1 or 8.8.8.8, it always seems to fail, and even when it does fail, it does not seem to correctly detect the state of my virtual switch, and set the state of my virtual switch.

I have a theory for each of the problems listed above:

  1. I have hub security enabled, would that effect the ability of this app to ping the websites? For transparency, I have AT&T U-VERSE Fiber with a Netgear Orbi Router with a Pi Hole DNS sink using Cloudflare DNS.
  2. The offending code that results in the inability to turn my switch on and off seems to be the function call of .deviceValue, which when looking at the Device Object documentation, seems it should be .getDataValue, and the same would go for the .on and .off calls, which should be a .updateDataValue call. Please correct me if I am wrong, but I just wanted to let you know what I found.

Any help you can provide would be appreciated.

I wonder if this is related to the error I've started seeing in my logs:

2020-06-13 17:15:00.223 errorjava.lang.IllegalArgumentException: Command 'deviceValue' is not supported by device. on line 314 (poll)

This error appears every 5 minutes in my logs, which is the polling interval that I've set up. I'm not sure when this started happening, but I feel like it started with one of the recent (1-2 weeks) platform updates.