Sonos Favorites

Is it possible to retrieve Sonos Favorites using auto-entities?

While I’ve never used auto-entites and have no idea what it is you are looking to accomplish, whatever it is I don’t see any need for auto-entities. auto-entities is for automatically populating a card with entities based on various filtering criteria. But Sonos Favorites is always just the same one known entity, hence there is nothing for auto-entities to add to the process.

I’m looking to dynamically list all my Sonos favorites in Home Assistant. In OpenHAB, I was able to achieve this easily using the ‘Favorite’ channel, which displayed all my Sonos favorites and allowed me to create a custom page to showcase them.

I found references in the forums to a service called media_player.browse_media, which seems to offer similar functionality. However, I’m unable to locate it in the latest version of Home Assistant. Was this service removed, or am I missing something? Any guidance would be greatly appreciated!

This is how the service would be used If I was able to find media_player.browse_media:

service: media_player.browse_media
data:
  entity_id: media_player.living_room

The Sonos integration provides an optional sensor entity that lists all favorites. (sensor.sonos_favorites)

Follow the instructions in the documentation to enable this optional sensor.

Sonos - Favorites Support Notes

The documentation also has examples of templates that can be used to select/extract information from the value of sensor.sonos_favorites.

FWIW, you can use the Markdown Card, with a suitable template, to display the sensor’s information.

Thanks again Taras. I just found the sensor you’re talking about! I also found another way to list my sonos favorites using the HACS sonos-card. There’s a way just to isolate favorites and display them with album covers/titles. The end game will be to use the sensor you recommended so thank you for that. Here is the code for those of you who want to use sonos-card to retrieve your Sonos favorites:

type: custom:sonos-card
entities:
  - media_player.green_room_sonos
sections:
  - media browser
startSection: media browser
hidePlayerControlNextTrackButton: true
widthPercentage: 170
heightPercentage: 90
favoritesItemsPerRow: 4
topFavorites:
  - ""
sortFavoritesByType: true
hideBrowseMediaButton: true
mediaBrowserTitle: Sonos Favorites
favoritesHideTitleForThumbnailIcons: false
card_mod:
  style: |
    ha-card {
      background: none !important;
      border: none !important; 
    }
1 Like