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: action:
- service: light.turn_off - service: light.turn_off
entity_id: light.bathroom_lights 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 - id: bathroom-mirror-lights-on
alias: '[Bathroom] Mirror Lights On' alias: '[Bathroom] Mirror Button Music'
trigger: trigger:
- device_id: 4d5298037e93ba11438409bff01b5005 - device_id: 4d5298037e93ba11438409bff01b5005
domain: zha domain: zha
@ -7,44 +7,52 @@
type: remote_button_short_press type: remote_button_short_press
subtype: turn_on subtype: turn_on
action: action:
- choose: - service: media_player.media_play_pause
- conditions: target:
- condition: state entity_id: media_player.bathroom
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 mode: single
- id: bathroom-mirror-lights-off - id: bathroom-mirror-lights-off
alias: '[Bathroom] Mirror Button Off' alias: '[Bathroom] Mirror Button Lights toggle'
trigger: trigger:
- device_id: 4d5298037e93ba11438409bff01b5005 - device_id: 4d5298037e93ba11438409bff01b5005
domain: zha domain: zha
platform: device platform: device
type: remote_button_short_press type: remote_button_short_press
subtype: turn_off subtype: turn_off
- platform: state
entity_id: binary_sensor.bathroom_motion_occupancy
for: '0:05:00'
from: 'on'
to: 'off'
action: action:
- service: light.turn_off - choose:
data: - conditions:
entity_id: light.bathroom_mirror_lights - 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 mode: single