Universal media player and volume_mute toggle issues

Hi

I was experimenting with the universal media player and i got it mostly working but there was one odd behavior that i think is actually a bug.

i got a denon amp and a enigman2 based dvb box that i wanted to create a universal media player for.
so volume related controlls goes to the amp and everything else like source list (=the channels) goes to the dvb box.

i setup the volume_mute part of the universal media player like this:

volume_mute:
        service: media_player.volume_mute
        data:
         entity_id: media_player.denon_avr_x2000

but this doesn’t work and whenever you try to use the mute button you get an error about is_volume_muted not provided to the service call.

i assumed this would be provided based on the state of the mute, so either is_volume_muted parameter to the service call would wend up being true or false.
but this is not the case.

if i instead do this:

volume_mute:
        service: media_player.volume_mute
        data:
         entity_id: media_player.denon_avr_x2000
         is_volume_muted: true

it works but obviously i can only mute and it doesn’t function as a toggle button as it should be.
how do i get around this?

Hi @TobbeJ,

I got the same problem and managed to solve it using the following configuration:

      volume_mute:
        service: media_player.volume_mute
        data:
          entity_id: media_player.sonos
          is_volume_muted: "{{ is_volume_muted }}"

And then also provide an attribute to the universal media player with the mute status:

    attributes:
      is_volume_muted: media_player.sonos|is_volume_muted

Hopefully this works for you as well.

Cheers!

3 Likes

hmm…
interesting, but don’t you need to invert the is_volume_muted in the service call?

i guess i should give it a try and see if it works but would like to understand how or why it works.

Yes, I also expected it to work the other way around. But for me this is the way it is working now.

If you find out why, I would like to know too…

The is_volume_mured inside the template comes from the user calling the service volume mute on the universal media player. That’s then passed through the variable to the service you’re actually trying to call

1 Like

THANK YOU SO MUCH!