summaryrefslogtreecommitdiffstats
path: root/blueprints
diff options
context:
space:
mode:
Diffstat (limited to 'blueprints')
-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" }}'