Replies: 2 comments
|
I didn't even know about a way to use free spotify on sonos speakers. Always assumed you would need premium for that. for your I think the sonos player does not load any information about a sonos playlist if you add something to the queue. I think the mobile app does that work instead and sends it to the sonos speaker when it wants to play a song. |
|
Hi @svrooij, Thanks for the quick reply and the suggestions. I appreciate the pointers towards the AddUriToQueue source and the external music services documentation for building the metadata. After reviewing, I've decided to stick with our current Interestingly, we have seen other third-party hardware integrations like Logic Machine that are able to handle this. When playing a Spotify playlist, SONOS app correctly displays the playlist name and manages playback without requiring a Premium account. This suggests there might be another UPnP method to start playlist playback (perhaps not using AddUriToQueue or SetAVTransportURI?) that mimics the official app's behavior more closely. Since this seems to be a common challenge, if anyone in the community discovers a way to achieve this using this library, I'd be very grateful if you'd share your findings in this thread. Thanks again for your time and for maintaining this great library! |
Uh oh!
There was an error while loading. Please reload this page.
Hello everyone,
I'm working on a project to control Sonos devices and I'm running into an issue specifically with playing Spotify playlists (e.g.,
spotify:playlist:...).My primary goal is to play these playlists in a way that:
Correctly loads the playlist metadata (like the playlist name).
Works for users with Spotify Free accounts.
What I've Tried
Method 1: Direct
SetAVTransportURIMy first attempt was to use
device.SetAVTransportURI(uriToPlay). However, this method consistently fails when used with a Spotify playlist URI (I often receive UPnP errors like 714 or 804).Method 2: Fallback to
_playItemOnQueueAs a fallback, I am using a function to clear the queue and add the playlist URI to it. This is the function I'm currently using:
The Problem
This
_playItemOnQueuemethod works for Premium accounts, but it has two major downsides that I'm trying to solve:Missing Metadata: When the playlist starts playing, the Sonos app (and device events) do not show the playlist name. It just shows the name of the first track.
Requires Spotify Premium: This method fails entirely for Spotify Free accounts. It returns a UPnP Error 804, because free accounts are not permitted to manipulate the queue (
AddUriToQueuefails).My Question
Is there another method in the library to play a Spotify playlist that avoids using the queue?
Ideally, I'm looking for a way to start playback just as if the user had selected the playlist from their favorites in the Sonos app itself, which (as far as I can tell) does load the correct metadata and does work with Spotify Free accounts.
Thanks for any insights you can provide!
All reactions