Sonos plugin and Pandora

FORGET THIS ORIGINAL POST. UPDATED INFO ON POST #18 OF THIS THREAD.

Noob to the forum.

First, just want to say a huge thanks for all of the work you guys did (and continue to do) on this plugin. It’s incredible. I now have a bunch of my favorite pandora stations set up a individual buttons on my SQ Remote. I just press the button for whatever I want to here and SQ Remote triggers the scene in Vera. It works great.

I read this entire thread and it seems like there is a still a little confusion on how to get the pandora station information. In the early part of this thread, someone posted a link to a program that can be used to query pandora to pull up the information for your stations rather than trying to spy upnp. It’s a neat little program but doesn’t work on Macs (like I use). Anyway, for those that are still wondering how to do this, here is an easy way.

This assumes you already have the Sonos plugin installed and working.

  1. Use your desktop or phone Sonos controller and select and play one of your pandora stations.
  2. Open U15 (I hope the same for u14) and go to devices to see you Sonos Device. If you have more than one, go to the one that is playing and shows the info for the station you selected to play in step 1.
  3. Click the wrench and go to advanced.
  4. scroll down to AVTransport URI and you will see pndrradio:xxxxxxxxxxxxxxxx. The x’s are a bunch of numbers. You will only need the numbers.
  5. Open notepad or whatever text editor you use and paste this into it.

PSEL|Radio Station Name|xxxxxxxxxxxxxxxxxx|your@email.com

  1. In the Radio Station Name part, just type the name of the station. Then, copy the numbers from step 4 and paste them where the x’s are. Your email is your pandora username/email address.

It should look something like this when you are done.

PSEL|Frank Sinatra Radio|306031475234123390|youremail@email.com - This is what you copy and paste into PlayURI when setting up a scene to play a pandora station on Sonos.

Rinse and repeat for you other favorite stations.

Seems like a lot of steps, but it only takes a minute or two for each station you want to set up in scenes. I live in the US. I have no idea if this works elsewhere so hopefully it does.

Anyway, thanks again for the hard work on this great plugin.

Cool. Glad it’s working for you. Thanks for the write up here, I split out the post since it’ll likely be useful to many others that want to do the same… Eventually we can integrate it into to wiki doco

Can you confirm that Pandora information are correctly displayed in the device UI ?
You should see Pandora and the station name in the UI at the right of the picture.
Are all the information you got from a Sonos control application, including the picture, displayed on the UI ?

And can you confirm that Pandora radio station is correctly restored after calling Say ?

To the right of the picture, I see the Pandora station name, song name and artist. I don’t see anything that actually says Pandora. The only picture I see, (no matter if looking at the device or in the device settings) is the Sonos image. I do not see album artwork, just the Sonos image. Everything else is correct and what is displayed on the Sonos controller. I can upload a screen shot when I get home later today.

As for calling Say, I honestly don’t know how to use that yet. I followed the thread but it was over my head in a few places. I will have a little time today to experiment with that and will let you know. In theory, I understand what it does but I am not sure how to use it. Just to get everything working I kept it very simple. My goal was to press a button on the SQ Remote with the station name and have it play. That works perfectly. I set up the transport controls as well on the SQ so I can stop, play skip, volume up and down, etc. for each Sonos zone and all is good with that as well. So, mission accomplished with that part.

I’m so glad that you figured this out! I spent more than a few days digging through old archives and the cached content on overrun forums for information on this Pandora feature. I posted my random findings on the original thread hoping someone would figure it out and make use of it, I’m amazed to see you read through the entire forum and found that cryptic piece of information and made it work. This plugin spread like wildfire it was great to see talented people bringing a Sonos plugin to fruition. Its reasons like this that I chose the Vera over any other automation hardware. Keep up the good work I truly appreciate it

Sent from my SPH-D710 using Tapatalk 2

It was your posts that got me started looking for how to do the Pandora station info. If you look at the video from the guy who made pBrowse, you can see that is exactly where I got the Pandora station info from. I basically just copied one of his search results and overwrote his info with my own. At first, I tried using wireshark, but quickly realized I didn’t have a clue what I was doing. That video was the key to getting it figured out.

OK, this is interesting. I was going to see if the Pandora stations were restored correctly after using the “say” command. Unfortunately, everything that worked yesterday no longer works today. No matter what station I select (from a scene a made for each station) works anymore. It just plays what was already playing. For example, I made a holiday music station for my wife. If that was playing and I select a different station, it just restarts the holiday music station. I tested this for over 2 hours yesterday and everything worked. Not sure what happened overnight.

