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.
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
Re: SONOS Plugin
Hi kalinkamaen,
Any specific changes you're looking for primarily?
When I get updates from SONOS, it's a lot of information and can potentially show everything you ever do in the app or on the speaker itself (pressing the volume buttons etc). There is some translation from the events I receive from SONOS and presenting it in EG too. So I was just curious if there were specific changes that occur on SONOS that you would like to see an event for that I can focus on for the first release?
Thanks for the feedback!
Any specific changes you're looking for primarily?
When I get updates from SONOS, it's a lot of information and can potentially show everything you ever do in the app or on the speaker itself (pressing the volume buttons etc). There is some translation from the events I receive from SONOS and presenting it in EG too. So I was just curious if there were specific changes that occur on SONOS that you would like to see an event for that I can focus on for the first release?
Thanks for the feedback!
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!
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
I doent have any specific event i want to see right now. But i know i will find it usefull in the future.
If some one else needs any thing to trigger something, just feel free to mention what you need. I am happy
with mute and umute for now
If some one else needs any thing to trigger something, just feel free to mention what you need. I am happy
with mute and umute for now
Re: SONOS Plugin
It's Finally Here!!
I have completely re-written the plugin from the ground up. With this the plugin now will automatically update IP addresses, Zone Player names, will automatically add new ZP or remove them to match the network. The plugin is also using asynchronous sockets so nothing should be held by the plugin waiting for a response.
The encoding error should also be fixed now so stations selected with special characters should work fine.
To use the new plugin,
simply add it, set the debug level (default is 0), and use the actions to send commands to the ZPs on your network.
NOTE: each command is specific to a ZP based on it's unique MAC address. This allows you to change the name of a Zone Player without breaking any commands you already have. If a Zone Player is replaced with another, then your commands will have to be updated.
Commands Supported:
Play, Pause, Stop, Next, Previous, Relative Volume, Set Volume, Mute On, Mute Off, Play Mode, Start Favorite Playlist/Station
Soon to come:
Notifications, Group, Ungroup, Weather announcement
Events Supported:
New Zone Player added to network (generic for all ZP, payload carries ZP information)
Zone Player removed form network.
Zone Player Playing
Zone Player Stopped/Paused
Note: i'm currently receiving MetaData information for all currently playing music but I am not doing anything with it other than storing it in the plugin.
Soon to come:
event for new track playing with metadata in payload
event for volume adjustments (could be used to control max volume of a zone)
Known Issues added 2/22/2014
1)If you only have 1 zone player, the plugin might not automatically update the IP address if it changes or if you add another zone player to the network. If you close EG and reopen when adding a ZP it should be fine.
I have multiple Zps to test with and the system acts a little different between 1 and many.
2)Sometimes when grouping or ungrouping a zone player that zone player may trigger the wrong state (playing or stopped). Example, if you have a group that is stopped and add another stopped zp, there will be an event that says that ZP is now playing when it's not. Hopefully this will be fixed later.
3)sometimes when opening the configuration window for the StartPlayList action, EG hangs forever. Can't seem to find out why this is happening at this time. The first line in the Config function is a print line and that doesn't even execute when it hangs.
4) If your zone players have special characters in the name, receiving group topology info will fail which means when opening an action configuration window, the drop down list of ZPs is empty. This has been fixed for the next revision. line 491 needs to be changed from xml = parseString(xmlstring) to xml = parseString(xmlstring.encode('utf-8'))
update 2/25/2014
5) when sending many action commands sequencially in EG, the asyncore can crash which stops the plugin from receiving and sending ip packets. The current fix is to make sure there is a 0.6-1 second delay between commands.
Let me know how it goes and how you guys end up using.
If there are any issues, please set the debug level to 2 and send me the output of the error/messages printed to the screen.
Enjoy!
The latest version can be found here:
viewtopic.php?f=9&t=5312&p=30094#p30094
I have completely re-written the plugin from the ground up. With this the plugin now will automatically update IP addresses, Zone Player names, will automatically add new ZP or remove them to match the network. The plugin is also using asynchronous sockets so nothing should be held by the plugin waiting for a response.
The encoding error should also be fixed now so stations selected with special characters should work fine.
To use the new plugin,
simply add it, set the debug level (default is 0), and use the actions to send commands to the ZPs on your network.
NOTE: each command is specific to a ZP based on it's unique MAC address. This allows you to change the name of a Zone Player without breaking any commands you already have. If a Zone Player is replaced with another, then your commands will have to be updated.
Commands Supported:
Play, Pause, Stop, Next, Previous, Relative Volume, Set Volume, Mute On, Mute Off, Play Mode, Start Favorite Playlist/Station
Soon to come:
Notifications, Group, Ungroup, Weather announcement
Events Supported:
New Zone Player added to network (generic for all ZP, payload carries ZP information)
Zone Player removed form network.
Zone Player Playing
Zone Player Stopped/Paused
Note: i'm currently receiving MetaData information for all currently playing music but I am not doing anything with it other than storing it in the plugin.
Soon to come:
event for new track playing with metadata in payload
event for volume adjustments (could be used to control max volume of a zone)
Known Issues added 2/22/2014
1)If you only have 1 zone player, the plugin might not automatically update the IP address if it changes or if you add another zone player to the network. If you close EG and reopen when adding a ZP it should be fine.
I have multiple Zps to test with and the system acts a little different between 1 and many.
2)Sometimes when grouping or ungrouping a zone player that zone player may trigger the wrong state (playing or stopped). Example, if you have a group that is stopped and add another stopped zp, there will be an event that says that ZP is now playing when it's not. Hopefully this will be fixed later.
3)sometimes when opening the configuration window for the StartPlayList action, EG hangs forever. Can't seem to find out why this is happening at this time. The first line in the Config function is a print line and that doesn't even execute when it hangs.
4) If your zone players have special characters in the name, receiving group topology info will fail which means when opening an action configuration window, the drop down list of ZPs is empty. This has been fixed for the next revision. line 491 needs to be changed from xml = parseString(xmlstring) to xml = parseString(xmlstring.encode('utf-8'))
update 2/25/2014
5) when sending many action commands sequencially in EG, the asyncore can crash which stops the plugin from receiving and sending ip packets. The current fix is to make sure there is a 0.6-1 second delay between commands.
Let me know how it goes and how you guys end up using.
If there are any issues, please set the debug level to 2 and send me the output of the error/messages printed to the screen.
Enjoy!
The latest version can be found here:
viewtopic.php?f=9&t=5312&p=30094#p30094
Last edited by techoguy on Thu Mar 06, 2014 5:41 pm, edited 4 times in total.
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!
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
Wow nice m8.
I will be testing this ASAP when i am coming home.
Thanks for the Mute/unmute support.
Kali
I will be testing this ASAP when i am coming home.
Thanks for the Mute/unmute support.
Kali
Re: SONOS Plugin
Hi.
Thanks again. Works great here. Loking forward to next release.
Thanks again. Works great here. Loking forward to next release.
Zip should be ok. I think it works for anywhere, for example Oslo in Norway has zip 862592 as you can see in the url after serching on the page but in real life it has zip 0010. http://weather.yahoo.com/norway/oslo-fylke/oslo-862592/techoguy wrote: I do plan on leaving it in as it's own action. you'll put in the zip code and then it'll do it's thing. Is the zip code the right way to get weather or is there a better universal way for anywhere in the world?
Re: SONOS Plugin
Hi again,Jostein wrote:Hi techoguy.
Sorry for the late response but subscribtion mail ended in spam folder.
I have not tried to use it to control groups as i only have one zone.
Have made it into a plugin which makes setup mutch faster.
Just copy the folder to plugins folder in EG. Start it and run the action Register WSC, and then run the UniqeDeviceNames which will output a file to C: with uuid`s.
Have attached the plugin if anybody wants to try it. It is still very basic but it does what i need it to do which is Play, Pause, Next and prev. If you want to control more than one zone you need to launch a 2nd instance of the plugin for every zone.
Would be interested in seeing your files, since i beleive your way of controlling sonos is the right way and also the path to go for more advanced control.
I have also wall switches (Smart HDL DLP) that i use for pause, play, and so on. But would like to have some switches for preset radio channels, do you have a script for starting a spesific radio channel?
Regards Jostein
Just got a new PC laptop ultra deal and the Sonos plugin above is the only one I can get working out the box (accept for volume down).
I like it. Thanks Jostein.
This one...
I tried...
Maybe didn't load/install proper?
Just copied the .py over.techoguy wrote:It's Finally Here!!
I have completely re-written the plugin from the ground up. With this the plugin now will automatically update IP addresses, Zone Player names, will automatically add new ZP or remove them to match the network. The plugin is also using asynchronous sockets so nothing should be held by the plugin waiting for a response.
The encoding error should also be fixed now so stations selected with special characters should work fine.
To use the new plugin,
simply add it, set the debug level (default is 0), and use the actions to send commands to the ZPs on your network.
NOTE: each command is specific to a ZP based on it's unique MAC address. This allows you to change the name of a Zone Player without breaking any commands you already have. If a Zone Player is replaced with another, then your commands will have to be updated.
Commands Supported:
Play, Pause, Stop, Next, Previous, Relative Volume, Set Volume, Mute On, Mute Off, Play Mode, Start Favorite Playlist/Station
Soon to come:
Notifications, Group, Ungroup, Weather announcement
Events Supported:
New Zone Player added to network (generic for all ZP, payload carries ZP information)
Zone Player removed form network.
Zone Player Playing
Zone Player Stopped/Paused
Note: i'm currently receiving MetaData information for all currently playing music but I am not doing anything with it other than storing it in the plugin.
Soon to come:
event for new track playing with metadata in payload
event for volume adjustments (could be used to control max volume of a zone)
Let me know how it goes and how you guys end up using.
If there are any issues, please set the debug level to 2 and send me the output of the error/messages printed to the screen.
Enjoy!
See the plugin in EG but no uuid ip config etc.
What am I missing techoguy?
Thanks both for the work your doing.
Ian
eventghost.net
Be there or be square.
Be there or be square.
Re: SONOS Plugin
Hi zian.
On the new version try to open cofig for the actions and not the plugin. There it should be possible to chose the right zone.
On the new version try to open cofig for the actions and not the plugin. There it should be possible to chose the right zone.
-
kalinkamaen
- Experienced User
- Posts: 138
- Joined: Wed Dec 26, 2012 9:23 am
Re: SONOS Plugin
Hello, I have som issue with the new plugin.
I deleted everything installed and added Init.py in to a sonos folder i made. Is this wrong?
It looks like the plugin cant find my players:


I deleted everything installed and added Init.py in to a sonos folder i made. Is this wrong?
It looks like the plugin cant find my players:


Re: SONOS Plugin
I mixed and match components of a few Sonos plugins/versions... Works for me.
Your results may vary.
Your results may vary.
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1640">
<Folder Name="Sonos" Expanded="True">
<Macro Name="Play" Expanded="True">
<Event Name="Keyboard.Ctrl+Delete+P" />
<Event Name="Keyboard.Ctrl+P" />
<Action>
Sonos.Play(u'RINCON_000E58F314E201400')
</Action>
</Macro>
<Macro Name="Pause" Expanded="True">
<Event Name="Keyboard.Ctrl+Delete+S" />
<Event Name="Keyboard.Ctrl+S" />
<Action>
Sonos.Pause(u'RINCON_000E58F314E201400')
</Action>
</Macro>
<Macro Name="Stop" Expanded="True">
<Action>
Sonos.Stop()
</Action>
</Macro>
<Macro Name="Next" Expanded="True">
<Action>
Sonos.Next()
</Action>
</Macro>
<Macro Name="Previous" Expanded="True">
<Action>
Sonos.Previous()
</Action>
</Macro>
<Macro Name="VolumUp" Expanded="True">
<Action>
Sonos.VolumeAdjust(u'RINCON_000E58F314E201400', '3')
</Action>
<Action Enabled="False">
EventGhost.PythonCommand('Sonos.VolumUp()')
</Action>
</Macro>
<Macro Name="VolumDown" Expanded="True">
<Action>
Sonos.VolumeAdjust(u'RINCON_000E58F314E201400', '-3')
</Action>
<Action Enabled="False">
EventGhost.PythonCommand('Sonos.VolumDown()')
</Action>
</Macro>
</Folder>
</EventGhost>eventghost.net
Be there or be square.
Be there or be square.
-
jonasbegood
- Posts: 8
- Joined: Sat Feb 22, 2014 10:32 pm
Re: SONOS Plugin
Do you have special letter in the name of your ZP ? I had a ZP named "Kj├©kken" and then the plugin did not find any of them.kalinkamaen wrote:Hello, I have som issue with the new plugin.
BTW! Very nice plugin. I have Sonos P3,P5, playbar and sub and it works very well. Cant wait to get the weather functions implemented! If possible, it would be really cool with a news rss reader as well that you could link with your favorite news site and get the news broadcasted after todays weather
-
jonasbegood
- Posts: 8
- Joined: Sat Feb 22, 2014 10:32 pm
Re: SONOS Plugin
Hi! Great plugin, but I did find a bug in the plugin:
- When a ZP (Playbar) is automatically set to output the TV, all the ZP are unable to control by the plugin. The message received when trying to send signal is "Plugin has not received Group Topology info yet." If I reload the configuration tree I see all of the ZP is found, but when trying to add a new command noone is visible in the list.
- When trying to use the command StartPlayList Eventghost is freezing.
I will try to reproduce the problems tomorrow and see if I can get a decent log in debug2.
- When a ZP (Playbar) is automatically set to output the TV, all the ZP are unable to control by the plugin. The message received when trying to send signal is "Plugin has not received Group Topology info yet." If I reload the configuration tree I see all of the ZP is found, but when trying to add a new command noone is visible in the list.
- When trying to use the command StartPlayList Eventghost is freezing.
I will try to reproduce the problems tomorrow and see if I can get a decent log in debug2.
Re: SONOS Plugin
Hi Kalinkamaen,Hello, I have som issue with the new plugin.
I deleted everything installed and added Init.py in to a sonos folder i made. Is this wrong?
It looks like the plugin cant find my players:
That is correct.
As for no players showing up in the drop down list, it looks like there was an XML encoding error. Do you have any special characters in the names of your sonos players?
Can you double click the plugin and set the debug level to 2, click ok, safe the config file, close and reopen EG. This should print out a lot more information. Can you then copy the text and send it to me or post it here? Copying the text would be easier for me vs a screen shot.
If you do have a special character in your zone player names, try this for me:
change line 491 (assuming you're using REV 0.6) from
Code: Select all
xml = parseString(xmlstring)Code: Select all
xml = parseString(xmlstring.encode('utf-8'))What's supposed to happen is that the plugin starts by sending out a network broadcast that all the ZPs respond to. This is working and the plugin is finding your players (SONOS.NewZonePlayerAdded...). Then the plugin requests Group Topology which gives the plugin more information about each player to accurate control them all. This seems to be failing. Hopefully with the debug level set to 2 it will print out more details to let me know what's going on but i'm pretty sure the XML error is causing this to fail.
Last edited by techoguy on Sun Feb 23, 2014 6:51 am, edited 1 time in total.
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!
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!
Re: SONOS Plugin
Hi zian,Just copied the .py over.
See the plugin in EG but no uuid ip config etc.
What am I missing techoguy?
Thanks both for the work your doing.
as Jostein mentions this new plugin automatically finds your zone players on the network similar to the SONOS app it self. If the plugin successfully starts, all you have to do is open the configuration window for the action you want to send and a list of your zone players should show up. See my picture below. Also note that some actions from the first plugin have been removed for example Volume Down has been replaced with VolumeAdjust (do adjust down you enter a negative number instead of positive).
I'm curious why you had to combine multiple plugins and if you are receiving any errors. Would be curious to know what your start up log looks like.
1. add plugin
2. plugin starts
3. Zone Players are found on network
4. add action and double click to get configuration
5. select zone player you want to send the command to
6. test the command
Once you hit Apply or OK the ZP will be saved in the EG config file for this action. if everything goes well, you should see something like this below. There will be an event for every ZP and it should list its current state as either playing or stopped.
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!
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!
Re: SONOS Plugin
Hi Jonasbegood,
If you can give me an example of a news RSS feed i'll look at it to see how it's formated. If it's like a podcast, it'll be very easy to do and the next release of the plugin might allow you to do it if you are able to grab the feed link outside the plugin. The notifications will work something like this:
Action 1) take snapshot of current state of ZP (metadata, station, location, track# etc)
Action 2) set Zp to play notification
Action 3) play notification
Action 4) re-implement state of ZP to original state
Action 2 will be either action to play stream from anywhere (news feed, podcasts, local MP3) or select Aux input of ZP to use Text to Speech). So you could have it say the weather and then play a news feed.
I have also toyed with streaming your computer sound so you don't need to use an Aux input for Text to Speech. There are two problems with this, all SW i've used to do this with creates really long delays (7-15 seconds) and it's very unreliable. Sometimes it works and other times the ZP rejects the stream. But it is possible. I'll end up showing you guys if you want to try and see if you'll have better luck.
Hopefully I'll have the next released done within a week or so. Running into some bugs that i didn't expect.
Thanks and i'm with you, i've actually been playing with some code that allows me to automatically create a playlist within SONOS using an RSS feed for podcasts. The plugin could automatically update the playlist with the latest podcasts. I know there are other ways to play podcasts but they usually rely on your phone to stream them which I don't prefer. But, yeah those same tools could allow other things as well.BTW! Very nice plugin. I have Sonos P3,P5, playbar and sub and it works very well. Cant wait to get the weather functions implemented! If possible, it would be really cool with a news rss reader as well that you could link with your favorite news site and get the news broadcasted after todays weatherThis could also be customised to read your e-mails, facebook messages etc. RSS would give many cool possibilites!
If you can give me an example of a news RSS feed i'll look at it to see how it's formated. If it's like a podcast, it'll be very easy to do and the next release of the plugin might allow you to do it if you are able to grab the feed link outside the plugin. The notifications will work something like this:
Action 1) take snapshot of current state of ZP (metadata, station, location, track# etc)
Action 2) set Zp to play notification
Action 3) play notification
Action 4) re-implement state of ZP to original state
Action 2 will be either action to play stream from anywhere (news feed, podcasts, local MP3) or select Aux input of ZP to use Text to Speech). So you could have it say the weather and then play a news feed.
I have also toyed with streaming your computer sound so you don't need to use an Aux input for Text to Speech. There are two problems with this, all SW i've used to do this with creates really long delays (7-15 seconds) and it's very unreliable. Sometimes it works and other times the ZP rejects the stream. But it is possible. I'll end up showing you guys if you want to try and see if you'll have better luck.
Hopefully I'll have the next released done within a week or so. Running into some bugs that i didn't expect.
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!
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!
Re: SONOS Plugin
Hi jonasbegood
I would expect there to be an "XML error: ..." before seeing "SONOS.NewZonePlayerAdded ..."
Update: think i found the problem. Can you try and comment out line 1510 and try again? Only the delay in the first While loop. This seemed to fix it on my computer
I might have to release a new revision sooner than later because i've also noticed some of my debug output isn't as informative as it should be. I've updated a lot already from 0.6
This only started happening when the playbar was set to output the TV, it works otherwise? This sounds like a different problem but I'd be interested to see the debug output. What could be happening is that the group topology is failing because something new was added with the playbar. I have a playbar but haven't connected it yet or tested it but assumed it worked just like a Play5 or Connect and their Aux inputs.- When a ZP (Playbar) is automatically set to output the TV, all the ZP are unable to control by the plugin. The message received when trying to send signal is "Plugin has not received Group Topology info yet." If I reload the configuration tree I see all of the ZP is found, but when trying to add a new command noone is visible in the list.
I would expect there to be an "XML error: ..." before seeing "SONOS.NewZonePlayerAdded ..."
This just started happening on my computer. One computer it happens sometimes but my other computer it happens all the time. It's very odd because the first line in the Configure function could be a print line and it still doesn't execute before locking up. So it seems to be something with that action and EG. Currently debugging this now.- When trying to use the command StartPlayList Eventghost is freezing.
Update: think i found the problem. Can you try and comment out line 1510
Code: Select all
time.sleep(0.1)#small delay ...Thanks!I will try to reproduce the problems tomorrow and see if I can get a decent log in debug2.
I might have to release a new revision sooner than later because i've also noticed some of my debug output isn't as informative as it should be. I've updated a lot already from 0.6
Last edited by techoguy on Sun Feb 23, 2014 8:02 am, edited 2 times in total.
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!
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!