We have moved at community.getvera.com

Author Topic: Sonos plugin and Pandora  (Read 29905 times)

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos plugin - Configuring with Pandora
« Reply #15 on: November 30, 2012, 03:06:45 am »
Very interesting ... because you don't get what is expected !

Regarding Pandora, can you check please the value of the TransportAVURI variable ? I would prefer displaying "Pandora" with the dtation name rather the track number.
I imagine that "Pause" is not working ? Or equivalent to a "Stop" ?
Do you confirm that "Next" is working with Pandora ?


Now, more generally, your UI is missing a lot of things:
- Line-in: ok, we now know why (browse "AI:" not working for you)
- Sonos playlist: you did not defined any Sonos playlist ? Can you try to create one and check that it is then displayed in the UI and playable ?
- Queue: it is not normal that you have no queue list. Could it mean that your queue is not "Q:0" ? Can you play something in the queue from your Sonos control app and then check the TransportAvURI variable ? Can you check the variable "Queues' too ?
Do you have the same thing with your two Sonos units ?

Offline Hardly Matters

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: Sonos plugin - Configuring with Pandora
« Reply #16 on: November 30, 2012, 08:34:38 am »
Quote
Very interesting ... because you don't get what is expected !

The fix that Guessed made fixed my album art issue as well.

Quote
Regarding Pandora, can you check please the value of the TransportAVURI variable ? I would prefer displaying "Pandora" with the dtation name rather the track number.

I am not sure what to look for. In the box next to AVTransportURI it says "pndrradio:306048632324894325". Is that what you mean?

Quote
I imagine that "Pause" is not working ? Or equivalent to a "Stop" ?
Do you confirm that "Next" is working with Pandora ?

While playing Pandora, I can confirm that Pause and Stop do work, (pressing either pauses Sonos).
Next works perfectly also in Pandora.

Offline Hardly Matters

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: Sonos plugin - Configuring with Pandora
« Reply #17 on: November 30, 2012, 02:48:20 pm »
Forget everything I said when I made the original post. Thanks to Lolodomo advice on where to start looking, I finally figured out how to get Pandora stations working.

You'll need to go back and forth a few times between screens but here's the steps: Before starting this, use your sonos controller to get your desired Pandora station playing.

1. Go to Automation, New Scene, Name it whatever you want, Advanced, select your sonos device, add, select SetAVTransportURI.

2. In the InstanceID box, either leave blank or make it 0. Confirm changes.

3. Go back to the devices tab and select your sonos device. click wrench, and go to advanced. Scroll down and look for AVTransportURI. Copy the information in the AVTransportURI box. Click the X and go back to Automation and click on the wrench for your newly created scene. Go to Advanced and paste the AVTransportURI info in the CurrentURI box. Confirm changes.

4. This step is a little strange and is actually a couple of steps in one. Go back to the devices tab and select your sonos device. click wrench, and go to advanced. Scroll down and look for AVTransportURIMetaData. When I first did this, I had some information in the box and some outside of the box. First copy the information in the AVTransportURIMetaData. Click the X and go back to Automation and click on the wrench for your newly created scene. Go to Advanced and paste the AVTransportURIMetaData info in the CurrentURIMetaData box. Confirm changes. Go back to devices and copy the rest of the info that was outside of the AVTransportURIMetaData and paste it in the CurrentURIMetaData box after the part you already pasted in it previously.

5. While still in the automation/advanced section, select your sonos device from the drop down menu then add. From the drop down select "play". There is a couple of "plays" to select. The correct one is the one towards the bottom of the drop down list.

Now save it. When Vera is done being busy, run your scene and your Pandora station should start playing. I did this for several stations and they all work properly. I use SQ Remote so I just made a button for each scene. So, if I want to hear Norah Jones Radio, I just press the Norah Jones button on SQ Remote and Vera runs the scene and the station starts playing.

