An app for Hubitat to combine two or more presence sensors to control an output Virtual Presence Sensor. The basic bindings use a boolean-OR to combine them. The advanced bindings can do more complicated combinations.
I want to make an output sensor that will be more reliable than either of the input sensors alone. It uses a boolean-OR to combine them. This means it will work great if:
- Your input sensors only give false negatives, but do not give false positives.
I can verify that presence from the Alexa app or from HomeKit satisfies this. I can also verify that my iPhone WiFi Presence Sensor (https://github.com/joelwetzel/Hubitat-iPhone-Presence-Sensor) satisfies this.
However, if your input sensors ever give false positives, then I do not recommend this app.
If you have presence sensors for two people, you can use this 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
- 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"
- 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 combined presence instance"
- Choose your input presence sensors
- Choose your Virtual Presence sensor as the output
- Click "Done"