Dashboard: Sonos card

Great card, I love it! :slight_smile:

Iā€™ve 2 questions:

  1. Is it possible to somehow filter the media displayed in the media browser? e.g. Iā€™d like to skip local media & netatmo

  2. Is it possible to set the default state of media broweser? e.g. Iā€™d like to load my wifeā€™s sono playlists

Thank you for you support!
b

I dug deeper in using automations with the several dozen playlists I have favorited in SONOS now.

I spend an obnoxious amount of time listening to SONOS and playlist fatigue can happen easily with limiting automations/playlists. For those who donā€™t know how, hereā€™s a script you can use to randomize the selection of your playlists. Just swap out the names of your playlists and donā€™t forget to remove the heavy metal playlist from the dinner/bedtime automations (or donā€™t, I donā€™t know your life):

service: media_player.select_source
data:
  source: >-
    {{ ['Soft Jazz Sax', 'Disco Essentials', 'Chill House', 'Chill Synthwave', 'Classical in Spatial Audio', 'Dinner Party', 'Electronic in Spatial Audio', 'Good Vibes Only', 'Jazz in Spatial Audio'] |
    random}}
target:
  device_id: d0a7ecf729f5e419975ebddd8454ab16

The card is great and offers an awesome overall view of playlists but I like to automate selections where I can and let HA pick music to keep it fresh (or at least changing).

2 Likes

Thanks!

Could you please create issues in Github for it?


PunxaPhil - I like coffee :slightly_smiling_face:

I tried your script but it does nothing when launchedā€¦
Maybe i need something else to configure other than source and target?

there was a formatting error, sorry:

service: media_player.select_source
data:
  source: >-
    {{ ['Soft Jazz Sax', 'Disco Essentials', 'Chill House', 'Chill Synthwave',
    'Classical in Spatial Audio', 'Dinner Party', 'Electronic in Spatial Audio',
    'Good Vibes Only', 'Jazz in Spatial Audio'] | random}}
target:
  device_id: d0a7ecf729f5e419975ebddd8454ab16

Sorry, but still no wayā€¦ I just run this script after modifying following my playlists, but no music.

In the script configuration panel i see:

two things. I had issues when one of my playlists had a colon in it, so remove that playlist (you can rename it in sonos).

Second, the efficacy in the dev tools of this script seemed hit or miss and I read a few threads reporting this behavior. It was only when I built an actual script that it would fire every time (I canā€™t tell from the screenshot).

Edit: Sent DM

I have a doubtā€¦ This script only changes the source but do not plays that source. Or am i wrong?
Maybe do i need another service to play that selected source, or that service after choosing the source will also play it?

of course :slight_smile:

thank you!

Hello,

Iā€™m not sure if it was the new SONOS Card or the new HA Beta version core-2022.5.0b3 that caused it but I canā€™t get any SONOS card to display. I tried very basic ones and itā€™s just showing a blank page. when I paste my code in there, I donā€™t get any errors and it lets me save, the page is just blank on the dashboard. I started noticing it a few days ago which coincided with both releases. Iā€™m just now getting to dig in; Iā€™ve spent some time playing with it and I couldnā€™t get my card to show.

I stripped out my theme to eliminate that
I re-downloaded sonos card just to be sure
I entered numerous versions of cards
all display as a blank screen

Thereā€™s a breaking change in the HA beta where the old ā€œsonos_groupā€ attribute is now named the standard ā€œgroup_membersā€ like other media player integrations that support grouping.

Thanks for noticing. I wonā€™t have time for a while to fix it. Feel free to make a pull request though

I can totes do that now that weā€™ve confirmed the source of the issue. Thanks!

it appears somebody already beat me to it:

Fixed! Release v5.1.1 Ā· johanfrick/custom-sonos-card Ā· GitHub

1 Like

I underestimated how much I rely on this card now until I was without. I mean that as the highest of compliments. Definitely one of my most used dashboards.

Thanks, Iā€™ll do my best to try and find time to continue to support it :pray:

What would be really cool is if you only had 1 entity that the ā€˜Groupsā€™ could be configured to not be shownā€¦ :wink:

Currently Iā€™m doing it like this:

 groups:
            order: 2
            display: none

Is there an example css of how to make the player show on the left and the ā€˜favoritesā€™ on the right?

Thanks!

For ordering:

type: custom:custom-sonos-card
styles:
  player:
    order: 0
  groups:
    order: 1
  media-browser:
    order: 2

For hiding the group your method works fine, feel free to make a feature request in github though :slight_smile:


PunxaPhil - I like coffee :slightly_smiling_face:

1 Like

Love this card but styling isnā€™t my strong suit ā€¦this is the look Iā€™d like but cannot seem to get it there.

a3a864a2b1a05001a5e23f9609cd463aec015c3b_2_690x399

Not sure how to get this styling or where it goes exactlyā€¦ suggestions?

1 Like

Yes the same itā€™s beautiful but i donā€™t Know how to do that lol

1 Like