There is one issue that I want to mention.
After doing this, my sonos device no longer displays the station name for the Pandora Stations that I created a scene for. I am sure it has to do with the info I copied and pasted from the AVTransportURIMetaData section in the device/advanced tab because after running the scene, I no longer have info inside and outside of the box in that section. It's all inside now and no longer says "<DIDL-Lite xmlns:dc=". Now it just says "Norah Jones Radioobject.item.audioItem.audioBroadcastSA_RINCON3_myemailaddress@email.com" and it says the same thing in the CurrentURIMetadata section of the advanced automation. I don't know enough about this to figure out the problem but it works the way I want now so I can live without the station name showing up. None of this worked without copying and pasting the metadata info.
« Last Edit: December 01, 2012, 10:52:15 am by Hardly Matters »

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Sonos plugin - Configuring with Pandora
« Reply #18 on: December 01, 2012, 01:20:13 am »
Regarding Pandora, can you check please the value of the TransportAVURI variable ? I would prefer displaying "Pandora" with the dtation name rather the track number.

service: urn:upnp-org:serviceId:AVTransport variable: AVTransportURI
now: pndrradio:182361620768786761388

service: urn:upnp-org:serviceId:AVTransport variable: AVTransportURIMetaData
now: <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="OOOX182361620768786761388" parentID="0" restricted="true"><dc:title>2 Many DJ&apos;s Radio</dc:title><upnp:class>object.item.audioItem.audioBroadcast</upnp:class><desc id="cdudn" nameSpace="urn:schemas-rinconnetworks-com:metadata-1-0/">SA_RINCON3_email@test.com</desc></item></DIDL-Lite>

service: urn:upnp-org:serviceId:AVTransport variable: CurrentTrackURI
now: pndrradio-http://audio-dc6-t3-2.pandora.com/acc...


