From 5b3ac327ec7e50c4c0c91df2e552849c0f4f34ff Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Tue, 11 Jan 2022 00:14:00 +0100 Subject: [PATCH] Change bathroom music based on shower motion --- .../automations/bathroom-shower-motion.yaml | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/configuration/automations/bathroom-shower-motion.yaml b/configuration/automations/bathroom-shower-motion.yaml index ffff0b5..fb8dc6b 100644 --- a/configuration/automations/bathroom-shower-motion.yaml +++ b/configuration/automations/bathroom-shower-motion.yaml @@ -8,6 +8,17 @@ to: 'on' action: - service: script.bathroom_shower_lights_on + - choose: + - conditions: + - condition: state + entity_id: media_player.bathroom + state: playing + sequence: + - service: media_player.volume_set + data: + volume_level: 0.65 + target: + entity_id: media_player.bathroom - id: bathroom-shower-motion-off alias: '[Bathroom] Shower Motion Off' @@ -29,4 +40,15 @@ for: '0:02:00' state: 'off' action: - - service: script.bathroom_shower_lights_off \ No newline at end of file + - service: script.bathroom_shower_lights_off + - choose: + - conditions: + - condition: state + entity_id: media_player.bathroom + state: playing + sequence: + - service: media_player.volume_set + data: + volume_level: 0.30 + target: + entity_id: media_player.bathroom \ No newline at end of file