I'm sure this has been done a million times, but I'm trying to get my bathroom lights to come on when it senses motion, then turn off after 60 seconds, however, if the door is closed, then the lights just stay on until the door is opened at which point they will turn off after 60 seconds. I've tried this, but for some reason, nothing is happening. I can only include the actions due to message length.
actions:
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.motionsensor3rdreality_motion
state: "on"
- condition: state
entity_id: binary_sensor.backdoorsensor_opening
state: "on"
sequence:
- target:
entity_id: light.bathroom
data:
brightness_pct: 100
color_name: white
action: light.turn_on
- delay: "00:01:00"
- target:
entity_id: light.bathroom
action: light.turn_off
data: {}
- conditions:
- condition: state
entity_id: binary_sensor.motionsensor3rdreality_motion
state: "on"
- condition: state
entity_id: binary_sensor.backdoorsensor_opening
state: "off"
sequence:
- target:
entity_id: light.bathroom
data:
brightness_pct: 100
color_name: white
action: light.turn_on
- conditions:
- condition: state
entity_id: binary_sensor.motionsensor3rdreality_motion
state: "off"
for:
hours: 0
minutes: 0
seconds: 30
- condition: state
entity_id: binary_sensor.backdoorsensor_opening
state: "on"
sequence:
- action: light.turn_off
metadata: {}
data: {}
target:
area_id: bathroom
mode: single