[RELEASE] Combined Presence

Here is mine as well, similar model which really helps debuging. In particular the combo of Homekit + Wifi has made my system SUPER accurate.

As you can see, I have two overrides.

  1. "Someone is Home" is a single device (presence & switch) which I represent twice here, which let's me override if for some reason things are wrong. I can force everyone is gone or someone is present
  2. Guest override - if a baby sitter/dog sitter, grandmother, friend, whatever is here alone, I don't want my 'away' automatons kicking in.
1 Like

I'm a fairly new user that moved over from SmartThings a couple of weeks ago. After struggling with the Geofencing/Presence detection in the Hubitat app, I found your excellent Combined Presence and switched to Homekit, Locative and your iPhone WiFi Presence on all the family's iPhones.

Things were working great, but over the last two nights, my iPhone has shown several false exits that last less then a minute. This exit/return cycle causes several routines to fire.

The weird thing is that it's happened with both Locative and Homekit. Two nights ago, Locative acted up and showed that I left and returned around 1 AM and then again at around 6AM. Today I woke up to find that Homekit showed a false exit a few minutes before midnight and then again this morning at around 7:30 AM. Checking the other inputs during this time show they they all remained present.

I'm using the standard combiner and on both days it set my primary presence to away and then present for each of the false exits. I checked my logs and it seems that my WiFi presence was present during that time.

I have a couple of questions:

  • Is there any method for setting a delay in Combined Presence, so I can ignore these location glitches? If not, would you consider adding one?

  • Should my combined presence output have been set to away if my WiFi Presence was present?

  • Is there something I could do with the Advance Combiner to eliminate these glitches?

Again, thanks so much for the tool! I played around with the geofence options on Locative yesterday I've restarted my phone after this morning, so hopefully that will take care of the false exits, but hope that I can use the logic to prevent it from impacting my routines if it happens again.

Ok, so it sounds like your phone gps glitched out. And Combined Presence takes geofence departures as gospel. For my case, I tuned my geofencing radiuses to eliminate false departures. However, I also live out in the middle of a field. I've heard geofencing can be more dicey in a city with tall buildings.

Not currently. This would be a sort of "debouncing". That's the common term in electronics, for example if you require a firm press on a button before it registers.

I think if I were to build a debouncer, I would not build it directly into Combined Presence. I'd make a debouncer app that takes one presence sensor as input, and outputs to another virtual presence sensor. That way, if you had one geofencing presence sensor that was less reliable, you could apply debouncing to just it. And use the debounced virtual sensor as input for Combined Presence.

Yes, that is by design. WiFi presence can take a while to change to "not present". And if your geofencing sensors are working well, we want to trigger departure as soon as one of them departs.

No, it doesn't have any option that will help with this.

Thanks for your excellent description of the issues and thoughts on what might be going on. I'm hoping that I was just having GPS hiccups and that the restart will fix it.

However, if I need to create a debouncer, could I feed the physical presence sensor(s) though WebCORE (or Rule machine) when they trigger, wait for a minute and confirm that it is still not present and set a virtual presence sensor to pass through to Combined Presence? Would that be a valid way to do it?

1 Like

Yes, that would do it. Your piston is basically the same thing as what I was imagining a debouncer app would do.

1 Like

I'd highly suggest before you go and do that though, you dig as deep as you can on what your GPS issue could be, as you want your GPS as reliable as possible even with a debouncer.

1 Like

My Hubitat app location has not been working well. I've been using OR logic to depart if ANY of multiple sensors depart, so when BOTH my wife's presence and my presence departs because HE thinks we depart, the house is going into away mode while we are still home. It's happened twice today already. Granted, I had turned off High Accuracy presence to preserve battery life, so perhaps that has something to do with it. How are people handling Hubitat location from the Hubitat app?

If you're still using HE location in Combined presence, are you using something other than OR logic to address HE location inaccuracy? If so, what?

Or are you not using HE location at all in Combined presence (too inaccurate even with High Accuracy presence on)?

Any input appreciated - need some quick adjustments before the wife tosses all my smart home stuff out the window!

I don't use the presence from Hubitat's app. It hasn't been reliable for me. For geofencing, I use HomeKit and Alexa.

Then I use the Standard Combiners to get a good presence for each person. And boolean OR combiners to get combinations of people such as "Everyone is home".

1 Like

So any chance this feature request might be re-instated? :slight_smile: Would be useful for me...

EDIT: if you'd prefer, I could update and send you a pull request...

EDIT2: I coded it up. Was easy. I will beta test on my own system and send you a pull request when I've confirmed it's working as intended.

Really like the overrides & would like to set up something similar.

Can you explain further please? Thank you in advance!

Yeah, so as you see in that screenshot I have a virtual presence switch I call "Guest is Home", and I've included that as an input sensor into the combined child. So flipping that switch forces my home to know that 'someone is home'.

Here is my child app structure

And here is what the "Someone is Home" combo looks like.

Thanks! I will attempt to set mine up!

1 Like

I forgot to mention that "Someone is Home" is also a virtual presence switch, and that has been useful to force presencing being home or gone if one of my GPS sensors is off, knowing that it will self-correct on the next trigger.

