jishi / node-sonos-http-api

An HTTP API bridge for Sonos easing automation. Hostable on any node.js capable device, like a raspberry pi or similar.
http://jishi.github.io/node-sonos-http-api/
MIT License
1.83k stars 462 forks source link

Play Spotify playlist within a preset #856

Closed marco79cgn closed 1 year ago

marco79cgn commented 1 year ago

I'm trying to play a Spotify playlist (not a Sonos playlist) within a preset. I have no problems to start the playlist with this url: http://192.168.178.10:5005/schlafzimmer/spotify/now/spotify:user:spotify:playlist:39Z0D9htQACsHn513oHk9X

But how can I involve this playlist from within a preset? I tried dozens of different possible solutions but none of them worked. Something like

{
    "players": [
            { "roomName": "Küche", "volume": 25},
            { "roomName": "Arbeitszimmer", "volume": 20},
            { "roomName": "Wohnzimmer", "volume": 20},
            { "roomName": "Bad", "volume": 20}
    ],
    "playMode": {
            "shuffle": true
    },
    "pauseOthers": true,
    "uri": "x-sonos-spotify:spotify%3auser%3aspotify%3aplaylist%3a39Z0D9htQACsHn513oHk9X"
}

Any help appreciated.

jishi commented 1 year ago

Unfortunately I don't think this is supported, I don't remember fixing this issue: https://github.com/jishi/node-sonos-http-api/issues/510

If you can chain two calls, you can make it work (just send that spotify url to any player in your preset), but I understand that it isn't ideal.

marco79cgn commented 1 year ago

Ah, alright, no problem. As a workaround, I just saved this Spotify playlist as a favorite. Thanks!