Sonos Plugin Setup

Posted on
Thu Apr 11, 2013 12:17 pm
wideglidejrp offline
User avatar
Posts: 555
Joined: Jan 15, 2012
Location: Danbury, CT

Sonos Plugin Setup

First of all, thank you very much for developing the plugin. I too like the Sonos and look forward to being able to control it with Indigo. I installed the plugin (0.57) with Indigo 6.0.0.b7. I get a lot of red errors when trying to use it. I suspect it is my setup that may be in error. A few questions:

1. For Reference Zone Player IP, does it matter which one? I have a zone bridge, two zone players, and the new play bar. Each has an IP.

2. What is the checkbox for Poll Direct?

3. What is a typical polling interval?

4. The Pandora option asks for a user id and an email. My user id is my email. Isn't the password needed?

5. SiriuxXM does not require an id and password?

Sorry for so many questions, but I could not find any documentation.

John R Patrick
Author of
Home Attitude

Posted on
Thu Apr 11, 2013 3:31 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos Plugin Setup

Hello wideglidejrp. You have exposed one part of the plugin process I've never gotten to which is creating one bit of documentation. Some day... but not today. Let me try to answer your questions:

1. I would use the IP address of one of the zone players. I am not sure about the new play bar, but know that you cannot use a zone bridge. You should not define the zone bridge in Indigo at all. That's really a passive device from a control perspective.

2. The checkbox for Poll Direct will tell the plougin that you actually want to query each configured zone player for updated statistics. I do not use upnp broadcasts, so unfortunately have to poll devices.

3. I keep my polling interval at 1 second and it works great, however I only have two devices. You can start there and step it up if there are any issues.

4. You do not need the password, but need to mark your Pandora profile as public on the site. I have no way of pulling Pandora playlists through the Sonos so go directly to the site. Pandora does not release a clean API, so the password would not be helpful. It is possible that your userid is not your full email address. You can check that by viewing your playlist on the Pandora site.

5. I've only stried SiriusXM with a trial account and did not need the password. Let me know how it works for you.

Hope this helps. I'm happy to answer any other questions you have. If you still have red errors, post that portion of the log and I will try my best to help.

Posted on
Fri Apr 12, 2013 10:02 am
wideglidejrp offline
User avatar
Posts: 555
Joined: Jan 15, 2012
Location: Danbury, CT

Re: Sonos Plugin Setup

Thank you for the quick reply. Here is what I have learned.
1. I set IP to one of my zone players as suggested. Polling is checked and set at 1
2. You are right that there is a Pandora userid. I was not even aware of it. It is not used for logging in.

After making these changes, here is the log of errors. I would appreciate any clues as to next steps to get this working.


Sonos Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 51, in runConcurrentThread
File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 82, in runConcurrentThread
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/os.py", line 164, in makedirs
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/os.py", line 171, in makedirs
<type 'exceptions.OSError'>: [Errno 13] Permission denied: '/Library/Application Support/Perceptive Automation/images'

Sonos Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
Action Group Sonos - Off
Sonos Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 82, in actionStop
File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 555, in actionDirect
<type 'exceptions.KeyError'>: key not found in database

Sonos Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 51, in runConcurrentThread
File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 82, in runConcurrentThread
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/os.py", line 164, in makedirs
File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/os.py", line 171, in makedirs
<type 'exceptions.OSError'>: [Errno 13] Permission denied: '/Library/Application Support/Perceptive Automation/images'

Sonos Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)

John R Patrick
Author of
Home Attitude

Posted on
Fri Apr 12, 2013 1:39 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos Plugin Setup

The plugin is trying to write in the main Perceptive Automation directory: /Library/Application Support/Perceptive Automation. It looks like permissions are denied. Are you running Indigo as an administrative user on the machine? That is likely the problem. I think you can get around this by manually creating an images subdirectory under the main directory above and permissioning write access to others to it.

try this first:
mkdir "/Library/Application Support/Perceptive Automation/images"

Posted on
Fri Apr 12, 2013 6:01 pm
wideglidejrp offline
User avatar
Posts: 555
Joined: Jan 15, 2012
Location: Danbury, CT

