[UPDATED] HTTP Presence Sensor

I have tried with my Android it has found my phone as present but has not realised that the device is no longer on the wifi

I will give this a try when I get home. I believe between this, homebridge and locative I may have a “reliable” presence solution.

I assume one could setup a simple http endpoint on an Android phone so that this plugin can detect it ? https://play.google.com/store/apps/details?id=jp.ubi.common.http.server&hl=en

Unfortunately I don't have an Android phone to test with. It probably has some small difference in the http status codes and messages it returns, vs iPhone. This or my other device handler could definitely be adapted to it, but I don't have one to test with.

For you guys out there using an android does this work for you OK?
I have given my phone DHCP reservation on my router and put the address in the device using this Handler but it remains not present.
I have configured the ip address as
192.168.0.x
Tried various options but it just doesn't work.
Any thoughts?

Might want to try this version:

That's better. Works a treat. Thanks. :smile:
The worst bit about this is I thought I had downloaded both versions. I hadn't. Same one twice. :blush:

1 Like

I am running Locative right now. Is this something that would help keep this more accurate at detecting presence?

That’s the idea, yes

For combining this with another presence sensor for greater reliability, I have just uploaded this: https://community.hubitat.com/t/release-combined-presence/9186?u=jwetzel1492

1 Like

I am still learning to use your HTTP presence sensor. , How do I find the HTTP endpoint of a device?

It totally depends on what the device is. Sometimes there is documentation for it. If you don't know at all, a couple steps to try to figure out a good one:

  • the first thing is to find out what the IP Address of the device on your network is. The device may have an interface that tells you, or you may be able to find it in the admin pages of your router.
  • Then, try to talk to it with a web browser. For example, if the local IP is 192.168.1.100, then try to hit http://192.168.1.100 with a browser. You can also try https://192.168.1.100
  • Documentation for the device may give other clues. And devices may have multiple endpoints. What you want to find is something that returns some kind of data to a browser if the device is on, but if the device is off, the browser shows an error message.

Here's my example: I have a homebridge server. If it is running well, then the endpoint http://192.168.1.91:51829/accessories will return a bunch of data. But if it has stopped working, it won't return anything.

Thanks a lot. The only local IP I got response was Hubitat Hub so far, would pinging HE hub work? I just got a Raspberry Pi, I will set it up as a homebridge server and try then.

I am currently using this driver in my car to automatically open the garage. It detects the presence really fast but I noticed it then takes almost 4mins to become not present when the car is turned off. Is that configurable to say 1min or is this a HE limitation?

Use case here is that I would love it to close the garage door as well but I don't want to be 4mins down the road as someone could then access my garage without me knowing. Maybe the answer is an aggregated presence which I think someone has built but I haven't tried it.

1st thank you.

I purposely turned my server not present

, the driver worked perfectly but no notification know why?

My guess would be that the sensor was not offline long enough. You have it set for 1 minute and according to the log it was not present for less than a minute (missed it by a fraction of a second).

Was offline from 8:36 to 8:53

Try removing the "/login" from your endpoint URL and add the port number instead.

1 Like

Thx, that fixed it

IMPORTANT UPDATE FOR ANYONE USING THIS DRIVER:

I have posted a stability update here:

This is a critical update for anyone using this driver. It puts a timeout on the http requests the driver makes. (Timeout was not a part of the Hubitat http api at the time I initially wrote this driver.)

4 Likes