Files
fresh-home/automations/rooms/storage_room_lights.yaml
T
2024-04-14 14:08:56 -04:00

39 lines
883 B
YAML

alias: Storage Room Lights
id: automation_storage_room_lights
mode: queued
trigger:
- platform: state
id: door_open
entity_id: binary_sensor.storage_room_door_contact
from: 'off'
to: "on"
- platform: state
id: door_closed
entity_id: binary_sensor.storage_room_door_contact
to: "off"
for: "00:10:00"
action:
- choose:
- conditions:
- condition: trigger
id: "door_open"
- condition: state
entity_id: light.storage_room
state: 'off'
sequence:
- service: light.turn_on
target:
entity_id: light.storage_room
- conditions:
- condition: trigger
id: "door_closed"
- condition: state
entity_id: light.storage_room
state: 'on'
sequence:
- service: light.turn_off
target:
entity_id: light.storage_room