SONOS presets for Spotify Playlists w/ WebCORE?

I’m trying to figure out a way to be able to play a pre-defined Spotify playlist with a click of a button. Using WebCORE, I can see the playpreset() command to pass to the Sonos speakers, and looking at the device from the api.smartthings page, I can see the various preset ids I have on my device. However, they’re all stations (Amazon Music, TuneIn, etc.), but none of the playlists show up. I have a set of Sonos Playlists as well, but I don’t see those anywhere, and I can’t figure out how to trigger a Sonos playlist.

there is a post on the webcore forum from two years ago… may or may not work at this point but give it a try…

Thanks for the quick reply. Not sure if something changed, but it doesn’t seem to work for me. Firstly, the data element of “trackURI” isn’t there anymore, but there is a URL to get album art, which references the trackURI. I decoded the URL and it looks very similar to the one in the thread you linked, however it doesn’t seem to work. There is no more setTrack command in webCORE, but there is a playTrack (which I believe is both set + play).

When I test the piston, there are no changes to the current track.

yes, I was wondering if the recent changes might have changed all that.

Unfortunately it looks like the SONOS integration with Smartthings got worse lately. I see references to setting up a Raspberry Pi to run JSON commands to the API, but I’m really trying to avoid setting up something like that. Just another cog in the HA setup that will need tending to.

Looking further, the data/elements available have changed between the old “LAN Sonos Player” and the new “LAN Sonos Player Websocket” device types (as seen on the ST API page).

  1. Open your playlist in the sonosapp and mark it as favourite.

  2. Open the smartthings ide account.smartthings.com and go to devices.

  3. Click on any sonosdevice. You will find the preset id that you can use in webcore.

2 Likes

Unfortunately it only seems that Stations use presets, not playlists. I got it to work with Amazon Music stations when saved as a Sonos station, but I can’t find where the Sonons playlists are accessible.

You have to mark your playlist as favourite in the sonosapp. Trust me it works.

1 Like

Interesting. I searched Spotify for a new Playlist and added it to My Sonos. This saved as a Spotify Playlist and did indeed work. However, my earlier playlists that I had already saved (which are listed as Sonos Playlists) don’t show up. Oh well, I’ll just delete / re-add whatever I need. Thanks Jepajo!

1 Like

Old thread. I’m trying to achieve the same, accessing a playlist as a preset. But I don’t get any playlists I have added to My Sonos as presets, only individual songs… Maybe this has got even worse since this thread?

Edit: I found out how to add a Spotify playlist to My Sonos after a lot of trial and error. And now it shows up as preset.

1 Like

Just a note to users: IDE and webcore are part of the legacy architecture. When ST ends support for groovy, IDE and webcore will cease.

Right. But as there seems to be no Edge driver yet, we have to use what’s available until Sonos makes an Edge driver available.