An app for Hubitat to combine two or more presence sensors to control an output Virtual Presence Sensor.
There are 3 types of combiners:
- Standard Combiners (Use this for combining wifi and gps-based sensors for a single person. It is optimized for that.)
- Boolean-OR Combiners (Example: If Person1 OR Person2 is home, then the virtual SomeoneIsHome sensor should be home.)
- Advanced Combiners (All logic options. It is a superset of what the Standard and Boolean-OR combiners can do, and you can re-create their functionality or do other boolean operations by configuring it correctly. But almost no one will need this.)
You have several geofencing sensors on your phone (Alexa, Homekit, Life360, etc) and you also use a sensor that detects when your phone is on WiFi. You can use the Standard Combiner for optimal logic of deciding whether you are home or away.
If you have presence sensors for two people, you can use a Boolean-OR Combiner to set a third Virtual Presence sensor for "Somebody is home", then use the departed event from it in Rule Machine to trigger events for when the last person has left the house.
I have documented the advanced bindings here: (https://community.hubitat.com/t/release-combined-presence/9186/35?u=jwetzel1492)
This app is entirely virtual and on the Hubitat hub, so it runs very fast. This means you can daisychain multiple combinations.
An example with 3 combiners:
- "My iPhone Alexa" + "My iPhone WiFi" --> "My combined, reliable presence"
- "My wife's iPhone Alexa" + "My wife's iPhone Wifi" --> "My wife's combined, reliable presence"
- "My combined presence" + "My wife's combined presence" --> "Somebody is home"
Now I can make RM rules based on individual people arriving. And if I want a rule for when the last person leaves the house, I just trigger on "Somebody is home" changing to "not present".
It's nice because it keeps the combination logic outside of Rule Machine.
Prerequisites:
- Input sensors already exist
- You've added a Virtual Presence sensor to be the output
The best way to install this code is by using Hubitat Package Manager.
However, if you must install manually:
- On your Hubitat hub, go to the "Apps Code" page
- Click "+ New App"
- Paste in the contents of combinedPresence.groovy and click "Save"
- Go back to the "Apps Code" page
- Click "+ New App"
- Paste in the contents of combinedPresenceInstance.groovy and click "Save"
- Click "+ New App"
- Paste in the contents of advancedCombinedPresenceInstance.groovy and click "Save"
- Click "+ New App"
- Paste in the contents of standardCombinedPresenceInstance.groovy and click "Save"
- Go to the "Apps" page
- Click "+ Add User App"
- Choose "Combined Presence"
- Click "Done"
- Click on "Combined Presence" in your apps list
- Click on "Add a new standard combiner"
- Choose your input presence sensors
- Choose your Virtual Presence sensor as the output
- Click "Done"