[RELEASE] Presence Plus - Creates a combined presence device

Thanks... if it's an oddball one-off request don't spend the time. I'm playing with something with RM right now...

Here's my use case.

The family (of 1 other) refuses to embrace any sort of geofencing app becuase "I'm tracking them." So I'm using a combination of Hubitat Ping and the iPhone Wifi Presence sensors to detect presence rather than tracking. And of course it's completely agentless. But pinging an iPhone yields inconsistent results, so I'm combining data from the two apps into one. However, I wan to make sure either virtual sensor thinks they're gone for a good 5 min before I declare the house empty and arm the alarm system (which of course they NEVER forget to arm) and lock all the doors (which of course they NEVER forget to lock). You see the issue.

Quick, likely stupid question, what IP address would I use, the hubs?

how does this work?

This is for mainly for your cell phone ip address

1 Like

I use PP - and do pings as well. The IP address of the device your monitoring is what I used.
So - lets say your using a phone. When the phone connects to your home local LAN via Wifi, it is given an IP from the DHCP server. That IP can now be pinged, and if the response is positive then that device has arrived. when the device is turned off, or outside the WIFI range, it drops it's wifi to your LAN and the IP address stops responding to the pings. the multiple pings is a way to make sure it wasn't just a short term issue.
In other threads about IP addresses and how the are provided - Many folks will explain how to make an IP address to a device be the same one each time your phone comes and goes. DHCP gives out random IP addresses - but there are a lot of nuances to how it works. By setting the IP address of a device to a Static address (something you do at the DHCP server side) then that IP address never changes and your IP address checking routine works without hitches.
Recently, (in the last year or so) as a security function mobile device OS's have begun implementing a randomization of the device as it identifies itself to your home network. This makes getting the same IP address each time very difficult. There is an option in your mobile device to disable this - setting your device network settings Private off/on.
DHCP servers haven't yet implemented a way to communicate and ID successfully these devices so you get a different IP address each time you re-connect. Very frustrating!
When using your OWN DNS server - you can do a form of device lookup - but thats a bit complex to explain here.

1 Like

Feature Request for PP - Recently trying to get another persons' HE to work right. She uses an iPhone, and the presence is absolutely broken. I'm trying Wifi presence, Owntracks and HE app for iPhone. All work poorly at this point. Error logs show random connects/disconnects throughout the night on the wifi, HE app says 'home' when she's not, Owntracks won't update...

Anyways. on the PP - when I'm trying to adjust and use PP to get a good combination, changes to device status are not reflected immediately caught by PP. I wonder if a 'Refresh' button on the PP-Virtual Device could re-sample the devices being monitored and change the status to reflect what PP sees at the time of my adjustments?
I am concerned you'll ask for logs but in this case I'm hoping a picture says 1000 words:

Not sure why it's doing that. Nothing in the code to make it 'wait'. It should be updating in real time. As for the picture, be sure the devices themselves are updating as sometimes the dashboard doesn't reflect the actual value of the device. How would you do that, you might say.... debug logs. Only way to truly know what's going on.

There is already a failsafe option in the app.

slaps forehead for the 2nd time in a week - I always forget your 'virtual switches' inside the app -
Regarding the updating in real time - in this case - I had added/changed what device was monitored as the present trigger. The trigger I was using was green (present) and the one I changed it too was red. Point is it didn't auto update - but close my ticket! I'll go create a virtual switch...
thanks

1 Like

hmmm. Failsafe wasn't what I thought itwas - you actually have a 'failsafe' I see now, studying harder. I added a virtual on/off switch but that was for the app, not a refresh I think. Regardless, toggling the app on and off did cause a refresh so I'm 'red'. (in a correct state) now.
Danka

@bptworld I use Presence Plus a lot and I love it. Thanks for writing and maintaining it!

There's a feature I would find really useful and I'm wondering if others would too... and that's a timeout. For instance, if ALL presence sensors report NOT PRESENT for at least 5 minutes, change the virtual sensor to NOT PRESENT. Not sure how hard this would be to implement but if you are doing some other mods at some point in the future it would be a handy addition.

Thanks, so you want a delay in setting in setting the 'Not Present'? I'll add it to the to-do list. :wink:

Well... an optional delay on both present and not present would be nice! Here's my use case but I am sure there are others...

I use an "agentless" approach to presence tracking via iPhone. Ihave four separate methods of detecting whether the iPhone is present or not. If all fail to detect presence for at least 4 min, I decide the person is not present. If all four register not present but then within that 4 min window one or more register present, I decide the person is present again.

Screen Shot 2022-01-13 at 1.23.25 PM

And yes I know Life360 or Geofency would probably be easier but S/PAF prevents my use of such apps.

2 Likes

Isn't that what this option does? I've been using it for a while now.

Hmmm is it? I assumed because they were in the failsafe section they applied to the failsafe ping... but not all rules.

Hi @bptworld -
Having a problem with a Presence Plus instance that uses only motion sensors as input. I have the app set to OR for arriving and "AND" for departing. However, when a motion sensor that is included in the Arriving group goes active, it doesn't seem to set the output device to Present. Delay field is blank.

Here's the log, let me know if you need to see settings as well. The output sensor was created by the app.

Here's an update. I did some debugging.
First, I created a disable switch (it was empty before). I tried it with that switch on and off (it isn't clear from the settings whether the switch enables when on or disables when on , as it's called an Enable/Disable switch. It would be good to clarify. From the logs, it appears that it's actually a disable switch - so I captured the log when the switch is off.

I also reduced the number of sensors being combined to make it easier to debug if the app was using an AND when it should be using an OR - but that doesn't appear to be the issue either.

I also enabled logging for the output device created by the app. The result is that the output device had no activity at all in the log. So it appears to me that the app is not talking to the device it created. (Note - I originally tried using a pre-existing device and then later switched to an app-created device when that didn't work. ).

Here's the latest log:

@bptworld not sure what's going on here with this instance. Any thoughts?

Neither do I, without a debug log and show me how you have it setup

@bptworld any thoughts on this?

You're going to have to show me more info. Screenshots of how you have it setup would help. Be sure you're on the latest version.

Hi @bptworld, I've just started using PP and so far so good (thanks for the app!). I did have a question though, I have 2 presence sensors and ping setup in the app. The departure is 'AND' and the arrival is 'OR'. Upon arrival the app fired twice almost immediately and created an arrival event twice (my rule triggered by an arrival fired twice). Is that expected or was this incident an anomaly since both presence sensors seemed to have been updated at the same time? Thanks!


EDIT: I noticed I accidentally clipped the 2nd ping handler completion during my screenshot. I don't think it matters, just wanted to be correct.