Sonos - The Beginning

Posted on
Mon Feb 20, 2012 8:38 am
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Thanks Mat. I've been doing some additional testing and am now thinking the issue is related to Line-In or the lack of Line-In being treated like a radio station or music track. I set up a Line-In on my Sonos and I see the updates coming in do not reflect that; it continues to pass stats from the last track played.

This is going to be difficult! To take my mind off that issue, I started working on an action to select and play a Sonos Playlist. It "will" update dynamically based on the ZonePlayer chosen in the dialog.

Stay tuned...

Posted on
Mon Feb 20, 2012 8:55 am
HomeAutomationPlugins.com offline
Posts: 41
Joined: Feb 18, 2012

Re: Sonos - The Beginning

Hi nlagaros,

Sorry I haven't replied! I'm going to lend whatever help I can to this as I've got 8 Sonos players in my house that I'd love to use this plugin to control!

Been a bit busy developing my own plugin for LightwaveRF kit here - viewtopic.php?f=11&t=8062

A quick question - are you planning on supporting the grouping and un-grouping of Zoneplayers in your plugin?

Posted on
Mon Feb 20, 2012 8:59 am
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Thanks for the support reading123. This is fun stuff when you have the time for it! I will support any function that is reasonable coded in the plugin once I get past the basics. This issue with the Line-In is going to be a bear!

Posted on
Mon Feb 20, 2012 9:57 am
terrydew offline
Posts: 258
Joined: Jun 10, 2011

Re: Sonos - The Beginning

Finally got sonospy to load and successfully goy to url. I had to stop security spy to get it to work so will probably need to change port. My research points to changing the port number in "options.py", "options_std.py", and maybe "options_win.py" all in the "web2py" directory. Thoughts?

With sonospy running I get the following errors which repeat every 10 seconds:

Traceback (most recent call last):
File "plugin.py", line 46, in runConcurrentThread
File "/Library/Application Support/Perceptive Automation/Indigo 5/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 55, in runConcurrentThread
File "/Library/Application Support/Perceptive Automation/Indigo 5/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 88, in checkForMessages
File "/Library/Application Support/Perceptive Automation/Indigo 5/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 109, in parseMessage
<type 'exceptions.IndexError'>: list index out of range

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

Terry

Posted on
Mon Feb 20, 2012 1:44 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Sonos - The Beginning

Terry, does the actual zone name, match the name you entered into "edit device settings"?

Late 2018 mini 10.14

Posted on
Mon Feb 20, 2012 1:46 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Sonos - The Beginning

Happy for you to leave the line-in for now. :evil: :D
I need to update some stuff and may drop mark an email asking him if he figured out where it went. I'll see if I can sort something out there!

Let me know when you want bits testing, free free to email etc.

Mat

Late 2018 mini 10.14

Posted on
Mon Feb 20, 2012 3:33 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Terry - think you have an older build. Did you download the very latest package on the web page? I've made so many edits over the past couple of days and fixed quite a few silly errors.

Posted on
Mon Feb 20, 2012 3:34 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Mat - I posted a bug on the SonosPy github page and got railed by one of the contributors - not Mark. If you can contact him and see if he is going to work on supporting Line-In, that would be excellent. I'll keep cracking away, but suspect things will slow down as I need to get back to work this week. Will try to spend some time on it.

Posted on
Mon Feb 20, 2012 3:37 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Terry - for SonosPy, think you have it right with options.py. Simply change the port from 8000 to something that works for you and restart services. That should be all that is required.

Posted on
Mon Feb 20, 2012 4:04 pm
terrydew offline
Posts: 258
Joined: Jun 10, 2011

Re: Sonos - The Beginning

Yes the change in port number worked. I changed to 8500.

I have the ver 0.2.1 but I redownloaded and I still get the same errors.

I originally had different names for the device and the zone name in sonos. I deleted the device and created a new one with the device name and the zone name the same. Still get the same errors.
I assume the zone name is the name in the list when running the sonos desktop controller.

Question. How do you automatically restart sonospy when the mac mini restarts since it starts from Terminal? Is there a script that can be run at startup?

Thanks
Terry

Posted on
Mon Feb 20, 2012 4:18 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Terry - please run the plugin in debug mode. You will have to restart it once you change the config. That should tell us exactly what is going on.

To auto-launch SonosPy, you need to place a startup list file. I created the following in /Library/LaunchDaemons:

com.ssi.sonospy.plist

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.ssi.sonospy</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/sonospy/sonospy_web</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>StartInterval</key>
    <integer>120</integer>
</dict>
</plist>


My machine has not rebooted yet, so not sure if this works, but you get the idea. You will have to change the path to sonospy to match the location you placed it at on your machine.

Posted on
Mon Feb 20, 2012 5:28 pm
mat offline
Posts: 769
Joined: Nov 25, 2010
Location: Cambridgeshire - UK

Re: Sonos - The Beginning

Hi,

Thought this might help. YouTube of what's happening.

I'm only playing one zone - the bottom one of three.

http://www.youtube.com/watch?v=OjlbEvG4 ... ata_player

Regards

Mat

Late 2018 mini 10.14

Posted on
Mon Feb 20, 2012 5:29 pm
terrydew offline
Posts: 258
Joined: Jun 10, 2011

Re: Sonos - The Beginning

Here is errors with debug on


Sonos Error plugin runConcurrentThread function returned or failed; will attempt again in 10 seconds
Sonos Debug Method: runConcurrentThread
Sonos Debug Running Concurrent Thread
Sonos Debug Message: http://192.168.1.202:8500/data/renderer ... 20%28ZP%29
Sonos Debug Error getting ZonePlayer data: Office%20%28ZP%29
Sonos Debug Message: http://192.168.1.202:8500/data/renderer ... 20%28ZP%29
Sonos Debug Error getting ZonePlayer data: Office%20%28ZP%29
Sonos Debug Parsing:Office:None
Sonos Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 46, in runConcurrentThread
File "/Library/Application Support/Perceptive Automation/Indigo 5/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 55, in runConcurrentThread
File "/Library/Application Support/Perceptive Automation/Indigo 5/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 88, in checkForMessages
File "/Library/Application Support/Perceptive Automation/Indigo 5/Plugins/Sonos.indigoPlugin/Contents/Server Plugin/Sonos.py", line 109, in parseMessage
<type 'exceptions.IndexError'>: list index out of range

Posted on
Mon Feb 20, 2012 5:37 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Terry - can you paste the debug log inside the <code> tags. That will take away the HTML encoding and let us see the exact commands being processed. Thanks.

Posted on
Mon Feb 20, 2012 5:40 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: Sonos - The Beginning

Mat - thanks for the video. That is pretty nuts that the two zones with nothing going on are picking up the third's state. I'm starting to thing there is some timing issues with sosnospy. I won't have a chance to touch this again today, but will likely increase the timeout between polls to slow things down even more. I have a .25 second pause between requests which probably is not enough.

Who is online

Users browsing this forum: No registered users and 9 guests