Media Player Card with Grouping Support and Custom Buttons

I get the searchbutton but no result while trying to search for anything.

Just to be sure. You do have music providers configured in music assistant right?

Yes, but only Spotify.

And you can search and find music through music assistant in music assistants own interface? And you have Spotify premium?
I ask because I also have Spotify as one of my providers, and it seems to work just fine.
The card just uses the music assistant search action under the hood. It doesn’t do anything special in that regard.

Yepp, I can use the search inside MA with good result, but nothing when trying in Mediocre card. and it is Spotify Premium.

Next debugging step would be to try to use the music assistant search action in a script or automation to see if the issue is with the card or MA.

anyone an idea too see the sonos favourites in Playlist custom buttons ? :slight_smile:

1 Like

If you just need something static, you could create s button for each favourite and play it using actions.
If you need it dynamically populating that’s going to be harder. I’m a big fan of streamline card. With that you could probably use JavaScript fill out the buttons with the right things. But it’s not going to be an easy thing to do I think.

1 Like

Hi, first of all, I want to say I’m really impressed with the card. The design and functionality are fantastic, and setting it up is super easy. This is definitely my top recommendation for anyone looking for a simple way to control multiroom audio with a sleek interface.

However, I’m a bit confused about the “Link Volume” option when grouping speakers. It seems to only work within the grouped speakers. I have a HomePod Mini as the main entity and a Denon AVR as a grouped speaker. Even with “Link Volume” enabled, both volume sliders still function independently.

To me, it would feel more intuitive if the main speaker also appeared in the grouped speakers list with its own individual volume control. Meanwhile, the main volume slider at the top could control the entire group. This way, the distinction is clear: individual adjustments happen in the group list, and the main slider handles overall volume, making the “Link Volume” option obsolete.

By the way, if you need help with localization, I could help with German.

Thank you so much!

With regards to the linked volume. You have to add your ‘card’ entity to the array aswell. If you do, the speaker will appear at the top of the grouping interface, and adjusting the main speaker volume will the adjust the other ones. I might have to automatically add the main speaker to that array.
I mainly have it that way so you don’t have to have a different array for every card you make.

Translation should definitely come soon I think, so that sounds awesome thanks!

I initially configured it that way, but it felt odd since then the main entity also appears as a chip in the speakers list, which is confusing, because it seems you can group it with itself. The simplest solution from a user perspective would be to automatically add the main entity to the grouped players list when another player is grouped with it.

I agree. However your main speaker should not appear as a chip, so that’s a bug.
I’m curious, what happens if you also add it to speaker_group.entity_id?

It looks like this. No difference if i set entity_id or not in the speaker group.

type: custom:mediocre-media-player-card
entity_id: media_player.esszimmer_mass
action: {}
tap_opens_popup: true
speaker_group:
  entities:
    - media_player.denon_mass
    - media_player.esszimmer_mass
  entity_id: media_player.esszimmer_mass
2 Likes

You’re definitely not supposed to see the HomePod mini under add to speaker. I’m assuming the HomePod is esszimmer. I’ll have to look into that. Not happening here sadly, but reviewing the code I might figure out what’s going on.
I’m developing this card in the 1 hour between putting my kids to bed and my own bedtime, so don’t expect extremely fast development :slight_smile:

1 Like

Yes, esszimmer_mass is the HomePod Mini.
Thats okay, i am just grateful to get to use such awesome software for free :slight_smile:
So thank you for your work and if I can help, im here

1 Like

v0.21.0 just released with:

Search for any (supported) media player

Previously search was only possible with a music assistant player. Now search works with media player that supports the search_media action.
Read more about search here.

Improvements

  • Picking a media item from search you now get a visual confirmation that the action was successful (thanks to @mooseBringer for the idea and also testing the beta).
  • Card now always shows main media_player in group volume controller (regardless of whether you include it in the group speakers array).

Bug fixes

  • Fix for handling of multiple music assistant config entries (thanks to @fmunkes for reporting and testing).
  • Fix for main speaker showing in speaker chips interface (thanks to tim.ben on the home assistant forums for this report).
2 Likes

Hmmm, wonder if the new search function would work with the youtube music integration?

Edit: I guess it does not, the other card below yours is POLR ytube media card, it works with search so must be using something different damn.

1 Like

Yeah they must be using something specific to YouTube.
The search_media action was added to homeassistant this month so very few media players have implemented support yet. I’m really hoping most media players with integrated libraries (LMS, Sonos, etc) do implement this, as it would also make voice search very easily just work with any home assistant media player.
And speaking a common language is nice too. Don’t want to maintain too many different ways to do the exact same thing.

2 Likes

This is a great card - just getting to dig into it! One question (for now)… I can create a chromecast group via MusicAssistant and play to it, but if I try and create a group using your card, I get a message “media_player.office_speaker_ma does not support action media_player.join”…
Is there any way around this?
thanks for all your hard work!

1 Like

Chromecasts can’t do speaker groups through home assistant. Only way is to make the speaker group in the Google Home app which will then appear in Home Assistant as a single speaker.

1 Like