1
0
ansible-home-assistant/configuration/automations/bathroom-button.yaml
Przemek Grondek e30d4a8d2e Update bathroom automations
fix turning on lights
  change service to call to play music
2021-08-11 23:57:13 +02:00

48 lines
1.6 KiB
YAML

- id: button-bathroom-on-off
alias: '[Bathroom] Button On/Off'
trigger:
- device_id: 800c754de6e6b10259f371adc123b909
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_on
action:
- choose:
- conditions:
- condition: state
entity_id: light.bathroom_lights
state: 'on'
sequence:
- 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
- conditions:
- condition: state
entity_id: light.bathroom_lights
state: 'off'
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
mode: single