1
0
ansible-home-assistant/automations/files/bathroom-motion.yaml

32 lines
738 B
YAML

- id: bathroom-motion-on
alias: '[Bathroom] Motion On'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.bathroom_motion_sensor
from: 'off'
to: 'on'
action:
- service: light.turn_on
entity_id:
- light.bathroom_1
- light.bathroom_2
- light.bathroom_3
- light.bathroom_4
- id: bathroom-motion-off
alias: '[Bathroom] Motion Off'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.bathroom_motion_sensor
for: '0:02:00'
from: 'on'
to: 'off'
action:
- service: light.turn_off
entity_id:
- light.bathroom_1
- light.bathroom_2
- light.bathroom_3
- light.bathroom_4