1
0
ansible-home-assistant/configuration/automations/bathroom-shower-motion.yaml
pgrondek 1e554cc0df Fix light automations
change light.toggle to light.turn_on
2021-05-25 16:56:30 +02:00

53 lines
1.4 KiB
YAML

- id: bathroom-shower-motion-on
alias: '[Bathroom] Shower Motion On'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.shower_motion
from: 'off'
to: 'on'
action:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'on'
sequence:
- service: light.turn_on
entity_id: light.shower_lights
data:
brightness_pct: 100
kelvin: 2000
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'off'
sequence:
- service: light.turn_on
entity_id: light.shower_lights
data:
brightness_pct: 100
kelvin: 3200
- id: bathroom-shower-motion-off
alias: '[Bathroom] Shower Motion Off'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.shower_motion
for: '0:02:00'
from: 'on'
to: 'off'
- platform: state
entity_id: binary_sensor.bathroom_motion_occupancy
for: '0:05:00'
from: 'on'
to: 'off'
condition:
- condition: state
entity_id: binary_sensor.shower_motion
for: '0:02:00'
state: 'off'
action:
- service: light.turn_off
entity_id: light.shower_lights