Sonos Plugin Setup

I can see that you are right that there is a permissions problem of some kind. I reinstalled Indigo 6.0.0.b7, but I see that there is no Perceptive Automation folder in the application support folder in the library. I tried the mkdir command you provided but got an error saying there was a permissions problem. I do not know how to resolve this. Your assistance is greatly appreciated.

John R Patrick
Author of
Home Attitude

Posted on
Sat Apr 13, 2013 8:48 am
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos Plugin Setup

There are two Library directories - one in the root and one under your home directory. If you can open a terminal screen and try a variant of the command, I think you will have better results:

sudo mkdir "/Library/Application Support/Perceptive Automation/images"

It will ask for a password - assuming that your account is the administrative account for the machine, use the same password.

Restart the plugin and see if it works. If you still get errors, then we need to change permissions on this newly created directory using the following command:

sudo chmod 777 "/Library/Application Support/Perceptive Automation/images"

Posted on
Sat Apr 13, 2013 9:29 am
wideglidejrp offline
User avatar
Posts: 555
Joined: Jan 15, 2012
Location: Danbury, CT

Re: Sonos Plugin Setup

Making progress. I followed your instructions and reloaded plugin. I could see a lot of Pandora and Sirius stuff fly by in the log but when I tried a simple command to turn off the Sonos, I got:


Trigger Test Sonos
Sonos Error Error in plugin execution ExecuteAction:

Traceback (most recent call last):
File "plugin.py", line 79, in actionPause
File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 555, in actionDirect
<type 'exceptions.KeyError'>: key not found in database

John R Patrick
Author of
Home Attitude

Posted on
Sat Apr 13, 2013 1:57 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos Plugin Setup

We are getting closer. Would you mind putting the plugin in debug mode and send me the entire output. It should be pretty straightforward to figure out from there. Thanks.

Posted on
Sat Apr 13, 2013 2:40 pm
wideglidejrp offline
User avatar
Posts: 555
Joined: Jan 15, 2012
Location: Danbury, CT

Re: Sonos Plugin Setup

Not sure if you wanted me to check both debugging options, but that is what I did. I have attached the results.
Attachments
Sonos plugin log.txt
(38.38 KiB) Downloaded 195 times

John R Patrick
Author of
Home Attitude

Posted on
Sat Apr 13, 2013 3:31 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos Plugin Setup

I think you triggered the action too quickly after turning on debug mode. I want to see that at the end of the log. It will give us all the detail as to why it failed. Can you try again. That's.

Posted on
Sat Apr 13, 2013 3:45 pm
wideglidejrp offline
User avatar
Posts: 555
Joined: Jan 15, 2012
Location: Danbury, CT

Re: Sonos Plugin Setup

I get the same thing each time I execute the action. You will see it several times at end of the new file (attached).
Attachments
Sonos plugin log.txt
(39.64 KiB) Downloaded 164 times

John R Patrick
Author of
Home Attitude

Posted on
Sat Apr 13, 2013 5:34 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos Plugin Setup

Think it may be simple. When you created the action, did you select one of your ZonePlayer devices to apply the Stop command to? Edit your action - there are two drop downs:
1. Type:
2. Device

1. Should be: Stop (Sonos Actions)
2. name of your ZonePlayer device.

Posted on
Sat Apr 13, 2013 8:26 pm
wideglidejrp offline
User avatar
Posts: 555
Joined: Jan 15, 2012
Location: Danbury, CT

Re: Sonos Plugin Setup

The device has no choices. See screenshot.
Attachments
Screen Shot 2013-04-13 at 10.25.06 PM.png
Screen Shot 2013-04-13 at 10.25.06 PM.png (53.05 KiB) Viewed 8674 times

John R Patrick
Author of
Home Attitude

Posted on
Sun Apr 14, 2013 5:02 am
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos Plugin Setup

Did you create devices for each of your ZonePlayers? This is pretty bizarre!

Posted on
Sun Apr 14, 2013 5:20 am
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos Plugin Setup

And finally make sure each has an IP address defined.

Who is online

Users browsing this forum: No registered users and 11 guests