node-sonos-http-api
node-sonos-http-api copied to clipboard
Playpause not working via NFC
I'm using NFC cards to play Spotify on my Sonos. I have a number of playlists, albums, etc set up. I recently made a "Playpause" NFC card so that I can play/pause music without having to go into the app. For some reason, the code when sent via NFC just stops the current playlist and clears the queue, rather than pausing it as it should. I've tested the code in a browser on the network and it works correctly then... it just doesn't work when sent via NFC for some reason. Any suggestions!?
Thanks
How do you handle the calls to node-sonos-http-api?
Maybe you have defaulted to always clear queue on each call? I use a flag to know if I should clear the queue or not.
Roughly like this
list = {
rfidkey1: { url: xxxx, clearQueue: true },
rfidkey2: { url: http://localhost:5005/living%20room/playpause, clearQueue: false }
}
command = list[rfidkey]
if(command.clearQueue) {
// Clear queue
}
// Do url call
I don't know if this will solve your issue, but you might find this project which uses NFC tags and this api (and does work with playpause) useful:
https://github.com/hankhank10/vinylemulator
Fixed it now....
For some reason spotify:playpause does not work
However, command:playpause does!