1
0
ansible-home-assistant/configuration/automations/kitchen-motion.yaml

53 lines
1.4 KiB
YAML

- id: kitchen-lights-on
alias: '[Kitchen] Lights On'
mode: single
trigger:
- platform: state
entity_id: binary_sensor.kitchen_motion_sensor
from: 'off'
to: 'on'
- platform: state
entity_id: binary_sensor.kitchen_tabletop_motion_detection
to: 'on'
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.office_illuminance
below: '170'
sequence:
- service: script.kitchen_lights_on
- id: kitchen-lights-off
alias: '[Kitchen] Lights Off'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.kitchen_motion_sensor
for: '0:02:00'
from: 'on'
to: 'off'
- platform: state
entity_id: binary_sensor.kitchen_sink_motion_sensor
to: 'off'
for: '0:02:00'
- platform: state
entity_id: binary_sensor.kitchen_tabletop_motion_detection
to: 'off'
for: '0:02:00'
condition:
- condition: state
entity_id: binary_sensor.kitchen_motion_sensor
state: 'off'
for: '0:02:00'
- condition: state
entity_id: binary_sensor.kitchen_sink_motion_sensor
state: 'off'
for: '0:02:00'
- condition: state
entity_id: binary_sensor.kitchen_tabletop_motion_detection
state: 'off'
for: '0:02:00'
action:
- service: script.kitchen_lights_off