Dashboard: Sonos card

Yea, if it appears I’m home assistant’s built in media browser

I’m working with the predefined groups and have setup a few (back rooms, downstairs, everywhere) but if I am playing something on say the back rooms and click the button for the predefined group for downstairs, the group gets created but the music stops and I have to start it again. This behavior happens when using any of the predefined groups, but if I have music playing and simply click the individual speaker buttons in grouping they get added or removed from the group and music continues to play. Is there a way to keep the music playing when the predefined groups are used?

Sounds like a bug. Can you post on GitHub?

Sure, I’ll post this over there

Loving this card!

Is there a way to show the name of the currently selected speaker group on the player? I’m showing the group card in a popup and want to be able to se what I’ve selected

Done! Release v5.18.0 · johanfrick/custom-sonos-card · GitHub

1 Like

Thanks! Looks Perfect!!

Having another issue though…Loading the sonos group card in a browser mod pup up. Everything works the first time, and I can select a speaker from the group card. The second time I open the group card and select a new speaker, it temporarily selects the new speaker group, then reverts back to the original speaker group. Yaml is below. Should I open an issue?

type: vertical-stack
cards:
  - type: custom:sonos-player
    entityId: media_player.kitchen_sonos
    skipAdditionalPlayerSwitches: true
    styles:
      media-controls-icon:
        '--mdc-icon-size': 36px
      player-container:
        margin-top: 0rem
  - type: horizontal-stack
    cards:
      - show_name: true
        show_icon: true
        type: button
        icon: mdi:speaker
        name: Select Speaker
        tap_action:
          action: fire-dom-event
          browser_mod:
            service: browser_mod.popup
            data:
              content:
                type: custom:sonos-groups
                groupsTitle: ' '
              title: Speakers
      - type: button
        icon: mdi:ungroup
        name: Edit Group
        tap_action:
          action: fire-dom-event
          browser_mod:
            service: browser_mod.popup
            data:
              content:
                type: custom:sonos-grouping
                groupingTitle: ' '
              title: Edit Group
      - type: button
        name: Media
        icon: mdi:disc
        tap_action:
          action: fire-dom-event
          browser_mod:
            service: browser_mod.popup
            data:
              content:
                type: custom:sonos-media-browser
                mediaTitle: ' '
                styles:
                  media-browse:
                    '--mdc-icon-size': 48px

Sure, you can open an issue

This is absolutely awesome I’ve been playing around a bit and loving it. One thought for a design I’m after - is it possible to remove the overlays completely from the album artwork? (title, player controls, etc.?) Thinking of a few old tablets spread about that just display what’s playing from a dash but not necessarily give control - just view.

Sure, you can pretty much hide anything you want with the styles: config. Check documentation about it in the first post.

Thanks - I have had SOME success here but it’s not super obvious to me how to just straight up hide a section. I’ve been digging around finding the bits I can configure and basically making a garbage looking dash just to capture some of them (example below). One thing I can’t sort out is the name for the color of the player control buttons in the highlighted or un-highlighted state (moused over or not). I think having all of the variables captured somewhere will make life easier for people trying to skin this thing a bit which I’ll continue to work on here. Any hints on the player buttons?

type: custom:sonos-card
skipAdditionalPlayerSwitches: true
disableDynamicVolumeSlider: true
styles:
  player-info:
    '--sonos-int-player-section-background': '#e5910980'
    '--sonos-int-artist-album-text-color': white
    '--sonos-int-song-text-color': white
  media-controls:
    '--sonos-int-player-section-background': '#e5910980'
  media-controls-icon:
    '--mdc-icon-size': 26px
  player-container:
    margin-top: null
1 Like

Unless I misunderstand, I believe you are overcomplicating it. Simply hide whatever element with display: none. Example:

styles:
  player-body:
    display: none

/PunxaPhil
BMC

Sorry - I kinda conflated a few things.

  1. Hiding (got it, thx!)
  2. general styling, finding some of the right things to set is hard

I’m open to suggestions! Could we start a discussion (or issue) on Github?

Thanks for a wonderful card and all the users in this thread for lots of ideas. I know nothing about CSS or other such mechanisms so pretty much just run the vanilla card.
I have one hope for a future versions.

  1. Would it be possible to have both the title section and play controls section be pop-up type? That way the full album art could be seen and a mouse over could be used to get those sections to open up. Maybe even with a pin on each if you wanted to pin them open.

Now to expose my lack of knowledge. I’ve tried my best to use these settings (copied from this thread) to get the song tile/artist information to be black/larger/bolder so these older eyes of mine can read them easier. I have currently -

Sonos

sonos-background-color: var(–secondary-background-color)
sonos-ha-card-background-color: none
ha-card-box-shadow: none
sonos-artist-album-text-color: rgb(192, 192, 192)
sonos-title-color: rgb(198, 203, 210)
sonos-color: rgb(198, 203, 210)
sonos-player-section-background: rgb(32, 33, 36)
sonos-accent-color: rgb(198, 203, 210)
sonos-song-text-color: rgb(192,192,192)

But they still are hard to read for me.

Thanks again!

You shouldn’t need to know CSS really, there is a detailed example in the documentation in the first post for styling. Showing you how to change color and font weight. Here is another example:

type: custom:sonos-card
styles:
  player-song:
    color: black
    font-weight: bold
  player-artist-album:
    color: black
    font-weight: bold


BMC

1 Like

Hi all:

Every time I try to play a Spotify playlist through this app, nothing plays. On occasion, I’ll see the following error at the bottom of my screen:

Failed to call service media_player/play_media. Error calling SonosMediaPlayerEntity.play_media on media_player.sonos_office: UPnP Error 711 received: Illegal seek target from 192.168.1.67

However, the Sonos apps on my computer or iPhone do work to connect to Spotify, so there’s something that’s specific to the Home Assistant integration that’s not working for me.

Not sure what I’m doing wrong here or if there’s a workaround to this. Anybody have any ideas?

Thanks

For some reason the card picks up my Yamaha AVR (TSR700). Any idea on why and how I can hide it? I do have to added as an integration and it does support streaming so maybe that’s why? In fact, if I could hide the Garage and Porch Sonos speakers I wouldn’t mind ;).
I added the speakers I want to have in the Groups specifically in the player card. Should I enter them somewhere else?


Thanks.

Guess I should try things before reaching out. Yes, adding to the Groups/Grouping cards resolved.

1 Like

How do you get the media control buttons in the middle of the image like that?