hklages / node-red-contrib-sonos-plus

A set of Node-RED nodes to control SONOS player in your local network.
MIT License
75 stars 14 forks source link

Queue URI Spotify not working (group.queue.urispotify:Sonos error on AddURIToQueue UPnPError 800) #271

Closed gerdschadler closed 9 months ago

gerdschadler commented 9 months ago

Description

When trying to queue a Spotify URI I always get an error ((group.queue.urispotify:Sonos error on AddURIToQueue UPnPError 800)). I did change Region as described in the documentation. No luck.

Did also go thru the following issues: #263 and #142

When using this flow I can play Sporify URIs: (The only issue is, that the tracks/album is not added to the queue.)

image

Output: uri: "x-rincon-cpcontainer:1004206cspotify%3aalbum%3a6gificznvuk0ddZK9dmv3T?sid=12&flags=8300&sn=1" metadata: "<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="1004206cspotify%3aalbum%3a6gificznvuk0ddZK9dmv3T" parentID="" restricted="true"><dc:title></dc:title><upnp:class>object.container.album.musicAlbum</upnp:class><desc id="cdudn" nameSpace="urn:schemas-rinconnetworks-com:metadata-1-0/">SA_RINCON3079_X_#Svc3079-0-Token</desc></item></DIDL-Lite>" queue: true

Error: "group.queue.urispotify:Sonos error on AddURIToQueue UPnPError 800 (Command not supported or not a coordinator) :: Details: {"stack":"SonosError: Sonos error on AddURIToQueue UPnPError 800 (Command not supported or not a coordinator)\n at AVTransportService.handleErrorResponse (/data/node_modules/node-red-contrib-sonos-plus/node_modules/@svrooij/sonos/lib/services/base-service.js:243:23)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at async AVTransportService.handleRequestAndParseResponse (/data/node_modules/node-red-contrib-sonos-plus/node_modules/@svrooij/sonos/lib/services/base-service.js:216:15)\n at async AVTransportService.SoapRequestWithBody (/data/node_modules/node-red-contrib-sonos-plus/node_modules/@svrooij/sonos/lib/services/base-service.js:106:16)\n at async AVTransportService.AddURIToQueue (/data/node_modules/node-red-contrib-sonos-plus/node_modules/@svrooij/sonos/lib/services/av-transport.servi..."

What node/command (topic)/state (payload)

node: Universal command: group.queue.urispotify state:

In case of a bug: Are you able to reproduce the error

yes

Versions and Infrastructure

what system: Docker on NUC node-red-contrib-sonos-plus version: 6.7.3 Node-RED version: 3.1.0 NodeJS version: v16.20.2

hklages commented 9 months ago

For Swiss the European region should work and that is the default. So you don't need to specify a region.

When using this flow I can play Sporify URIs:

What region do you use for that flow?

gerdschadler commented 9 months ago

For Swiss the European region should work and that is the default. So you don't need to specify a region.

When using this flow I can play Sporify URIs:

What region do you use for that flow?

I impored the flow and did not change anything - so it should be US.

{
    "uri": "x-rincon-cpcontainer:1004206cspotify%3a{{payload}}?sid=12&amp;flags=8300&amp;sn=1",
    "metadata": "&lt;DIDL-Lite xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:upnp=&quot;urn:schemas-upnp-org:metadata-1-0/upnp/&quot; xmlns:r=&quot;urn:schemas-rinconnetworks-com:metadata-1-0/&quot; xmlns=&quot;urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/&quot;&gt;&lt;item id=&quot;1004206cspotify%3aalbum%3a{{payload}}&quot; parentID=&quot;&quot; restricted=&quot;true&quot;&gt;&lt;dc:title&gt;&lt;/dc:title&gt;&lt;upnp:class&gt;object.container.album.musicAlbum&lt;/upnp:class&gt;&lt;desc id=&quot;cdudn&quot; nameSpace=&quot;urn:schemas-rinconnetworks-com:metadata-1-0/&quot;&gt;SA_RINCON3079_X_#Svc3079-0-Token&lt;/desc&gt;&lt;/item&gt;&lt;/DIDL-Lite&gt;",
    "queue": true
}
hklages commented 9 months ago

That's a bit strange but maybe you have a special account and that is bind to region US. I agree - it should be US.

  1. queue

The only issue is, that the tracks/album is not added to the queue

Please explain what you mean. How can you play an album without using the queue or do you mean that the original content is cleared (what is the default) and only the new spotify album is shown. You can see the current content of the queue in the SONOS app or by using group.get.queue. Please ensure that you use the same player (and for this test dont group them)

  1. Are you able to edit file in the NUC Docker container? Maybe with nano or vi. if yes: Make a backup of settings.js. Then to switch to region US (that also works in Australia, New Zealand) put the following line
    process.env.SONOS_REGION_SPOTIFY = "3079"

    at the top (before module.exports) of your settings.js file in your user node-red directory and restart the container.

gerdschadler commented 9 months ago
  1. queue

The only issue is, that the tracks/album is not added to the queue

Please explain what you mean. How can you play an album without using the queue or do you mean that the original content is cleared (what is the default) and only the new spotify album is shown. You can see the current content of the queue in the SONOS app or by using group.get.queue. Please ensure that you use the same player (and for this test dont group them)

But how to add a track to a Radio (started from a song) - queue seems not to be in use. So added items will not play.

  1. Region
  1. Are you able to edit file in the NUC Docker container? Maybe with nano or vi. if yes: Make a backup of settings.js. Then to switch to region US (that also works in Australia, New Zealand) put the following line
process.env.SONOS_REGION_SPOTIFY = "3079"

at the top (before module.exports) of your settings.js file in your user node-red directory and restart the container.

This is my bad. I did change the settings.js, but on the wrong instrance of node-red, so it did not work. But anyhow, how does this work? Need both accounts to be in the same Region (they should be both in EUROPE). It works now with the settings.js changed as above.

Thank you for your support and please excuse my inattention.

hklages commented 9 months ago

Ganz verstehe ich nicht was du meinst - liegt wahrscheinlich daran, dass wir beide nicht English native sind. Geht auch Deutsch?

both accounts?

Welche Accounts meinst du?

This is my bad. I did change the settings.js, but on the wrong instrance of node-red, so it did not work.

Das passiert mir leider auch oft. Wichtig ist, dass es am Ende läuft.

But how to add a track to a Radio (started from a song) - queue seems not to be in use. So added items will not play.

Da bin ich mir nicht sicher, ob das funktioniert. Es könnte sein, dass Spotify einen Stream erzeugt und einfach nur das gerade aktuelle Lied "sendet". Und Sonos kann entweder eine Stream spielen oder die Queue - beides zusammen geht nicht.

gerdschadler commented 9 months ago

Hallo - geht auch Deutsch. Mit "both accounts" meine ich, ob Spotify und SONOS in der selben Region sein müssen. Ganz ehrlich gesagt, verstehe ich das mit den Regionen nicht ganz. Spotify, sowohl als auch SONOS (wahr früher mal mit Land US registiert, wurde aber vor längerem geändert) sind in Liechtenstein registriert.

Das mit der Queue ist wie es ist. ;-)

Danke für die schnelle und freundliche Hilfe!

hklages commented 9 months ago

Gern geschehen und Danke für den Capuccino!

Der SONOS account scheint keinen Einfluss zu haben. Aber es gibt ein paar user, die umgezogen sind und dann die Region des ursprünglichen Accounts nutzen mussten.