[UPDATED] HTTP Presence Sensor

Devices that present a 'legacy' authentication prompt are not being detected correctly:

image

Happy to share information from Firefox's Web Developer feature but not sure what's needed to fix this.

My initial thought is that any endpoint with an auth prompt is not a good candidate for using this driver. That said, maybe it should be a good candidate? But I don't have any extra devices suitable for testing this. If you modify the code and can make it work, please send me a pull request and I'll incorporate it.

This Driver works great, but not on all devices.
I have been working on presence sensors so I can detect when power is down. The problem IĀ“m facing is that it detects some devices, but itĀ“s not detecting two Raspberry PiĀ“s on my network.
If I ping both of them, they are detected, but the driver does not detect them.
Any ideas?

I am trying to use this for an avr I have that seems to drop offline. When it drops offline a power cycle fixes it. But the driver is reporting not present when it is online. The avr has a webpage at its IP i am pointing the driver to on port 80. Anything I could be doing wrong, or is this the wrong application for the driver?

Thx!

Try web pinger. I think it might work for you, it's in HPM.

THANK YOU! That's exactly what I was looking for! Seems to be working as I was hoping

Just a note. I have an onkyo tx-nr575 and it doesnā€™t actually drop off line (in my case) but the telnet connection just gets screwed up for some reason.

I noticed it I hit ā€œinitializeā€ on the driver page it brings it back. I havenā€™t debugged further and frankly I donā€™t know if I am capable to do so. I tried automating the initialize to once a day and it wasnā€™t enough, so for now, every time my time of day mode changes, it hits the reinitiallize command. Itā€™s kept it connected for the last 3 weeks or so.

This may sound really stupid, but how do I figure or what end point to use?

I just started using this tool and am getting this error in the log

> error org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: user_driver_joelwetzel_HTTP_Presence_Sensor_1664.logsOff() is applicable for argument types: () values: []
> Possible solutions: log(java.lang.Object), notify() (method logsOff)

Were you using another driver with this device before? Error should affect the driver but can be annoying.

Can you please update this driver to include HTTP 403 forbidden as a good response?

Unfortunately, my work responsibilities are not allowing me any time to work on my Hubitat code right now. If you want to update this on your own hub, it would be on line 93 of this file: Hubitat-HTTP-Presence-Sensor/httpPresenceSensor.groovy at master Ā· joelwetzel/Hubitat-HTTP-Presence-Sensor Ā· GitHub

if(response.getStatus() == 200 || response.getStatus() == 403) {

1 Like

Anyone know how to add code so that HTTP to HTTPS redirect is detected as present?

1 Like

Should be a status 302 IIRC

if (response.getStatus() == 200 || response.getStatus() == 403 || response.getStatus() == 302) {

didn't return present.

Put a

else
   log.debug response.getStatus()

After your if and see what it is returning then.

I'm trying to use this driver for the same use case as you: to detect whether my homebridge server is up and running. I can't seem to get it to work, though. I've tried using the same sort of address as you but it never detects present.
192.168.1.91:51721/accessories
I have tried with and without 'accessories' but nothing changes. Any suggestions?

I also tried using the iphone wifi presence driver, but no luck there either except with the generic IP address without the port: 192.168.1.91
So I guess so far I can detect that my Mac Mini is online, but not detect specifically that the Homebridge server is online. Any help appreciated. Thanks!

Trying to use this for a Raspberry Pi hosting the Solar Assistant website for my Solar inverters and I cannot seem to get it to work.

I can hit the internal IP address http://192.168.0.118 with a browser with no issues, and I can telnet to port 80 on the Pi as well, no problems, however the HTTP presence sensor shows the device is offline.

At a loss. I've tested by changing the IP address to my other hubitat on the network and it shows ONLINE, so really not sure what's going on.

Any help would be appreciated. Thanks!

I've modified the driver to refresh every 5 minutes
runEvery5Minutes(refresh)
but the scheduled job keep refreshing every 1 minute.

Tried rebooting hub, no change. How do I reload the driver to make changes effective?
I really don't wont to redo all the rules using it.