summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2024-06-06 06:32:58 +0400
committerSuren A. Chilingaryan <csa@suren.me>2024-06-06 06:32:58 +0400
commitcc45b7a670931c077514ca8f4daeb87d62f659d9 (patch)
tree9868742b50673442e28f336de591853ba925aaf1
parentdb0e50fc6149e3fc74cab0475e378640750ef550 (diff)
downloadhass-cc45b7a670931c077514ca8f4daeb87d62f659d9.tar.gz
hass-cc45b7a670931c077514ca8f4daeb87d62f659d9.tar.bz2
hass-cc45b7a670931c077514ca8f4daeb87d62f659d9.tar.xz
hass-cc45b7a670931c077514ca8f4daeb87d62f659d9.zip
Sound volume control: change volume of both media player and Sven speakers (via IR bridge) - a bit unreliable, might require reverting
-rw-r--r--blueprints/automation/lights/knob-sound-multi-bulb-control.yaml44
1 files changed, 34 insertions, 10 deletions
diff --git a/blueprints/automation/lights/knob-sound-multi-bulb-control.yaml b/blueprints/automation/lights/knob-sound-multi-bulb-control.yaml
index 843b25e..7be33cf 100644
--- a/blueprints/automation/lights/knob-sound-multi-bulb-control.yaml
+++ b/blueprints/automation/lights/knob-sound-multi-bulb-control.yaml
@@ -64,6 +64,13 @@ blueprint:
min: 1
max: 10
+ sven_volume:
+ name: Sven Volume Control
+ description: Control also volume of Sven speakers (if used directly, not via media-player)
+ default: false
+ selector:
+ boolean:
+
trigger:
- platform: state
id: knob
@@ -92,6 +99,7 @@ variables:
hue_delay: !input hue_delay
volume_steps: !input volume_steps
+ sven_volume: !input sven_volume
# We can't use 'queued/restart' if we need to tackle 'double-click'
#mode: queued
@@ -123,24 +131,40 @@ action:
- condition: template
value_template: '{{ current_num < 0 }}'
sequence:
- - repeat:
- count: '{{ volume_steps }}'
- sequence:
- - service: media_player.volume_up
+ - parallel:
+ - if:
+ - condition: template
+ value_template: '{{ sven_volume == true }}'
+ then:
+ - service: scene.turn_on
target:
- entity_id: !input media_player
+ entity_id: scene.sven_volume_up
+ - repeat:
+ count: '{{ volume_steps }}'
+ sequence:
+ - service: media_player.volume_up
+ target:
+ entity_id: !input media_player
- conditions:
- condition: template
value_template: '{{ trigger.to_state.state == "brightness_step_down" }}'
- condition: template
value_template: '{{ current_num < 0 }}'
sequence:
- - repeat:
- count: '{{ volume_steps }}'
- sequence:
- - service: media_player.volume_down
+ - parallel:
+ - if:
+ - condition: template
+ value_template: '{{ sven_volume == true }}'
+ then:
+ - service: scene.turn_on
target:
- entity_id: !input media_player
+ entity_id: scene.sven_volume_down
+ - repeat:
+ count: '{{ volume_steps }}'
+ sequence:
+ - service: media_player.volume_down
+ target:
+ entity_id: !input media_player
- conditions:
- condition: template
value_template: '{{ trigger.to_state.state == "color_temperature_step_up" }}'