I’ve been using an input_boolean
for a while now as a basic presence detector. My objective is to create an automation that will turn off lights when leaving if no-one else is present.
So far, I’ve had success in doing this with an arrival lighting automation, but for some reason I can’t get it working with this one.
It either does nothing, or the lights turn off regardless of the conditions set (ie. If one of us is home, it still kills all lighting).
alias: Departure Lighting
trigger:
- entity_id: input_boolean.k_present
from: 'on'
platform: state
to: 'off'
- entity_id: input_boolean.o_present
from: 'on'
platform: state
to: 'off'
condition:
condition: or
conditions:
- condition: state
entity_id: input_boolean.k_present
state: 'on'
- condition: state
entity_id: input_boolean.o_present
state: 'on'
action:
- data:
entity_id: group.all_lights
service: homeassistant.turn_off
- data:
entity_id: switch.power_off
service: homeassistant.turn_on
Any help is appreciated!
It’s probably a dumb mistake on my behalf…