diff --git a/configuration/automations/bathroom-button.yaml b/configuration/automations/bathroom-button.yaml index 1d5429a..63390fc 100644 --- a/configuration/automations/bathroom-button.yaml +++ b/configuration/automations/bathroom-button.yaml @@ -1,5 +1,5 @@ -- id: button-bathroom-on - alias: '[Bathroom] Button On' +- id: button-bathroom-on-off + alias: '[Bathroom] Button On/Off' trigger: - device_id: 800c754de6e6b10259f371adc123b909 domain: zha @@ -7,7 +7,42 @@ type: remote_button_short_press subtype: turn_on action: - - service: light.toggle - data: - entity_id: light.bathroom_lights + - 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 \ No newline at end of file diff --git a/configuration/automations/bathroom-music-button.yaml b/configuration/automations/bathroom-music-button.yaml index 5deda48..2b92d6f 100644 --- a/configuration/automations/bathroom-music-button.yaml +++ b/configuration/automations/bathroom-music-button.yaml @@ -57,5 +57,4 @@ subtype: remote_button_short_press action: - service: media_player.media_play_pause - target: - entity_id: media_player.bathroom \ No newline at end of file + entity_id: media_player.bathroom \ No newline at end of file diff --git a/configuration/automations/bathroom-music.yaml b/configuration/automations/bathroom-music.yaml index 64f76f2..65cc859 100644 --- a/configuration/automations/bathroom-music.yaml +++ b/configuration/automations/bathroom-music.yaml @@ -16,10 +16,12 @@ entity_id: media_player.bathroom_speaker state: 'off' action: - - service: spotcast.start + - service: media_player.play_media + target: + entity_id: media_player.bathroom data: - device_name: Bathroom speaker - uri: 'spotify:playlist:71mXIu6HcdVj3fAMduaHop' + media_content_id: https://open.spotify.com/playlist/71mXIu6HcdVj3fAMduaHop + media_content_type: music - id: bathroom-music-off alias: '[Bathroom] Music Off'