Hello Joerg, thank you so much for your efforts. A little bit awkward, I played with the new alexa switches and didnāt recognize that the do_not_disturb_switch was activated. So now Iāve learned that that switch only affects on type: announce.
I use swipe-card myself and have conditional cards inside it, which each a speaker nested (I use Logitech Media Server with multiroom syncing). When everything is off, nothing shows. If one is playing, I see one media_player card. When more than one is playing, I still see one, but there is a bullet point that shows there are more slides. Then I can just slide between the players.
Thank you for the quick reply @ASNNetworks, I did think in that direction, but as far as I can see, the state of the sonos speakers donāt change if I group it through the speaker group option. And therefore I canāt set a condition.
I also tried the swipe card, to keep things less cluttered, but the dropdown, when choosing favorites is being restricted by the border of the swipe card. I have maybe 10 playlists and radio stations in my favorites list. So there is only room for the 1st one.
Will the players show theyāre synced in the attributes? If you go to your HA instance, then developer-tools/state in the url, check out what all attributes are while in and out of a sync group.
Then you could use those attributes to create template binary sensors. And then use those as the entity in the conditional card states. When in a sync group > binary sensor turns on, which means card will hide. And vice versa.
Most likely you can also achieve this without needing to create binary sensors for each speaker, if you use config-template-card. Then you can use templates (like attributes) in your conditional card. But will require some more work to first understand it.
Both options should allow you to achieve what you want though
Compared to living room speaker which is playing on itās own:
sonos_group:
- media_player.living_room
So the logic should be, if there are >1 entities in that list, they are grouped.
And I would probably make a binary sensor for each speaker, as I am not that skilled.
And then 4 conditional cards (1 for each speaker), that only shows if group binary sensor is true for each and their own speaker. And of course only show the current 4 cards, if group=no.
Would this be an viable approach? Sounds like a fun small project!
Yes, so you need to create a template binary sensor for each speaker. For media_player.kitchen you need to create a template that checks if the attribute sonos_group has other entities other than media_player.kitchen inside it. Or maybe you can use a count template for that. If attribute sonos_group has more than one option inside it, then return as on, otherwise return as off I think that would be a lot easier.
Do that for each speaker. Each binary sensor basically tells you: hey this speaker is in a group. Then use the binary sensor you created for each speaker as the entity in the conditional card you use for each speaker. Set it as state: 'off' (do not forget the quotes around 'off' if you use YAML). Then the media player will only show if the binary sensor you created for it is off, which means the speaker is not in a group.
Unfortunately my templating skills are lacking, so I canāt help you with that. I would ask this through the Discord channel to get some help
And that solution is actually a bit more elegant, as I can just add a condition to the existing 4 cards, so they disappear if they are grouped, but not master.
Iām having trouble getting the Grouped Cards to work. When I use the code below (from the GitHub example) in the card configuration, I just get an error code that says āNo type provided.ā
I can create cards all day long using the visual editor so Iām assuming this isnāt an installation issue. Any thoughts?
I am trying to use this card so I can control the volume of my Vizio SmartCast Soundbar. However, once I create a basic card for the soundbar (code below), the volume slider does not perform a volume āsetā action like I would expect - instead, my setting the volume of the soundbar only adjusts the volume down slightly.
For instance, if my volume on the soundbar is set to 75% of maximum, and I move the Mini Media Player slider down to 10% - the result on the soundbar is for the volume to maybe move down to 70%. This setting of 70% is then reflected on the Mini Media Player slider after about 1 second. Any ideas for a solution, or is this soundbar simply not supported? I am able to set the volume of this speaker using the automation of media_player.volume_set.
I want to add a list selection that should choose what speaker to output the media to. I have this so farā¦ But it just wont work when it comes to the source select. It just plays on the kitchen speaker all the time.
type: custom:mini-media-player
entity: media_player.kitchen_speaker
source: icon
hide:
volume: false
source: false
power_state: false
artwork: material
shortcuts:
columns: 3
list:
- name: Play in kitchen
type: source
id: media_player.kitchen_speaker
- name: Play in office
type: source
id: media_player.office_speaker
buttons:
- name: P3
type: music
id: https://sverigesradio.se/topsy/direkt/164-hi.mp3
- name: P4
type: music
id: https://sverigesradio.se/topsy/direkt/221-hi.mp3
- name: Spotify
type: service
id: spotcast.start
data:
entity_id: media_player.kitchen_speaker
uri: spotify:playlist:6kCXbV91V2I5eYcHvknB4Y
Bit of a long shot this but is there any way of having some kind of background overlay behind the media player element itself when using full cover art?