Sonos playlists/favourites

Hi community,

Would love if there was an option in the Sonos component to be able to select a playlist or select something from Sonos favourites to play - even if just a dropdown list or something to choose from. I haven’t seen the other media player components as to what is possible within the base component.

I’m surprised not to see a feature request for it :slight_smile:

In the meantime someone builds native functionality, please see my config for a solution:

The base is this python script, which is run by cron:
https://raw.githubusercontent.com/ggravlingen/home-assistant/master/extraconfig/python_code/sonos_playlists.py

It creates shell commands and select lists. The last bit is found in the automation folder.

1 Like

This only just became possible in the Sonos Python library. Said library will soon make it in to HASS. After that, I was thinking of looking in to adding favorites selection to the HASS GUI, but I haven’t even started looking for where to start. Suggestions welcome.

Can you give a bit more detail on what you’re doing here?

The principle is that the nodejs-app publishes the playlists in a URL in json-format. The python-script accesses that URL, parses the json and writes the lists as an input select for home assistant. The select list can then be put as a regular component in home assistant.

The automation script reacts when you select something in the list by running a shell command that starts the playlist through the nodejs-interface.

Has anyone had any luck getting this functionality working easily?

1 Like

Edited: Bah, didn’t realize your post was so old

Can you be more specific?

If you define favorites in the Sonos system, HASS will pick them up and let you choose them under the ... menu.

1 Like