[RELEASE] Combined Presence

Hi @neonturbo, does your 3rd rule work well? Shouldnt it be 'All of these not present' instead of 'Any of these depart'?

It has been like a year, I can't remember why I chose that. I haven't looked at it basically since I set it up. Maybe I need to revisit! Too many cocktails when I was setting it up? LOL

:woozy_face: :tropical_drink:

I think you are correct, it probably should be all rather than either. jwetzel1492's post (post 35?) right after mine, shows a graphic of the logic much better than I explained it.

I will dig into my rule a bit and see if I can remember why I did it that way...

I am using HE on a Samsung Galaxy S10e and now trying to turn off the Enable GeoFence switch.
But I cant seem to...am I missing something?

One thing I've noticed after using this for a while: While the advanced setup is what I use to solve all my presence combining, the way I configure the advanced combiners is always identical. I'm tempted to make a "Best Practices" combiner that has the same underlying logic as the advanced one, but has a simplified UI that guides the user into using it the way I think works best. I need some free time though. :slight_smile:

3 Likes

That would be great.. looking forward to it!

IMPORTANT UPDATE: This package can now be installed from Hubitat Package Manager. This is the best way to make sure you keep up-to-date with bug fixes and new features.

4 Likes

I only just started using combined presence and your iPhone WiFi Presence Sensor driver. I combined phone location and wifi presence into a virtual presence sensor; one for me and one for my wife.

I noticed that in the log, if just one of the two combined sensors changed to departed, the log will say it arrived. Then when they both change to departed, the log says departed. But the first arrival only shows in the log, it doesn't show in the device events.

image

The arrived here is when I first setup the virtual device.

Just started using it though, so I'm not sure if that will actually impact anything. I imagine it won't if there's no event happening for the false arrival, but it was a little confusing when I was looking through the log.

1 Like

Hi @waterboysh, yes it doesn't show in the events because the state didn't actually change. Are you using the normal Combined Presence or the Advanced Combined Presence?

Normal combined presence. Here's some more info. This is the log for the combined presence sensor. The first arrival is when her phone connected to the wifi the second is from the hubitat geofence.

image

Here are the events for the combined presence sensor.

I'm not really familiar with the coding environment in HE, but it looks like the code responsible for writing in the log is this

def oldPresent = outputSensor.currentValue("presence")
	
	if (present) {
		outputSensor.arrived()
		
		if (oldPresent != "present") {
			log "${outputSensor.displayName}.arrived()"
			
			if (notifyAboutStateChanges) {
				sendNotification("Arrived: ${outputSensor.displayName}")
			}
		}
	}

I don't really know what calling the arrived function on the sensor does. I assume this function is built into HE for type presence sensor. I don't see any issues with the code, so I am also assuming this is where the extra line in the log is coming from, because oldPresent should be true and the rest of this code skipped. Any reason to not change it to

if (present && !oldPresent)

and then get rid of the second if statement?

Ok, the basic one is good if you want to combine two truly reliable sensors. I ONLY use it to do booleans of entire people. So for example, I'll do a basic combiner on both my sensor and my wife's sensor to answer the question "is anyone at all at home?". For presence of the people themselves, I recommend using the advanced version, and here's how it should be set up:

Every sensor goes into "ANY of these arrive". Everything EXCEPT wifi-based sensors goes into "ANY of these depart". (Because wifi disconnecting is not indicative of actually leaving the house.)

My dashboard shows how I use two advanced and one basic combiner:

2 Likes

IMPORTANT: I have just release V2.0 of Combined Presence. I've updated the description at the top of this thread. The best way to get the update is to install via Hubitat Package Manager, but you can also install directly from GitHub.

It should be fully backwards compatible and not break any existing combiner instances.

The most important update is the new "Standard Combiner". This instance has the optimal logic for detecting presence of a person using multiple geofencing and wifi-based presence sensors. You don't have to think about the boolean operations involved. It just does it the best way based on the performance characteristics of the different sensor types.

1 Like

So a quick question on the new Standard Combiner options. I previously used the Advanced section in the older version. Now with the Standard Combiner, there are two sections, Phone GPS, and Wifi/FOB.

I want to use 3 devices, Phone GPS, Phone Wifi (using your other app), and Smartthings Arrival Sensor (fob).

For the Wifi/Fob option, it states "Phone Wifi-based sensors are optional. They can help detect arrival faster. They are not used for detecting departures, because some smartphones periodically put their Wifi to sleep."

So does it also treat fobs that way, or is this smart enough to look at each separately? In other words I want fobs to be used for both arrival AND departure.

So depending upon the previous answer, if I want to use fobs for both arrival and departure, would it be better to use the Advanced section, or select it in the GPS section instead?

Thanks!

Ok, quick questions for you, since I don't have a fob to test with.

  • Does the fob ever give a false arrival when you're still away? (Just the fob itself. Ignore any combined presence or other app)
  • Does the fob ever give a false departure when you're still at home?
  • Does it ever oscillate between home and away?
1 Like

Not that I have seen. They are nearly bulletproof, as long as the batteries are kept up.

Same as before, they seem to report both arrival and depart very accurately.

Nope.

I am not sure what other people's experience is with these, but they seem like the most reliable device for presence between Wifi, GPS, and/or the Hubitat app. They are tough on batteries, and you have to watch that, but even when the batteries die they don't change states. They just seem to "stick" to the last known state.

Ok, in that case, put the fob into the gps section. I'll update the text to indicate it should go there.

1 Like

Or just a edit the description a bit to reflect that if you want the fob behavior the same as Wifi, put it there, and if you want it more like the GPS then you can use that option instead.

That way it covers both scenarios, and if someone has a fob that is less reliable then the can use the Wifi logic.

@jwetzel1492, in the next version, would it be possible to add a feature (like for debug logging) that would allow the user to enable or disable info logging?

Thanks!

I have a problem. See below:

2

Phone GPS based is called "Paulina".
Wifi presence sensor is called "Paulina - iPhone Wifi Sensor".
Output sensor is called "Paulina w domu 2".

And output sensor is ON even if 2 input sensors are OFF. I attached debug log also. It says that all inputs are NOT present.

What's wrong?

Couple questions!

  • what is “Paulina w domu “?
  • which version of combined presence are you using?
  • which type of combiner?
  • can you send a screenshot of your combiner?

I have somewhat of a dumb question...
I'm contemplating jumping from Home Assistant to Hubitat and I'm actually quite excited to do so.

I have a job, however, that makes me switch devices quite often. Usually I jump between three phones on a regular basis... In Home Assistant there's a custom component that allowed me to do this without ever noticng it, as the system interpret one of my phone's leaving as if I left automatically.

I think your app could do the same, just wanted to double check if that is the case?