[RELEASE] Combined Presence

Ok, you guys are correct that I made a copy-paste error. I have reverted the changes to the combinedPresence.groovy file.

1 Like

Awesome man.
Thx

I thought I would document what I did for others who like me may be noobs.

  1. I installed the "iPhone WiFi Presence Sensor" app listed above. You need to install that first and be sure it works. There are details how to install it and make a virtual device for each phone in a separate thread.

  2. Have the Hubitat App geolocation set up and running. Be sure there is a "mobile app virtual device" created for all your phones.

  3. Create multiple new virtual device > virtual presence, in the devices tab. I named one "Spock Home", a second "Sulu Home" and a third "S&S Both Home"

I then made 3 advanced combined presence rules.

  • Username "Spock" rule is: If either Wifi-Spock virtual presence or Geolocate-Spock virtual presence arrive, mark present. Also, if both depart, mark not present. Send that to virtual presence output device "Spock Home".

  • Second rule, similar to above for username "Sulu".

  • Third rule: Make arrive if "Spock Home" and "Sulu Home" all present. Also make depart if either Spock" or "Sulu" depart. I used the virtual presence for Spock" and "Sulu" as inputs, and the combined "S&S Both" virtual presence as an output.

I made a multiple dashboard tiles using the separate users, and the combined users presence. They show if one, both, or all home or away.

This has been working fantastic. Thanks to jwetzel1492 for the terrific apps.

6 Likes

There's a huge update on Github that I wanted to document for everyone. Here are the major updates:

Notifications

  • There are two types of notifications you can turn on:
    • Send notification when the output sensor changes state.
    • Send notification if the inputs are inconsistent for a long period. (Useful for debugging or knowing if a presence sensor has gotten "stuck".)
  • Notifications can be sent out two ways:
    • To a notification device (such as the new Hubitat app w/ push notifications)
    • To a phone number via SMS

Advanced Bindings

Since the beginning, Combined Presence has used a simple Boolean-OR to combine the inputs into an output. If ANY of the inputs were present, the output would be present. If ALL of the inputs were not present, then the output would be not present.

However, depending on the reliability and false-positives/false-negatives of your input sensors, there were situations where the Boolean-OR did not produce great results.

Here's the example of my house. I use 3 sensors:

  1. A virtual presence sensor driven by HomeKit geofencing
  2. A virtual presence sensor driven by Alexa geofencing, for detecting me a few hundred feet from the house
  3. A wifi-based presence sensor, to ensure that I am detected at close range

The boolean-OR would be great if these input sensors were all perfect. But they're not.

The wifi sensor sometimes gives false negatives, due to the phone going to sleep. That's actually not a problem for a boolean-OR, as long as the geofencing sensors are accurate.

But I discovered that occasionally either the Alexa sensor or the HomeKit sensor would get "stuck". They wouldn't detect changes for a day or two. I assume it has something to do with my phone preserving battery, but I don't really know. What I do know is that if one geofencing sensor is stuck and the other isn't, there should be a way to deal with that.

That's why I created new Advanced Bindings for Combined Presence. It's a new, more powerful combiner.

Fair warning: You don't need to be able to "write" boolean logic to use the Advanced Binding, but it will help if you can "read" boolean ideas and understand their implications.

Here's a screenshot of my combiner, configured to work with the behavior of my 3 sensors:

Basically, if it thinks I'm away, and then any of the 3 inputs arrive, it decides that I have arrived.
If it thinks I'm present, and then either of the geofencing sensors departs, it decides that I have departed. So it will be ok if one of the geofencing sensors gets "stuck". It also won't falsely depart just because the wifi went to sleep. And it won't get stuck on "present" if the wifi sensor takes a while to detect that I've left.

This is just one possible configuration. If your sensors have a different combination of behaviors, you may want to configure it differently. (You can even configure it to behave exactly like the simple binding, though I don't know why you would. But the simple binding is basically a subset of the advanced binding.)

Last, I'd like to show a dashboard I created to help understand how my sensors and combiners are behaving:

You can see that me and my wife each have 3 sensors. Those are combined by Advanced Combined Presence to get an overall presence value for me, and an overall presence value for her. Then, it uses a simple boolean-OR on those to decide if anyone is home at all. The dashboard shows the cascading behavior of the combiners.

I hope you find this valuable as I have.

12 Likes

Awesome explanation, man.
Thx.
When I'm brave enough to update my install I'll tackle it. LOL

1 Like

I love the ideas in this thread! I leveraged HomeKit geo, WiFi Presence, and the iOS version of the Hubitat app for geo. Then with the Combined Presence app, I have most of the presence devices I need for my wife and I, as well as our kids. Love it!

6 Likes

@spotty, This is awesome, and I LOVE your dashboard!

Thanks so much for this @jwetzel1492! Looking forward to trying this out as soon as I get home tonight.
Quick question for the community, is anyone getting good results with this using @jwetzel1492's iPhone wifi presence and HT's built in GPS geofencing capabilities?

That's what I use. Works well. For arrival, I use "ANY". For departure, I use "ALL".

2 Likes

I’m doing the same as @aaiyar and it’s working well for my wife and I.

2 Likes

Good deal! I'll give it a try tonight!

I'm still having some unreliability with the HE app for iPhone. It's maybe 90% accurate. So I'm using Combined Presence with a combination of:

  • iPhone Wifi
  • Alexa geofencing
  • Homekit geofencing
  • HE app geofencing
1 Like

On Android, the HE app seems to work well for me. However, geofencing using the Alexa Android app is often off.

I use a combination of your (@jwetzel1492) iPhone WiFi, HE app geofencing, and Automatic dongles from cars (via Automatic's IFTTT integration and a virtual switch).

So in this image here, chris home, everyone home and so on are virtual presence sensors or are they switches ? IE if wifi + HK + HE = True set Chris home to On ?

1 Like

According to @spotty’s post above, and the icons on that dashboard, those are presence sensors.

1 Like

They are Virtual Presence Sensors that are being controlled by Combined Presence combining the stuff to the left of them.

1 Like

Hi Joel,

I just discovered your Combined Presence and it looks perfect.

I'm building a pair of virtual presence device for myself and my wife. I have 3 underlying signals (Hubitat app, iPhone, and iPad) while my while has only one (iPhone). I also built out a dashboard to visualize and debug my config. For simplicity, I'm using the Advanced Combined Presence Instance for both virtual presence devices.

I notice that my wife's aggregated presence from the one presence doesn't signal correctly. It is stuck as present even though the underlying presence is not there. I've tried the Standard Binding with a similar result.

As a shot in the dark, have you tested these combiners with the degenerate case of one underlying presence signal?

George

thanks so much @jwetzel1492 for this app.
I used to get soo many false / duplicate logins - but now with the daisychain of presence my logins are smooth and accurate. Really really appreciate your efforts.

1 Like

Hi George,
You know, I actually haven't. I probably won't be able to test it this week (busy week at work), but I'll put it on my TODO list.

Thanks!

1 Like

Hi, Nice work and just what I am looking for as I transition from Smartthings presence embedded functionality. However I am struggling with how to get "My iPhone Alexa" triggers. I've tried to create virtual Alexa switches and geoposition routines linked with Hubitat to trigger based on location BUT Alexa cannot handle multiple people locations on the same account. How do I get separate iPhone Alexa presence for my wife and I? Thanks in advance.

Download the Hubitat app