Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

SONOS Plugin

Questions and comments specific to a particular plugin should go here.
techoguy
Experienced User
Posts: 157
Joined: Mon Mar 18, 2013 1:32 am

Re: SONOS Plugin

Post by techoguy »

In the future, is it possible to implement mute and unmute. I know that it is possible in a way now.
But i want to be able to unmute every unit to same volume as it was when i muted it.
Hi Kali,
I do plan on adding a mute and unmute action.
Currently i'm rewriting the whole plugin and creating my own reactor so I can receive events from SONOS like your app does. This way I can trigger events in EG. I'm having to write more code than I realized to make it work but it's getting there. Once that's complete, adding new actions will be pretty easy.
Hopefully I can make some big leaps tonight so i can post it soon.
The Latest SONOS Plugin:
Latest version can be found here: http://eventghost.org/forum/viewtopic.p ... 05f#p30309

EventGhost Lets me automate my home the way I want it, I love using it!
techoguy
Experienced User
Posts: 157
Joined: Mon Mar 18, 2013 1:32 am

Re: SONOS Plugin

Post by techoguy »

20:23:22 Traceback (most recent call last) (1640):
20:23:22 File "C:\Program Files (x86)\EventGhost\eg\Classes\TaskletDialog.py", line 59, in ProcessingTask
20:23:22 self.Configure(*args, **kwargs)
20:23:22 File "C:\Program Files (x86)\EventGhost\eg\Classes\ConfigDialog.py", line 165, in Configure
20:23:22 treeItem.Configure(*args)
20:23:22 File "C:\Program Files (x86)\EventGhost\eg\Classes\ActionItem.py", line 101, in Configure
20:23:22 return self.executable.Configure(*args)
20:23:22 File "C:\Program Files (x86)\EventGhost\plugins\EG_Sonos\__init__.py", line 1032, in Configure
20:23:22 presets = getfavlist(self, zpList[zpList.keys()[0]]['ip'])
20:23:22 File "C:\Program Files (x86)\EventGhost\plugins\EG_Sonos\__init__.py", line 167, in getfavlist
20:23:22 res = conn.getresponse()
20:23:22 File "httplib.pyc", line 986, in getresponse
20:23:22 File "httplib.pyc", line 420, in begin
20:23:22 File "mimetools.pyc", line 25, in __init__
20:23:22 File "rfc822.pyc", line 108, in __init__
20:23:22 File "httplib.pyc", line 276, in readheaders
20:23:22 File "socket.pyc", line 397, in readline
20:23:22 error: [Errno 10054] An existing connection was forcibly closed by the remote host
Hi Lameass,
Sorry it's not working for you. I'm currently not home to look at this specifically, but I was curious if you could try a couple of things:

1) completely shut down EG and try again, do you get the same error?
2) When EG first opens (or the plugin first starts) it searches your network to find all ZPs. Can you tell me if it's finding all your ZPs and if there are any other IPs listed that aren't ZPs?
3) What ZP models do you have?

The reason you can't configure the action is that before it opens the configuration window it sends a request to one of the SONOS players to get the favorites list to display it in the pull down. That request is failing. Not sure why by just looking at the error. When i get home in a couple of hours I'll try to take a look at the code to see if i can't find something obvious. If anything i'll probably be able to post a different version that you can try to give me more information about why the request is failing.
The Latest SONOS Plugin:
Latest version can be found here: http://eventghost.org/forum/viewtopic.p ... 05f#p30309

EventGhost Lets me automate my home the way I want it, I love using it!
Jostein
Experienced User
Posts: 108
Joined: Sun Feb 15, 2009 12:59 pm

Re: SONOS Plugin

Post by Jostein »

Hi Lameass.

I also got an error when i had characters like ├ª ├© ├Ñ in the favorites list. Do you have any non english characters in your favorites list on sonos?

Regards Jostein
techoguy
Experienced User
Posts: 157
Joined: Mon Mar 18, 2013 1:32 am

Re: SONOS Plugin

Post by techoguy »

