1
0
ansible-home-assistant/roles/automations/files/living-room-presence.yaml

28 lines
691 B
YAML

- id: living_room_lights_on
alias: '[Living Room] Lights On'
mode: single
trigger:
- platform: state
entity_id: binary_sensor.presence_sensor_fp2_couch
to: 'on'
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.office_illuminance
below: '200'
sequence:
- service: script.living_room_lights_on
- id: living_room_lights_off
alias: '[Living Room] Lights Off'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.presence_sensor_fp2_couch
to: 'off'
for:
seconds: 5
action:
- service: script.living_room_lights_off