Presence by ping?

Just started looking at presence with Hubitat (I've only switched in the past couple months). All the options seems extremely convoluted.\

Is there a way to just add a virtual device with the IP I have assigned to the phone via DHCP reservation...and then periodically check if that IP is online?

Seems like such a simple solution, and maybe it's possible but I don't see how. Obviously it's not fool-proof cause I could turn off my Wifi, but 90% of the time it would be accurate.

Like this?

4 Likes

Awesome!

Seems like this should be built in!

2 Likes

That's what the army of community developers is for..

5 Likes

Note that with iOS, the device will frequently "sleep" the Wi-Fi connection when the device is not in use, so it won't necessarily respond to a ping every time, even if at home. If it does respond, you can be sure it's present; if it doesn't, you don't really know.

I'd recommend combining this with another presence solution, like the Hubitat mobile app, HomeKit presence (unofficial; needs HomeBridge), or a variety of other options (Life360, Locative if that is still a thing, etc.). Presence seems notoriously unreliable for lots of people, and I occasionally notice issues myself too. The Hubitat mobile app alone is usually OK if I remember to login and check the debug info every couple days to make sure. :slight_smile: (I started combining it with HomeKit for that reason.)

3 Likes

I use a combo of WiFi, Life360 and the HE app geopresence. It's 100% reliable this way. Many posts on the subject in the forum.

So do your rules now have to check all 3?

I have 2 virtual switches - one for me and one for the missus. These are 'Combined Presence Angus' or suchlike. Then I have an RM rule that sets these according to the trust I have in each method (eg. Wifi is completely reliable so it will always win on arrival, but if the WiFi goes down then you don't want to be set to not present unless one of the other methods also reports you are gone). I have another switch 'Everyone is out' that gets set or unset depending on the other two. Then I use these switches in other rules to define if we are home or not. It works really well.

Heres a graphical dashboard I use to show how it builds the decision from left to right (for me my wife and a guest fob)...

And here's an example rule for a person's combined presence...

And the final rule that build the decision if we are all out or not. Hope it makes sense :grin:

It takes a bit of setting up but it's worth it. It's now bullet proof.

I do something similar to the above--I have rules that combine my multiple mechanisms into one presence device, and that is the device I use in any apps/rules that use presence. However, those can be a bit of work to set up, and you don't necessarily need a rule for it; there are a few community apps that have been set up to combine presence in various ways. Ones that come to mind are Presence Governor and Combined Presence, and Presence Plus, and I'm sure there are more I haven't seen.

No matter how you do it, the idea is to make it easier on yourself to only need one "proxy" presence device (which you can manipulate with whatever criteria you want) instead of needing to check a bunch. Of course, "easiest" would be a single presence solution that just worked 100% of the time, but if anyone knows what that is, I'd love to hear. :slight_smile:

2 Likes

Well put :joy:. I have been looking for the ideal presence solution since I started using a smartthings hub in 2015. I’m still looking...

This app is by the same dev that made the driver linked to above. I think it works very well for its intended purpose, especially if you’d rather not create your own logic in rule machine or write your own groovy app.

2 Likes