Quote
- Sonos playlist: you did not defined any Sonos playlist ? Can you try to create one and check that it is then displayed in the UI and playable ?
- Queue: it is not normal that you have no queue list. Could it mean that your queue is not "Q:0" ? Can you play something in the queue from your Sonos control app and then check the TransportAvURI variable ? Can you check the variable "Queues' too ?
Do you have the same thing with your two Sonos units ?
I have no Sonos queues.  All my queues are managed/imported under Music from iTunes, so no need to manage them here.  My MP3 collection is offline to my Sonos's at the moment as I've shifted machines (and can't fix my File SMB access perms for some reason)

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos plugin - Configuring with Pandora
« Reply #19 on: December 01, 2012, 04:29:56 am »
@Hardly Matters : InstanceID has to be set to "0" or leave it to blank

Regarding Pandora, can you check please the value of the TransportAVURI variable ? I would prefer displaying "Pandora" with the dtation name rather the track number.

service: urn:upnp-org:serviceId:AVTransport variable: AVTransportURI
now: pndrradio:182361620768786761388

service: urn:upnp-org:serviceId:AVTransport variable: AVTransportURIMetaData
now: <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="OOOX182361620768786761388" parentID="0" restricted="true"><dc:title>2 Many DJ&apos;s Radio</dc:title><upnp:class>object.item.audioItem.audioBroadcast</upnp:class><desc id="cdudn" nameSpace="urn:schemas-rinconnetworks-com:metadata-1-0/">SA_RINCON3_email@test.com</desc></item></DIDL-Lite>

Ok, thank you.
I have to make few little changes to display the radio station name. The Pandora service id is nowhere, so I will consider "pndrradio".

Regarding the AVTransportURIMetaData, I can generate it like I did for TuneIn, meaning you will not have to fill it. But I don't know yet if I can get your email address (account) through a UPnP call. So either I find it or we define a variable for that ?

Could you please try to play Pandora using this simplified metadata URI ?
<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><desc>SA_RINCON3_email@test.com</desc></item></DIDL-Lite>

And could you check please that it works with SA_RINCON3_email@test.com on your your two Sonos units. I hope that RINCON3 is not for Play:3 only.
« Last Edit: December 01, 2012, 04:45:29 am by lolodomo »

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos plugin - Configuring with Pandora
« Reply #20 on: December 01, 2012, 05:08:53 am »
I just committed the little changes for Pandora. Please check and tell me if now Pandora and the station name appear at the beginning of the label on the dashboard and in the Player tab.

Remains to change PlayURI to generate the metadata URI ... if you confirm that it works with my simplified metadata.

Offline Hardly Matters

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: Sonos plugin - Configuring with Pandora
« Reply #21 on: December 01, 2012, 10:47:00 am »
I just committed the little changes for Pandora. Please check and tell me if now Pandora and the station name appear at the beginning of the label on the dashboard and in the Player tab.

I can confirm that the Pandora station name is now showing up in both places. It says Pandora: Station Name.

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Sonos plugin - Configuring with Pandora
« Reply #22 on: December 01, 2012, 02:52:47 pm »
@lolodomo,
I tested the URIMetaData programatically, using the code snippet below, and it works correctly against both the Play5 and the Connect.  I imagine the same construct in declarative scenes would work also...

Code: [Select]
local params = {CurrentURI="pndrradio:19203278673133", CurrentURIMetaData='<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><desc>SA_RINCON3_test@test.com</desc></item></DIDL-Lite>'}

luup.call_action("urn:upnp-org:serviceId:AVTransport", "SetAVTransportURI", params, 666)
luup.call_action("urn:upnp-org:serviceId:AVTransport", "Play", {}, 666)

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos plugin - Configuring with Pandora
« Reply #23 on: December 02, 2012, 01:24:09 pm »
Ok, so I can update the PlayURI callback to generate the medata. But how to manage the Pandora email/account ? I create a new variable to let the user fill in ?

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Sonos plugin - Configuring with Pandora
« Reply #24 on: December 02, 2012, 01:33:27 pm »
What's not clear to me is how many of these we're going to see, across all the different potential services.  We're focussing on Pandora, but there will likely be others.

If we're not careful, we could have an explosion of parameters for various stuff, would be undesirable.

For now, I'd recommend people use the "coded" (Lua) scene script I reference above.  It's not as nice, but it'll make do until we have more information on what's really needed (esp with DIDL's)

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos plugin - Configuring with Pandora
« Reply #25 on: December 02, 2012, 02:02:35 pm »
What's not clear to me is how many of these we're going to see, across all the different potential services.  We're focussing on Pandora, but there will likely be others.

You're right.

I just checked with AUPEO! and the desc value is SA_RINCON2055_<AUPEO account>
So for all services, I think the value for desc tag is something like SA_RINCON<id>_<account>. The only thing is how to determine this <id> ?
For the account I am sure that it is possible to get it through UPnP functions. It might be through function in the SystemProperties as I see things relative to accounts. But I don't find an obvious call to get this information. A spy of the network would probably help to understand.

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Sonos plugin - Configuring with Pandora
« Reply #26 on: December 02, 2012, 05:11:07 pm »
It might be simpler to augment PlayURI to take the same CurrentURIMetaData argument as the underlying SetAVTransportURI call.

If not specified, it can default to what you're already doing - attempt to derive it for the URI.

But if it is specified, it can be passed through "as is" to the target Sonos.

If you do this, then people can specify it directly in the Scene creation UI, and we can cutdown on the steps needed if done through Lua.


In addition to this, to make it easier for people to know what to set, a new "Scenes" tab could be built that would display/show the needed Luup code, or declarative config settings, to put the currently running thing into a scene.

We can't create the scene directly (without hacks) but we could certainly show them the values they need to enter so that Copy-n-Paste would be possible.

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos plugin - Configuring with Pandora
« Reply #27 on: December 03, 2012, 01:53:25 pm »
It might be simpler to augment PlayURI to take the same CurrentURIMetaData argument as the underlying SetAVTransportURI call.

If not specified, it can default to what you're already doing - attempt to derive it for the URI.

But if it is specified, it can be passed through "as is" to the target Sonos.

If you do this, then people can specify it directly in the Scene creation UI, and we can cutdown on the steps needed if done through Lua.

That was my idea too, even if the main idea was to keep PlayURI as simple as possible for the users.


Quote
In addition to this, to make it easier for people to know what to set, a new "Scenes" tab could be built that would display/show the needed Luup code, or declarative config settings, to put the currently running thing into a scene.

We can't create the scene directly (without hacks) but we could certainly show them the values they need to enter so that Copy-n-Paste would be possible.

That's a very good idea.

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos plugin - Configuring with Pandora
« Reply #28 on: December 04, 2012, 06:20:17 pm »
Ok, I know how to manage that. I will store in a state variable the list of Sonos services with the service id, the name and the value SA_RINCONxxx_account. Doing that, then I can easily retrieve this value when I need it.

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos plugin - Configuring with Pandora
« Reply #29 on: December 05, 2012, 01:39:10 pm »
http://192.xx.xx.xx:1400/status/securesettings
This page gives information on accounts but without obvious link to a service.