1
0
ansible-home-assistant/configuration/automations/bathroom-lights.yaml

80 lines
2.2 KiB
YAML

- id: button-lights-on
alias: '[Bathroom] Lights On'
trigger:
- platform: state
entity_id: binary_sensor.bathroom_motion_occupancy
to: 'on'
- platform: state
entity_id: binary_sensor.bathroom_door_open_close
to: 'on'
action:
- choose:
- conditions:
- condition: state
entity_id: input_select.home_mode
state: Day
sequence:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'on'
sequence:
- service: light.turn_on
entity_id: light.bathroom_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.bathroom_lights
data:
brightness_pct: 100
kelvin: 3200
- conditions:
- condition: state
entity_id: input_select.home_mode
state: Night
sequence:
- service: light.turn_on
entity_id: light.bathroom_lights
data:
brightness_pct: 5
kelvin: 2700
mode: single
- id: bathroom-lights-off
alias: '[Bathroom] Lights Off'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.bathroom_motion_occupancy
for: '0:05:00'
from: 'on'
to: 'off'
- platform: state
entity_id: binary_sensor.shower_motion
for: '0:02:00'
from: 'on'
to: 'off'
condition:
- condition: state
entity_id: binary_sensor.bathroom_motion_occupancy
for: '0:05:00'
state: 'off'
- condition: state
entity_id: binary_sensor.shower_motion
for: '0:02:00'
state: 'off'
action:
- service: light.turn_off
entity_id: light.bathroom_lights
- service: light.turn_off
entity_id: light.bathroom_mirror_lights
- service: light.turn_off
entity_id: light.shower_lights