For example and my wife and i leave the house, but her phone GPS is stuck, I can force "Someone is Home" to be off, and I know it will "just keep working" when her GPS get's back on track or when we get home. So I can override and forget, where Guest is very different.

Having issues with one of my housemates. We are all using combined presence to handle alarm. How is this scenario possible? All the devices feeding the combined presence show Not Present but the combined presence shows Present. Using "Karla Phone" which is iphone and uses the Hubitat app geo. Virtual WifiPhone is using the virtual wifi community app tied to a static IP. Presence Switch Karla is using IFTT location and hubitat flipping a virtual presence switch. All those feed into a Combined Presence.

There's one way from the logic that this could happen: The wifi sensors can switch output to "Present", but they cannot switch it to "Not Present". So, if the following sequence happened:

  1. Karla starts driving away from the house.
  2. All the inputs (both GPS and Wifi) switch to "Not Present". At this point, the output would become "Not Present".
  3. The wifi gets a tiny signal and switches to "Present". The output switches back to "Present".
  4. The wifi signal is lost for good as she drives away. It becomes "Not Present", but the output stays as "Present".

If this had happened, you'll probably see "Present" -> "Not Present" -> "Present" fairly close together in the logs of the output sensor.

The solution is to ensure that your geofencing boundaries are larger than the effective range of your wifi.

1 Like

Excellent tip; I'll take a look at her geofence boundary on the Hubitat app. WiFi presence has a setting of 6 minutes before a Not Present flips her WiFi presence as such (the app checks once a minute so would take 6 consecutive inability to see the Wifi phone before it would change to Not Present). The phone turns Wifi off every couple minutes (thus the 6 minute buffer before interpreting no Wifi as a departure). Wifi is good for arrivals though and seems to be the primary driver of her Present statuses. That said, the scenario where she drives away and the WiFi flips to Not Present isn't likely as she'd be driving for 6 minutes in any direction of the house and easily be away from WiFi.

Well that didn't seem to do anything. So this morning I changed the Standard Combiner to be an Advanced Combiner and that seemed to behave as expected then. I'll leave that in place for a bit and see if it's reliable. FWIW.

Okay, got another bad day with the presence today. Thoughts on this series of events...
I'm only combining her Hubitat app on phone and the Wifi (static IP) presence phone. The IFTT location Virtual presence switch is unreliable so I've abandoned that for now to not muddy water.
BTW, before this, she updated her app to latest hubitat app release that came out yesterday. The hub is also at latest code.

You can see very bottom is when she leaves.
Then her Wifi phone gets one last ping in at 9:18am, then it should be 6 minutes of Wifi phone pings failing before that device will show as departed so set that aside. Farther up the logs it'll show the Wifi phone finally fail it's sixth time and flip to departed but the Combiner doesn't care about that.

You see the "Karla phone", which is the Hubitat app on her phone, show departed and the Presence status changes for that device. Not sure why in the same second it shows she's departed again but then the Combined Presence goes to ARRIVED and stays that way and never locks doors and sets alarm.

2021-05-14 09:19:02.356 am infoCombined Presence Karla has arrived

2021-05-14 09:19:02.348 am infoKarla Phone has departed

2021-05-14 09:19:02.339 am debugPRESENCE CHANGED for: Karla Phone

2021-05-14 09:19:02.297 am infoKarla Phone has departed

2021-05-14 09:18:42.155 am debugKarla Virtual Wifi Phone: httpGetCallback(The following result means that the hub was UNSUCCESSFUL in discovering the phone on the network: {"headers":null,"warningMessages":[],"status":408,"errorMessage":"Connect to [/] failed: connect timed out","errorData":null}, data)

2021-05-14 09:18:42.142 am debugKarla Virtual Wifi Phone: httpGetCallback({"headers":null,"warningMessages":[],"status":408,"errorMessage":"Connect to [/] failed: connect timed out","errorData":null}, data)

2021-05-14 09:18:32.079 am debugKarla Virtual Wifi Phone.refresh()

2021-05-14 09:17:41.346 am debugKarla Virtual Wifi Phone: httpGetCallback(The following 'connection refused' result means that the hub was SUCCESSFUL in discovering the phone on the network: {"headers":null,"warningMessages":[],"status":408,"errorMessage":"Connect to [/] failed: Connection refused (Connection refused)","errorData":null}, data)

2021-05-14 09:17:41.334 am debugKarla Virtual Wifi Phone: httpGetCallback({"headers":null,"warningMessages":[],"status":408,"errorMessage":"Connect to [/] failed: Connection refused (Connection refused)","errorData":null}, data)

2021-05-14 09:17:32.076 am debugKarla Virtual Wifi Phone.refresh()

2021-05-14 09:15:45.045 am infoFront Door OpenClose is closed

Oh wow. That is helpful. There's a really subtle bug in my code that could only be triggered if one of the sensors fired 2 departed events in close succession like that. That's never happened on my setup, but now that I see that you're getting a double event, it makes sense.

I'll work on it this weekend.


Wow, well, thank you. I certainly didn't mean to monopolize your weekend. Hope it's an easy one. I share the sentiment the others have and very much appreciate your work!