1 media slider for multiple media devices?

I have a multi-zone audio setup using monoprice amp. What I would like to do is group multiple zones into 1 volume slider. My current universal media player controls the power state of both devices, but the volume slider only controls the first child

https://paste.ubuntu.com/p/hBDqDYSgBW/

Any help would be appreciated.

May I suggest not using that paste service?
In 2 days’ time it will no longer be available and your post will become somewhat useless to other readers who may be in a similar situation.

Back to your question, I’ve not used the Universal Media Player before so not 100% sure why not all media_player entities would respond to the volume command.

That said, you could create a slider input_number for your volume and use an automation to assign the slider value to your various media players. This would also allow for different types of media players (those with different volume ranges than [say] 0 to 1, you’ve not confirmed that all your media player entities have a volume range of 0…1)

if you want the slider to control both, you need to add the interfaces to handle that: volume_set and volume_level. Now if you leave the volume_level attribute blank, it’s state will be based on the first media player. Otherwise you can override it if that’s not what you want.

Also, as a side note, your spacing is all out of whack in places. It won’t cause problems but you should be consistent.

Either way, this should work.

  - platform: universal
    name: deck
    children:
    - media_player.zone_14
    - media_player.zone_15
    commands:
      turn_on:
        service: media_player.turn_on
        data:
          entity_id: 
          - media_player.zone_14
          - media_player.zone_15
      turn_off:
        service: media_player.turn_off
        data:
          entity_id: 
          - media_player.zone_14
          - media_player.zone_15
      volume_up:
        service: media_player.volume_up
        data:
          entity_id: 
          - media_player.zone_14
          - media_player.zone_15
      volume_down:
        service: media_player.volume_down
        data:
          entity_id: 
          - media_player.zone_14
          - media_player.zone_15
      volume_set:
        service: media_player.volume_set
        data_template:
          entity_id:
          - media_player.zone_14
          - media_player.zone_15
          volume_level: '{{ volume_level }}'
1 Like

You’re a hero! it works great!

SmartSelect_20200721-100343_Gallery

Can you post the full yaml for this? and where do you put it?

-Edit- Nevermind I, figured it out. Thanks so much for this code sample. I was trying to do it with platform:group like I did for my light bulbs but that wasnt working.

i put this in my confuration.yaml

media_player:
  - platform: universal
    name: Kitchen
    view: no
    children:
      - media_player.zone_11
      - media_player.zone_12
    commands:
      turn_on:
        service: media_player.turn_on
        data:
          entity_id: 
          - media_player.zone_11
          - media_player.zone_12
      turn_off:
        service: media_player.turn_off
        data:
          entity_id: 
          - media_player.zone_11
          - media_player.zone_12
      volume_up:
        service: media_player.volume_up
        data:
          entity_id: 
          - media_player.zone_11
          - media_player.zone_12
      volume_down:
        service: media_player.volume_down
        data:
          entity_id: 
          - media_player.zone_11
          - media_player.zone_12
      volume_set:
        service: media_player.volume_set
        data_template:
          entity_id:
          - media_player.zone_11
          - media_player.zone_12
          volume_level: '{{ volume_level }}'