I automate several things such as arming my alarm system and starting the Roomba when HA detects the house is empty. I have been doing this based on whether my phone or my wife’s phone is connected to wifi and some Ecobee occupancy sensors. I combine these into a People Home binary sensor. However, this doesn’t work well when guests are there, such as babysitters. I’ve gotten around it by using a Guest Mode input boolean to disable some automations, but I sometimes forget to enable it and then my guests are very confused when things start happening.
I decided to create another way of detecting presence in my house by combining all devices people can interact with into a Home Activity sensor. Here’s an example of my Lights Activity sensor:
- trigger:
- platform: state
entity_id:
- light.front_foyer
- light.living_room
- light.spot
- light.kitchen
- light.kitchen_island
- light.dining_room
- light.mud_room
- light.master_bedroom
- light.master_bedroom_accent
- light.master_bathroom
- light.stairs
- light.basement_game_area
- light.basement_sitting_area
- light.basement_storage
binary_sensor:
- name: Light Activity
state: '{{ true }}'
auto_off: '00:20:00'
This sensor is triggered when any of the devices change state (on or off), the sensor state turns to ‘on’, and starts the 20 minute auto_off timer. Once it is on, any more activity from these devices simply restarts the timer. I also have activity sensors for doors/windows opening/closing, door locks locking/unlocking, baby gate opening/closing, etc. etc. Each one feeds into the People Home sensor. The more devices in your house the better this will work.
Just wanted to share and if you have a better method or a way to simplify this any further then please share!