I also got an error when i had characters like ├ª ├© ├Ñ in the favorites list. Do you have any non english characters in your favorites list on sonos?
Jostein,
Great point! I'm not doing anything to handle any of that.

Lameass,
can you give me a list of the stations you have in your favorites so I can see if that causes problems on my end?

Jostein, Lameass,
is it possible for you to send me the name or link to a radio station you use that have these special characters in their title so I can try it from my own system?

If that is the case, i might have to play with encoding when receiving XML responses.
The Latest SONOS Plugin:
Latest version can be found here: http://eventghost.org/forum/viewtopic.p ... 05f#p30309

EventGhost Lets me automate my home the way I want it, I love using it!
Jostein
Experienced User
Posts: 108
Joined: Sun Feb 15, 2009 12:59 pm

Re: SONOS Plugin

Post by Jostein »

Hi.

I had a playlist With ├© inn it. I Just renamed It i The sonos favoritt. I am not at home now So cant check now.

Regards Jostein
kalinkamaen
Experienced User
Posts: 138
Joined: Wed Dec 26, 2012 9:23 am

Re: SONOS Plugin

Post by kalinkamaen »

Hi Kali,
I do plan on adding a mute and unmute action.
Currently i'm rewriting the whole plugin and creating my own reactor so I can receive events from SONOS like your app does. This way I can trigger events in EG. I'm having to write more code than I realized to make it work but it's getting there. Once that's complete, adding new actions will be pretty easy.
Hopefully I can make some big leaps tonight so i can post it soon.

Thanks mate.Sounds great.
Just use your time, do not rush anything. I am looking forward to your new update.

Kali
kalinkamaen
Experienced User
Posts: 138
Joined: Wed Dec 26, 2012 9:23 am

Re: SONOS Plugin

Post by kalinkamaen »

Jostein,
Great point! I'm not doing anything to handle any of that.

Lameass,
can you give me a list of the stations you have in your favorites so I can see if that causes problems on my end?

Jostein, Lameass,
is it possible for you to send me the name or link to a radio station you use that have these special characters in their title so I can try it from my own system?

If that is the case, i might have to play with encoding when receiving XML responses.
Hello i have tried out this and i am getting the same error as lameass.
Here are some stations that does not work:

Image

Image

Image

Image

Image

Here you can see 2 channel that make error in eventghost when placed in sonos favorites.

Image


I tried to rename the favorites i sonos favorites. But that did not help.

Kali
techoguy
Experienced User
Posts: 157
Joined: Mon Mar 18, 2013 1:32 am

Re: SONOS Plugin

Post by techoguy »

Hi Kali,
Thanks! That helps a lot. It would appear that I'm not handling the encoding properly.
I'll look over that and try to post a fix this weekend.
The Latest SONOS Plugin:
Latest version can be found here: http://eventghost.org/forum/viewtopic.p ... 05f#p30309

EventGhost Lets me automate my home the way I want it, I love using it!
Lameass
Posts: 5
Joined: Wed Jan 29, 2014 7:26 pm

Re: SONOS Plugin

Post by Lameass »

techoguy wrote: 1) completely shut down EG and try again, do you get the same error?
2) When EG first opens (or the plugin first starts) it searches your network to find all ZPs. Can you tell me if it's finding all your ZPs and if there are any other IPs listed that aren't ZPs?
3) What ZP models do you have?
1) Yes.
2) Yes. It finds my 2 devices and the bridge.
3) I have the Play3 and the Connect (not with amp), and I also have a bridge.
Image
techoguy wrote:
Lameass,
can you give me a list of the stations you have in your favorites so I can see if that causes problems on my end?

Jostein, Lameass,
is it possible for you to send me the name or link to a radio station you use that have these special characters in their title so I can try it from my own system?
Here is my station list.
Image

The radio station aren't important to me, so i removed them and tried again. Same result.

Jostein wrote: I also got an error when i had characters like ├ª ├© ├Ñ in the favorites list. Do you have any non english characters in your favorites list on sonos?
Nope. The songs inside the playlist itself probably has a couple of Æ's Ø's and Å's, which shouldn't matter, but just to make sure i removed all my favorites and added just one Spotify playlist, including only A-Z 0-9 in the artist name and titles.



