I was using a nice blueprint to control media players using an ikea symfonisk controller (https://gist.github.com/seamus65/0cd586edfee2e245e0b7e8081c5865f1).
That blueprint uses raw ZHA events and their attributes. These attributes have changed several times breaking the blueprint.
I finally rewrote the blue print based on the higher level device triggers. Additionally I added some extra configuration options:
Delay between volume updates (sensitivity)
Number of volume steps (accuracy)
Choice for single press to either pause or mute
Functionally this blueprint is nearly the same, but I hope it will be more resilient for ZHA changes:
note: recreate your automation, if you where using the referred blueprint.
huge thank you for re-structuring the blueprint - it works as intended on the first try.
I’d like to suggest an idea to enhance the functionality: being able to not only change the volume of one single media_player but for multiple entities. Especially users who have mostly static speaker groups in their setup would benefit from this as it would be possible to adjust the overall volume.
I am not experienced with blueprints / yaml inside HA yet and couldn’t get it to work. Also, I think the changes would help me understand what exactly is going on here.
Hi, for a blue print , handling all corner cases of a group of media players is not trivial. But there is an easy way to solve:
For simple control; create a group helper for your media players and use that entity in the blue print (never tried, so in case you can’t select it in graphical mode, choose yaml mode to config the group player)
For advance control, use the universal media player template to control your media players. With these templates, you can reroute volume and power commands to other devices
I created a media_player.sonosgroup group helper entity and tried using it in the blueprint automation. Play/Pause is working as expected, the volume adjustment unfortunately does not.
It is possible to use the service calls media_player.volume_set, media_player.volume_up and media_player.volume_down successfully. But there is no volume_level attribute in the state dev tools for that group entity (only the state playing and so on).
Is it possible that it’s not working because of the template error handling stuff, e.g. "{{ state_attr(player, 'volume_level') is not none }}"?
edit: I don’t need any more advanced control than this but I also haven’t had the time today to try your second approach yet.
Some players don’t support volume level, only up and down. This blue print version is using volume level in order to control the number of volume steps.
If your players don’t support volume level, the universal media player template is not going to work either.
But I have and older version, where volume up and down where used:
blueprint:
name: ZHA - IKEA Symfonisk sound controller for media
description: 'Control media with an IKEA Symfonisk sound controller (the spinny
ones).
Single press will toggle Play/Pause on your selected media player.
You can set functions for double press and triple press.
Rotating left/right will change the volume smoothly of the selected media player,
if that function is possible.'
domain: automation
input:
remote:
name: Remote
description: IKEA Symfonisk controller to use
selector:
device:
integration: zha
manufacturer: IKEA of Sweden
model: SYMFONISK Sound Controller
media_player:
name: Media Player
description: The media player to control
selector:
target:
entity:
domain: media_player
double_press:
name: Double press
description: Action to run on double press
default: []
selector:
action: {}
triple_press:
name: Triple press
description: Action to run on triple press
default: []
selector:
action: {}
source_url: https://community.home-assistant.io/t/zha-ikea-symfonisk-sound-controller-for-media-the-spinny-one/266130
mode: single
max_exceeded: silent
trigger:
- device_id: !input 'remote'
id: press_single
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_on
- device_id: !input 'remote'
id: press_double
domain: zha
platform: device
type: remote_button_double_press
subtype: turn_on
- device_id: !input 'remote'
id: press_triple
domain: zha
platform: device
type: remote_button_triple_press
subtype: turn_on
- device_id: !input 'remote'
id: rotate_right
domain: zha
platform: device
type: device_rotated
subtype: right
- device_id: !input 'remote'
id: rotate_left
domain: zha
platform: device
type: device_rotated
subtype: left
action:
- choose:
- conditions:
- condition: trigger
id: press_single
sequence:
- service: media_player.media_play_pause
target: !input 'media_player'
- conditions:
- condition: trigger
id: press_double
sequence: !input 'double_press'
- conditions:
- condition: trigger
id: press_triple
sequence: !input 'triple_press'
- conditions:
- condition: trigger
id: rotate_right
sequence:
- service: media_player.volume_up
target: !input 'media_player'
- delay: 1
- conditions:
- condition: trigger
id: rotate_left
sequence:
- service: media_player.volume_down
target: !input 'media_player'
- delay: 1
This older version doesn’t have configuration options for volume steps, or the delay. So hard code another value for the delay if you want ( e.g 0.2 instead of 1)
The single media_player entities each have a volume_level attribute. The volume_set service works for both the single entities as well as the group helper. Your blueprint (new version) also works for a single entity but not for the group helper. That’s what confuses me.
The old version might not be as customizable but it works perfect for me. I can use my remote again, finally. Thank you!
glad to hear. If I find a moment I will blend in the delay as configuration in the old version.
If your single players support the level option, using the universal media player to Group them will work with the new version.
Hi Eric,
Thank you very much for your blueprint. It’s the best I’ve seen so far.
Sadly I have the problem, that I can’t continually rotate the controller (or at least it only gives the volume command once). I’ve looked into the zha events, and sadly my device only says, when it’s beginns rotating and when it stops. Is this normal behaviour?
That behavior is different indeed. I guess you own a newer symphonisk generation. The first gen was spamming rotate event and I even had to ignore most of them using a small delay.
This blueprint wasn’t designed for such behavior and therefore not properly handle the volume changes while rotating.
In order to fix it, you will need some triggers between start and stop or add a wait for trigger loop. Not easy to design without owning the new version
I guess it must be due to the newest ota update. I remember seeing dozens of “zha_events” for one short rotation.
Thanks for your answer. I’ll try to find an old ota update