Sonos integration - Favorites - Identify source type/origin

I’m currently using a prefixed asterix character on all my playlists in order to seperate playlists from radio stations in the sensor.sonos.favorites attributes. I also use a pipe character as suffix on some radio stations, in order to identify which stations should have their title/artist flipped. Not the most elegant solution, but unfortunately Sonos app won’t allow a whitespace as suffix character (it will be deleted by the app)

items:
FV:2/38: ‘*HT’
FV:2/66: ‘*HT new’
FV:2/44: ‘*New Music Friday Denmark’
FV:2/47: ‘*The Ultimate Hit Mix’
FV:2/49: Classic FM
FV:2/54: Classic Rock|
FV:2/63: DR Nyheder
FV:2/28: DR P1
FV:2/25: DR P3
FV:2/68: DR P4 Fyn
FV:2/51: DR P5
FV:2/3: DR P6 Beat
FV:2/64: Nova FM|
FV:2/60: Radio 100|
FV:2/59: Radio Soft|
FV:2/58: Radio VLR
FV:2/52: Retro Radio
FV:2/50: Skala.fm
FV:2/62: The Voice|

As Sonos always presents the favorites list alphabetically sorted, this method ensures that all my playlists are indexed first followed by my radio stations. Today I use quite a few templates to filter the favorites list into two seperate dropdown menus in my openHASP device Sonos player.

I hoped that the items list could somehow be used for this filtering, but can’t really find any ‘red thread’ in the items list number sequence.

Is it possible to access the same data as the HA ‘standard’ media player, as it identifies and splits sources into these categories ?

Is it possible to access any additional meta data regarding the source origin as well (TuneIn station, Spotify playlist etc.) ?

Yes, you can use the ws api. I’m using that in my Sonos card: custom-sonos-card/hass-service.ts at 6cedb839d30aa1fd5a5f2480d148b8574f2ecc92 · johanfrick/custom-sonos-card · GitHub

Thank you for the reply :slightly_smiling_face:
Unfortunately I don’t have the programming skills needed in order to write a script utilizing this API.

Perhaps the Sonos integration in future will be enhanced with extended meta data details.