I've also tried it on 3 machines (one clean Eventghost install) just to make sure it wasn't something else on the machine causing the problem.



Br,
Lameass
kalinkamaen
Experienced User
Posts: 138
Joined: Wed Dec 26, 2012 9:23 am

Re: SONOS Plugin

Post by kalinkamaen »

Try to delete every playlist again and use just Norweigan radio station p3 as sonos favorite.
I am using that channel without issues. And report back.

Another thing. Are all your sonos units updated?
techoguy
Experienced User
Posts: 157
Joined: Mon Mar 18, 2013 1:32 am

Re: SONOS Plugin

Post by techoguy »

Looks like there are two issues. I have an encoding problem with special characters. When I try the station that Kali listed I get this error:

Code: Select all

  File "xml\dom\minidom.pyc", line 1928, in parseString
  File "xml\dom\expatbuilder.pyc", line 940, in parseString
  File "xml\dom\expatbuilder.pyc", line 223, in parseString
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe6' in position 3915: ordinal not in range(128)
This is different than the error Lameass is having. I'll have to work on the encoding error, i'm not as familiar with handling that.

Lameass,
thanks for the screen shot, the first line at 10:16:04 which is not red is actually part of the ERROR and tells me a lot more. SONOS is responding to the request by saying the request isn't allowed. So I'm assuming that it's requesting the info from the bridge instead of the Play3 or Connect. It should be random so I'm surprised you're getting the error every time.
__init__.py
Version 0.4 Beta/Debug file
(57.57 KiB) Downloaded 189 times
The file here will print out the device it is trying to get the Favorites list from and will make sure it's not asking from a device like the bridge. Hopefully this fixes your problem.
If that doesn't work, can you try removing the bridge and connect and only try with the Play3? And can you post another screen shot of the error starting from the "Getting favorites list from..."?

By the way, how are you getting time stamps for everything recorded in the log window? I've always wondered why there was no time stamp.

Let me know how the new file goes
The Latest SONOS Plugin:
Latest version can be found here: http://eventghost.org/forum/viewtopic.p ... 05f#p30309

EventGhost Lets me automate my home the way I want it, I love using it!
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: SONOS Plugin

Post by jonib »

techoguy wrote:By the way, how are you getting time stamps for everything recorded in the log window? I've always wondered why there was no time stamp.
Menu->View->Log Times gives you timestamps in the log.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
Lameass
Posts: 5
Joined: Wed Jan 29, 2014 7:26 pm

Re: SONOS Plugin

Post by Lameass »

Techoguy,

Fantastic, it worked great. Didn't even have to disconnect the bridge.



Br,
Lameass
techoguy
Experienced User
Posts: 157
Joined: Mon Mar 18, 2013 1:32 am

Re: SONOS Plugin

Post by techoguy »

Hey Guys,
I've made some great strides this week in the plugin. The backend is working (which was the hard part) and i'm working on putting it in a plugin and adding the action commands back in.

As for events that are seen in EG, what would you guys most likely want to see at first?

I will for sure have an event for play state like stop, pause, play.
I'll probably also have events for volume changes.

Other events that can be added:
new song started (meta data in the payload)
group changes (added/removed)
new ZP added to system
ZP removed from system
and really nearly anything that changes on the SONOS system I can capture to trigger an event.

So let me know what you guys were looking for.

Hopefully I'll have the new plugin up soon.
The Latest SONOS Plugin:
Latest version can be found here: http://eventghost.org/forum/viewtopic.p ... 05f#p30309

EventGhost Lets me automate my home the way I want it, I love using it!
kalinkamaen
Experienced User
Posts: 138
Joined: Wed Dec 26, 2012 9:23 am

Re: SONOS Plugin

Post by kalinkamaen »

Nice work man. Looking forward to test your new update.

As I have mention earlier, I would like to see Mute/Unmute as an option if possible.
It would also be nice to see the events when changeing something in sonos.

Regards Kali
Post Reply