1
0

Change mirror button functions to also handle music

This commit is contained in:
pgrondek 2021-06-30 11:52:38 +02:00
parent e1ebf5ed61
commit 76d12defa8
2 changed files with 43 additions and 31 deletions

View File

@ -73,3 +73,7 @@
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

View File

@ -1,5 +1,5 @@
- id: bathroom-mirror-lights-on
alias: '[Bathroom] Mirror Lights On'
alias: '[Bathroom] Mirror Button Music'
trigger:
- device_id: 4d5298037e93ba11438409bff01b5005
domain: zha
@ -7,44 +7,52 @@
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
- service: media_player.media_play_pause
target:
entity_id: media_player.bathroom
mode: single
- id: bathroom-mirror-lights-off
alias: '[Bathroom] Mirror Button Off'
alias: '[Bathroom] Mirror Button Lights toggle'
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'
action:
- service: light.turn_off
data:
entity_id: light.bathroom_mirror_lights
- choose:
- conditions:
- condition: state
entity_id: light.bathroom_mirror_lights
state: 'on'
sequence:
- service: light.turn_off
entity_id: light.bathroom_mirror_lights
- conditions:
- condition: state
entity_id: light.bathroom_mirror_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_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
mode: single