Using Spotify through Node Red

I’m having trouble finding examples, or getting the function node to supply the correct information for just simple things like specifying a playlist too.

Would you mind posting how you managed to do play pause, etc. and transfer my playback, please?

Edit: OK, I found another post with more examples: Spotify node-red interface

You an get the deviceids by sending a string of ‘true’ to get my devices, then looking at the debug console.

Then as above, use a function node with:

msg.params = [
    ['85202189a6blablsca22818c7383'],
    { play: true }
];
return msg;

@sender

msg.params = [ "3XubkIrRsDkykhyRsr8" ]; return msg;

in the function node for ‘getPlaylist’ returns my playlist in an array, but doesn’t play that playlist.

The same works for getPlaylistTracks

You can find the Spotifyid of the playlist by clicking on the 3 dots next to your playlist, then share, then copy spotify URI

Edit: Ok, you need to use play, rather than getPlaylist, and put this in the function node replacing your playlist uri

msg.params = [ {context_uri: "spotify:playlist:3XubktkkgujSVzMRsr8"} ]; return msg;

For setShuffle you need:

msg.params = [ "true" ]; return msg;

where true is to turn on shuffle. That’s probably enough edits for one post today. :slight_smile: Hope it helps.