I’m using a Template Binary Sensor to determine if my home is occupied or not:
- platform: template
sensors:
home_occupied:
friendly_name: "Home Occupied"
delay_off:
minutes: 5
value_template: >-
{{ is_state('group.all_devices', 'home')
or is_state('binary_sensor.alecs_flat_away', 'off') # provided by Nest
or is_state('light.entryway_lightstrip', 'on') }}
I have automations that use this sensor e.g.
- id: arriving_home
alias: 'Arriving home'
trigger:
platform: state
entity_id: binary_sensor.home_occupied
from: 'off'
to: 'on'
action:
# etc.
The above automation triggers on every restart of Home Assistant which I’m trying to prevent.
I’v tried using delay_off
to prevent it switching to off
during restart, that doesn’t seem to work though. There doesn’t seem to be an initial_state
for Template Binary Sensors either.
I could add a condition in my automation to check my device is not at home, but that kind of defeats the point of my home_occupied
sensor.
Any ideas?