1
0
ansible-home-assistant/configuration/automations/office-presence.yaml

28 lines
663 B
YAML

- id: office-lights-on
alias: '[Office] Lights On'
mode: single
trigger:
- platform: state
entity_id: binary_sensor.presence_sensor_fp2_office
to: 'on'
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.office_illuminance
below: '200'
sequence:
- service: script.office_lights_on
- id: office-lights-off
alias: '[Office] Lights Off'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.presence_sensor_fp2_office
to: 'off'
for:
seconds: 5
action:
- service: script.office_lights_off