We have moved at community.getvera.com

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

Offline Hardly Matters

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Sonos plugin and Pandora
« on: November 27, 2012, 10:49:20 pm »
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

6. 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.
« Last Edit: June 08, 2014, 05:15:19 am by lolodomo »

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 #1 on: November 28, 2012, 02:32:19 am »
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

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos plugin - Configuring with Pandora
« Reply #2 on: November 28, 2012, 05:59:22 am »
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 ?

Offline Hardly Matters

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: Sonos plugin - Configuring with Pandora
« Reply #3 on: November 28, 2012, 07:33:24 am »
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.

Offline big517

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 576
  • Karma: +1/-4
Re: Sonos plugin - Configuring with Pandora
« Reply #4 on: November 28, 2012, 08:21:36 am »
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



 2


Offline Hardly Matters

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: Sonos plugin - Configuring with Pandora
« Reply #5 on: November 28, 2012, 10:44:40 am »
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.

Offline Hardly Matters

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: Sonos plugin - Configuring with Pandora
« Reply #6 on: November 28, 2012, 01:33:19 pm »
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.
« Last Edit: November 28, 2012, 01:59:42 pm by Hardly Matters »

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos plugin - Configuring with Pandora
« Reply #7 on: November 28, 2012, 04:44:55 pm »
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.

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

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos plugin - Configuring with Pandora
« Reply #8 on: November 28, 2012, 04:59:40 pm »
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.

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.

Quote
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 ?

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

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

Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos plugin - Configuring with Pandora
« Reply #9 on: November 28, 2012, 05:04:12 pm »
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.

Can someone provide the URLs ?

Offline Hardly Matters

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: Sonos plugin - Configuring with Pandora
« Reply #10 on: November 28, 2012, 09:06:10 pm »
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.

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

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.

Offline Hardly Matters

  • Newbie
  • *
  • Posts: 17
  • Karma: +0/-0
Re: Sonos plugin - Configuring with Pandora
« Reply #11 on: November 29, 2012, 01:10:25 pm »
Quote
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
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.


Offline lolodomo

  • Moderator
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: Sonos plugin - Configuring with Pandora
« Reply #12 on: November 29, 2012, 05:17:03 pm »
Quote
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.

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.

Quote
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 !

Quote
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.

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 #13 on: November 30, 2012, 12:35:36 am »
@lolodomo,
I put a fix into trunk that makes the CurrentAlbumArt [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 url.absolute() call to prefix when needed.

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 #14 on: November 30, 2012, 12:38:23 am »
a picture, a 1000 words and all that ;)