Custom media card not grouping Sonos speakers

I have a custom media card that I have grouped 2 speakers on but it does not seem to be working. Could someone take a look at my code and see if there is anything off?

  - artwork: material
    entity: media_player.kitchen
    group: true
    hide:
      power: true
    info: short
    name: Kitchen
    source: icon
    speaker_group: 
      platform: sonos
      show_group_count: false
      entities:
        - entity_id: media_player.kitchen
          name: kitchen
        - entity_id: media_player.kitchen2
          name: kitchen2
    shortcuts:
      columns: 2
      rows: 2
      buttons:
        - id: Classic Rock
          type: source
          name: Classic Rock
        - id: Foo Fighters Essentials
          type: source
          name: Foo Fighters
        - id: 70's Chill
          type: source
          name: 70s Chill
        - id: Peloton 90s Rock
          type: source
          name: Peloton 90s Rock
    type: 'custom:mini-media-player'
    volume_stateless: true

In the card, the kitchen speaker shows but not kitchen2 speaker.

Screen Shot 2020-09-02 at 5.54.41 PM

I found my issue. The players were already grouped by the Sonos app. Once I ungrouped them in the Sonos app, they appear and function correctly in HA

Total noob here. Did you group the speakers in yaml before making a custom card? Also did you need to add the card “-type: media-control” above
-artwork: material

@johngalt No I didn’t group them in yaml, I just put them in the custom media player card as described here: Lovelace: Mini Media Player

In order to get it to work as a group, I needed to un-group them in the Sonos app first.

Thanks for the reply. Do you have any code above

  • artwork: material

Like the type of card or anything?

Sorry for the late reply. I just looked and I no longer use the custom media player card for this. Rather I use the entities card with the code below:

entities:
  - artwork: material
    entity: media_player.kitchen
    group: true
    hide:
      power: true
    icon: 'mdi:music'
    info: short
    name: Kitchen
    shortcuts:
      buttons:
        - id: Classic Rock
          name: Classic Rock
          type: source
        - id: Foo Fighters Essentials
          name: Foo Fighters
          type: source
        - id: 70's Chill
          name: 70s Chill
          type: source
        - id: Peloton 90s Rock
          name: Peloton 90s Rock
          type: source
      columns: 2
      rows: 2
    source: icon
    speaker_group:
      entities:
        - entity_id: media_player.kitchen
          name: kitchen
        - entity_id: media_player.kitchen2
          name: kitchen2
      expanded: false
      platform: sonos
      show_group_count: false
      sync_volume: true
      volume_offset: 0
    style: |
      :host {
         --mini-media-player-scale: 1.5;
      }
    type: 'custom:mini-media-player'
    volume_stateless: false
title: Kitchen Sonos
type: entities

great thanks I got it now. I didnt have HACS installed and didnt know I put the code into the card editor. .

Sorry last question (maybe) is there a simple answer as to how you linked the playlist buttons? I’ve tried a couple things but havent gotten it yet…thanks!

For the playlist buttons you just need to name them the same as they appear in the Source drop down on the player. Also in order for them to appear in the source drop down, you need to create the playlist in the Sonos app first. Hope that helps.

Trying to figure this all out… I’m not seeing any drop down… this is what I’m using for the player…
this worked with the Alexa group but not so much with this one… having a difficult time figuring it out.

Any help would be appreciated… here’s what I’m using now of course it’s not working…

- type: custom:mini-media-player
        <<: *card_mod_transparent
        entity: media_player.sonos_five
        name: Home
        shortcuts:
          columns: 3
          buttons:
            - id: Classic Rock
              name: Classic Rock
              type: source
              
          artwork: full-cover-fit
          hide:
            volume: false
            power: true
            source: false
            name: false
            info: false
            controls: false
            progress: false
            icon: false
            state_label: false

Figured it out…

shortcuts:
          columns: 3 # Max buttons per row
          buttons:
      # Start predefined playlist
            - type: source
              name: Classic Rewind
              id: "25 - Classic Rewind"

Here’s a working config for a pair of sonos… if you have only one [of any kind of media_player it’s an adjustment or two]…

- type: 'custom:mini-media-player'
        entity: media_player.sonos_pair
        name: John's House Jams
        icon: mdi:speaker        
        volume_step: 1
        sync_volume: true
        artwork: cover
        hide:
          power: true
          volume: false
          progress: false
          icon_state: false
          state_label: false
          prev: true
          next: true
        speaker_group:
          platform: sonos
          show_group_count: true
          entities:
            - entity_id: media_player.sonos_five
              name: Front Speaker
            - entity_id: media_player.unnamed_room
              name: Rear Speaker
        shortcuts:
          columns: 2 # Max buttons per row
          column_height: 100px
          hide_when_off: true
          label: Stations
          buttons:
      # Start predefined playlist
            - type: source
              name: Classic Rewind
              id: "25 - Classic Rewind"
              icon: mdi:radio
            - type: source
              name: Classic Vinyl
              id: "26 - Classic Vinyl"
              icon: mdi:radio
            - type: source
              name: Rockbar
              id: "313 - RockBar 313"
              icon: mdi:radio
            - type: source
              name: Octane
              id: "37 - Octane"
              icon: mdi:radio
            - type: source
              name: Ozzy's Boneyard
              id: "38 - Ozzy's Boneyard"
              icon: mdi:radio
            - type: source
              name: Hair Nation
              id: "39 - Hair Nation"
              icon: mdi:radio
            - type: source
              name: Liquid Metal
              id: "40 - Liquid Metal"
              icon: mdi:radio
            - type: source
              name: Turbo
              id: "41 - SiriusXM Turbo"
              icon: mdi:radio            
            - type: source
              name: Rock 102
              id: "Classic Rock 102.9 MGK"
              icon: mdi:radio
            - type: source
              name: Country Forever
              id: "Country Forever"
              icon: mdi:radio
            - type: source
              name: Hair Metal
              id: "Hair Metal"
              icon: mdi:radio
            - type: source
              name: ROCK 95.5
              id: "ROCK 95.5"
              icon: mdi:radio

For single entity:

- type: 'custom:mini-media-player'
        entity: media_player.YOURMEDIA_PLAYER
        name: John's House Jams
        icon: mdi:speaker        
        volume_step: 1
        sync_volume: true
        artwork: cover
        hide:
          power: true
          volume: false
          progress: false
          icon_state: false
          state_label: false
          prev: true
          next: true        
        shortcuts:
          columns: 2 # Max buttons per row
          column_height: 100px
          hide_when_off: true
          label: Stations
          buttons:
      # Start predefined playlist
            - type: source
              name: Classic Rewind
              id: "25 - Classic Rewind"
              icon: mdi:radio
            - type: source
              name: Classic Vinyl
              id: "26 - Classic Vinyl"
              icon: mdi:radio

Hope that helps!!! :slight_smile: The ONLY issue I’m having with this is the sonos group, I can see them but cannot turn either to join/unjoin… working on figuring that out LOL
See red circled item… I don’t have that working… I’m sure there’s some simple reason why it’s not working and searching through the forum for an answer but haven’t found one yet…

Capture