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

51 lines
1.4 KiB
YAML
Raw Normal View History

- id: bathroom-mirror-lights-on
alias: '[Bathroom] Mirror Lights On'
2020-12-20 20:43:46 +00:00
trigger:
- device_id: 4d5298037e93ba11438409bff01b5005
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_on
action:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'on'
sequence:
- service: light.turn_on
entity_id: light.bathroom_mirror_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_mirror_lights
data:
brightness_pct: 100
kelvin: 3200
2020-12-20 20:43:46 +00:00
mode: single
- id: bathroom-mirror-lights-off
2021-01-07 00:48:14 +00:00
alias: '[Bathroom] Mirror Button Off'
2020-12-20 20:43:46 +00:00
trigger:
- device_id: 4d5298037e93ba11438409bff01b5005
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_off
- platform: state
entity_id: binary_sensor.bathroom_motion_occupancy
for: '0:05:00'
from: 'on'
to: 'off'
2020-12-20 20:43:46 +00:00
action:
- service: light.turn_off
2020-12-20 20:43:46 +00:00
data:
entity_id: light.bathroom_mirror_lights
2020-12-20 20:43:46 +00:00
mode: single