Maybe someone can tell me what I am doing wrong?
I went to Automation, New Scene, Advanced, picked one of my Sonos devices from the drop down, click add, select PlayURI from the drop down, then the string similar to this is pasted in the box. PSEL|Frank Sinatra Radio|306031475234123390|youremail@email.com. Named it Frank Sinatra Radio and saved the scene. I did this for 10 scenes yesterday and they all worked and I switched between them with no problems. Today, the stations don’t change, it just restarts whatever was playing before.

Interestingly enough, I made another scene as a test to select a TuneIn station and that worked fine. Just Pandora is having the issues today. Oh well, going to see if I can figure this out now.

Normally, your URI should start with x-sonosapi-stream:… or x-sonosapi-radio:… ?

On the first line, the one with the station name, you should see “Pandora” as label before the station name. What dou you see ? A blank label ?
Of course, you should use a very recent version of the plugin for that.

The only picture I see, (no matter if looking at the device or in the device settings) is the Sonos image. I do not see album artwork, just the Sonos image.

I imagine you get a picture when using a Sonos control application ? Is it the logo of the station ? Is it the album art of the playing song ?

Everything else is correct and what is displayed on the Sonos controller.

Perfect.
We could search how to get the album art.

Can someone provide the URLs ?

Normally, your URI should start with x-sonosapi-stream:… or x-sonosapi-radio:… ?[/quote]

I tried those as well. No luck. What is strange is that everything worked yesterday. I can get the TuneIn stations working properly but not Pandora. I have the latest Trunk version (71?).

Today turned out to be a lot busier for me than I thought it was going to be so I didn’t have a lot of time to play with it. I will get back to you tomorrow regarding the album art, etc.

As for the link that big517 originally posted, it is http://www.screencast.com/t/to34GwN5d.

On the first line, the one with the station name, you should see "Pandora" as label before the station name. What dou you see ? A blank label ? Of course, you should use a very recent version of the plugin for that.

I’m not exactly sure where you are talking about but if I look at the device, the text in the space right below the wrench shows the station name and part of the song that is playing (if it fits in the space). If I click the wrench and go to the control tab, it says, “Playing…The station name: The song name”. It does not say Pandora anywhere.

I imagine you get a picture when using a Sonos control application ? Is it the logo of the station ? Is it the album art of the playing song ?

On the Sonos control application, I see the album art of the song playing. On this plugin, it just an empty white box that shows up on the device settings/player tab.

I’m still trying to fix whatever I broke to get Pandora working again. In the meantime, I’ve made a bunch of scenes that use the TunedIn favorites and they work great. Thanks for the hard work on this plugin. It’s getting better all the time.

[quote=“Hardly Matters, post:12, topic:173421”]

On the first line, the one with the station name, you should see “Pandora” as label before the station name. What dou you see ? A blank label ?
Of course, you should use a very recent version of the plugin for that.

I’m not exactly sure where you are talking about but if I look at the device, the text in the space right below the wrench shows the station name and part of the song that is playing (if it fits in the space). If I click the wrench and go to the control tab, it says, “Playing…The station name: The song name”. It does not say Pandora anywhere.[/quote]

Maybe you have not the last version ? Because in the last versio, I believe that the service is displayed at the beginning of the label.
By the way, I was thinking about the Player tab.

On the Sonos control application, I see the album art of the song playing. On this plugin, it just an empty white box that shows up on the device settings/player tab.

That would require investiguations.
I assume there is not something specialte] to implement for all services !

I'm still trying to fix whatever I broke to get Pandora working again. In the meantime, I've made a bunch of scenes that use the TunedIn favorites and they work great. Thanks for the hard work on this plugin. It's getting better all the time.

IMHO, you should first check what contains the two varialbes URI and MetaDataURI (don’t remember the exact name) when Pandora radio is playing.

@lolodomo,
I put a fix into trunk that makes the [tt]CurrentAlbumArt[/tt] [derived] URI’s correct for Pandora content.

It looks like that service returns a fully-qualified (non-relative) URL, so we needed to avoid the prefix-concat in that case. I substituted the strcat with a [tt]url.absolute()[/tt] call to prefix when needed.

a picture, a 1000 words and all that :wink:

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 ?
Very interesting ... because you don't get what is expected !

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

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?

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.

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.

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

service: urn:upnp-org:serviceId:AVTransport variable: AVTransportURIMetaData
now: dc:title2 Many DJ's Radio</dc:title>upnp:classobject.item.audioItem.audioBroadcast</upnp:class>SA_RINCON3_email@test.com

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

- 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)

@Hardly Matters : InstanceID has to be set to “0” or leave it to blank

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

service: urn:upnp-org:serviceId:AVTransport variable: AVTransportURIMetaData
now: dc:title2 Many DJ's Radio</dc:title>upnp:classobject.item.audioItem.audioBroadcast</upnp:class>SA_RINCON3_email@test.com[/quote]

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 ?
SA_RINCON3_email@test.com

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.