Sonos plugin

@Anker = If you’re able to make it select a Sonos Playlist i define, that would be cool too :slight_smile:

@guessed - thanks again for your help, I’ve been doing my best to try and do as much as I can in MiOS via the Vera UI rather than resorting to code (a) because I’m not clever enough to be a programmer and b) I’m curious how far MCV are away from making their product usable by almost anyone :slight_smile: .

Ok, here goes - In an attempt to use my Sonos as a Siren (using siren.mp3) - I thought the following might work…

  1. Create a scene called ‘Armed’ that arms the motion and door sensors at a Scheduled time of 11PM
  2. Create another scene called ‘Sonos Alarm’ that is triggered bythe tripping any of any armed sensors and then plays a track on the Sonos.

Question : if multiple triggers are listed does it require all the listed triggers to be met or either of them (an AND or an OR) ? If both then I guess I would have to create a ‘Sonos Alarm’ (with an armed only trigger + song) for all the sensors?

  1. Create a scene called ‘disarm’ that puts all the motion and door sensors into Bypass state at a Scheduled time of 6AM

What do you think ?

[quote=“parkerc, post:141, topic:169644”]@Anker = If you’re able to make it select a Sonos Playlist i define, that would be cool too :slight_smile:

@guessed - thanks again for your help, I’ve been doing my best to try and do as much as I can in MiOS via the Vera UI rather than resorting to code (a) because I’m not clever enough to be a programmer and b) I’m curious how far MCV are away from making their product usable by almost anyone :slight_smile: .

Ok, here goes - In an attempt to use my Sonos as a Siren (using siren.mp3) - I thought the following might work…

  1. Create a scene called ‘Armed’ that arms the motion and door sensors at a Scheduled time of 11PM
  2. Create another scene called ‘Sonos Alarm’ that is triggered bythe tripping any of any armed sensors and then plays a track on the Sonos.

Question : if multiple triggers are listed does it require all the listed triggers to be met or either of them (an AND or an OR) ? If both then I guess I would have to create a ‘Sonos Alarm’ (with an armed only trigger + song) for all the sensors?

  1. Create a scene called ‘disarm’ that puts all the motion and door sensors into Bypass state at a Scheduled time of 6AM

What do you think ?[/quote]

Pretty sure they are OR. Like your idea, be sure to post results as I want to do the same thing…

I’ve added the example Scene script & screenshot from @parkerc to the wiki. Thanks for that, it should help future users!

Hello, any update on the “play radio station” or pandora station?

Thanks!
Sent from my SPH-D710 using Tapatalk 2

Hi, Got a pb installing the plugin files. Need some support.

No drop down options list created ! Only Poll, Remove… nothing specific to sonos plugin as SetFileToPlay or Play…

Do you know how to check good upload of files ? I have Plugin 15 files with UI5.
Can you send me a capture of your device parameters if it works for you ?

Thx

[quote=“vda, post:145, topic:169644”]Hi, Got a pb installing the plugin files. Need some support.

No drop down options list created ! Only Poll, Remove… nothing specific to sonos plugin as SetFileToPlay or Play…

Do you know how to check good upload of files ? I have Plugin 15 files with UI5.
Can you send me a capture of your device parameters if it works for you ?

Thx[/quote]

Like vda, I’m experiencing an identical problem with Vera2 (firmware 1.5.346). I have read (and re-read!) this thread (some of which is a bit beyond me as a newcomer!) and have followed the instructions in the Sonos Wireless HiFi Music Systems wiki.

The wiki has me a little confused, as it states “Vera with UI4 has only been tested”, but this thread indicates success with U15.

The wiki also states to download the “4 plugin files in the trunk version 13”, but following the link gets me to trunk version 15.

Is it possible I’ve got the wrong plug-in files, or does the wiki need an update?

I am also a little confused about which IP address I should be using - I have a Sonos Zone Bridge, with two Player 5’s paired as a stereo pair. Each device has its own IP address, and I am confused as to which of these I should be using. If I “unpair” the P5’s, I still get the three IP addresses.

Any assistance would be appreciated!

[quote=“vda, post:145, topic:169644”]Hi, Got a pb installing the plugin files. Need some support.

No drop down options list created ! Only Poll, Remove… nothing specific to sonos plugin as SetFileToPlay or Play…

Do you know how to check good upload of files ? I have Plugin 15 files with UI5.
Can you send me a capture of your device parameters if it works for you ?

Thx[/quote]

I got the same missing items in dropdown list on Vera Lite UI5 v1.5.346 with the Sonos trunk 15 files. I then tried the trunk 14 files from trunk-14_UIV5.zip that I found on page 7 of this other thread: http://forum.micasaverde.com/index.php/topic,8505.msg62780.html#msg62780
This fixed the problem for me and now I am happily using the Sonos plugin. Hope this helps.
Regards,
jtmoore.

I’m on UI4, followed the wiki instructions, and don’t have the proper ‘play’ options in the scene. Do I need different config files? help!

Thanks to jtmoore’s post above, I’ve now got the commands back in the “Advanced” scene creation page in UI5 (this may also solve Intrepid’s problem although he’s using UI4). There appears to be an issue with the Trunk 15 files?

Now to get the Sonos responding. Any tips on which of the three IP addresses I should be using (see my post of July 3)?

[quote=“mclass, post:149, topic:169644”]Thanks to jtmoore’s post above, I’ve now got the commands back in the “Advanced” scene creation page in UI5 (this may also solve Intrepid’s problem although he’s using UI4). There appears to be an issue with the Trunk 15 files?

Now to get the Sonos responding. Any tips on which of the three IP addresses I should be using (see my post of July 3)?[/quote]

Hi,

Glad you figured it out yourself. I only have UI4 myself and trunk 15 has not been made by me… I believe that it was made to make it compatiple with UI5.

Anyway - I do not have the setup you have, but pls test the various possibilities and report back. I can update the wiki with your findings.

regards,

Anker

[quote=“mclass, post:146, topic:169644”]I am also a little confused about which IP address I should be using - I have a Sonos Zone Bridge, with two Player 5’s paired as a stereo pair. Each device has its own IP address, and I am confused as to which of these I should be using. If I “unpair” the P5’s, I still get the three IP addresses.

Any assistance would be appreciated![/quote]

Mclass, you will need to enter in the settings tab the IP of the Sonos you want your new virtual ‘Device’ to control.

For example, I have 3 zones (players) at home, so have created 3 seperate Devices, each one represents the IP/Sonos I want Vera to control. E.g

Living Room Sonos = 192.186.1.230
Kitchen Sonos = 192.168.1.231
Bedroom Sonos = 192.168.1.232

As I also use my Sonos as a Siren, so it’s set up (for example) to work if a sensor is tripped in the kitchen, it will then play a specific track from the NAS (e.g. Who Let The Dogs Out ;). it works quite well, but can get annoying :wink: although it must be so much better than a bell or whistle going off …

* BTW - I’m joking about the track it plays just incase anyone believes me :wink:

Has anyone figured out how to play a specific radio/pandora station or playlist?

An idea for this might be that you put the stations streaming URL in as the value in the SetFileToPlay option? I’ve not tested it, but it might be worth a shot…

Or Sonos might store the radio channels in a file/folder structure e.g as a file/shortcut, therefore you would need to know the location and name of that file on Sonos

[quote=“parkerc, post:153, topic:169644”]An idea for this might be that you put the stations streaming URL in as the value in the SetFileToPlay option? I’ve not tested it, but it might be worth a shot…

Or Sonos might store the radio channels in a file/folder structure e.g as a file/shortcut, therefore you would need to know the location and name of that file on Sonos[/quote]

Interesting… Like this?;
https://sonos.custhelp.com/app/answers/detail/a_id/264/~/adding-internet-radio-stations-manually-to-sonos

Also found this interesting piece also.
http://pandatunes.com/add-pandora-stations-to-itunes/

And here is another one;

the ONLY problem I see (assuming this works) is that a dedicated PC or Mac will need to be running in order to serve up the playlist, right?
Does SONOS store the playlist locally so it can execute it, or does it rely on the playlist information to be stored on a network device like another PC?

Can anyone test it? I just got to work and cannot wait a full day to find the out come :slight_smile:

Thanks,

I just tried the options I posted and nothing seems to work. I can get the playlist to show up but it wont play. the ONLY thing I didnt try is linking a Streaming “WMA, MP3” Audio file to a playlist since I ran out of time. Hopefully there will be some progress on this. Seemed like Anker was close to a solution…

The Sonos plugin is great. I am using this to play door chime and phone ring based on events triggered in Vera.

Not sure if this is on the todo list already, but will the Sonos plugin enable me to get or query the current volume and other status information (e.g. Playing, Muted, Current Track, etc.). ? I am thinking that I would like to use the status to trigger powering on my amplifier if a Zone is playing. I am assuming that I would need to poll the status every minute or two in order to make respond in a useful time frame.

Are there any undocumented hooks in the Sonos plugin to query current status? If yes, then how could I call those particular get functions within some basic luup code please?

If this is just never going to work (due to upnp bugs that MCV still have not fixed…), then can anyone offer an alternative method? For example, can I install and run a watcher service on my ReadyNAS or Windows PC that could forward the upnp triggers to Vera (via simple http request) when the Sonos status changes?

[quote=“jtmoore, post:156, topic:169644”]The Sonos plugin is great. I am using this to play door chime and phone ring based on events triggered in Vera.

Not sure if this is on the todo list already, but will the Sonos plugin enable me to get or query the current volume and other status information (e.g. Playing, Muted, Current Track, etc.). ? I am thinking that I would like to use the status to trigger powering on my amplifier if a Zone is playing. I am assuming that I would need to poll the status every minute or two in order to make respond in a useful time frame.

Are there any undocumented hooks in the Sonos plugin to query current status? If yes, then how could I call those particular get functions within some basic luup code please?

If this is just never going to work (due to upnp bugs that MCV still have not fixed…), then can anyone offer an alternative method? For example, can I install and run a watcher service on my ReadyNAS or Windows PC that could forward the upnp triggers to Vera (via simple http request) when the Sonos status changes?[/quote]

Hi,

Am currently on vacation, so I cannot change anything right now… Anyway, I can see that the plugin is being used a lot, so I guess it is time to pdate it a bit…

  • the get volume and playstate is easy to implement, so will implement this
  • the radio, playlist should be fairly easy, just need to decide how to do this…
    • should there be a function i.e. SetPlaylistToPlay, SetRadioToPlay, etc… This would make it easy to make it compatible with the current version. Other option is to make the streaming type as a parameter…

Any thoughts or preferences about this?

Regards,

Anker

Hi Anker

I love the Sonos Plugin and I also use it for a (sort of) door bell, but also thanks to some downloaded sound effects and voice files i also have it play the role of a security siren, an audio countdown and an audio (voice) confirmation system. (very early stages but getting there).

Regarding development, your mios page suggested the following were on the roadmap, which I was quite excited about when I read them.

[ul][li]Autodiscovery of Zones
Autonaming of zone names
Select source (Playlist, Radio, Services, etc)
Status on what is playing etc. in GUI[/li][/ul]

Regarding how functions should be set by the plugin, I’m not sure how a parameter option would work compared to now, but keeping it all aligned to the current version, although for me the ‘toplay’ part could potentially be dropped from the option ‘setfiletoplay’ as you have to select the ‘Play’ option separately, (hence the steps are implied by the options available) so maybe setfile, setplaylist, setradio etc. would be better choices.

If I may add some ideas to the roadmap, I would like to see (many maybe for a very future release).

[ul][li]What is playing next in the UI
Sonos Device Icons (Connect, Play5 etc)
Track Look Up List (Save you having to type the full string every time)
Remote Contol integration into the AV section[/li][/ul]

* I can help with the icons, if you know the format etc.

I could go, but i don’t want to sound greedy as i know these things take time/effort - I just wish I had the skills :wink:

If you’re bored, maybe i could suggest a quick sideline and create what i hop is a simple on Siren Sonos Plugin, which acts as a seperate plugin, with its own Device icon, but is set to look/function as an alarm, so it points to a set siren mp3 file and plays that file out of all connected Sonos (via an iP listing) at a set volume .

[quote=“anker, post:150, topic:169644”][quote=“mclass, post:149, topic:169644”]Thanks to jtmoore’s post above, I’ve now got the commands back in the “Advanced” scene creation page in UI5 (this may also solve Intrepid’s problem although he’s using UI4). There appears to be an issue with the Trunk 15 files?

Now to get the Sonos responding. Any tips on which of the three IP addresses I should be using (see my post of July 3)?[/quote]

Hi,

Glad you figured it out yourself. I only have UI4 myself and trunk 15 has not been made by me… I believe that it was made to make it compatiple with UI5.

Anyway - I do not have the setup you have, but pls test the various possibilities and report back. I can update the wiki with your findings.

regards,

Anker[/quote]

Thanks for the encouragement! After a break away from Vera tinkering due to work, I have got the plugin to work using the Trunk 14 rather than the Trunk 15 files as suggested by others.

Rather than separate Sonos zones, I am using the Sonos standard feature of two Play 5’s bridged (wirelessly) to form a “stereo pair” in the one zone. These are connected to my network through a separate Sonos ethernet bridge. Each device (two Play 5’s and the bridge) has its own IP address, so the puzzle was to find out which of the three IP addresses “was in control”!!!

With some (a lot!!) of patience, I have discovered that one of the Play 5’s in the stereo pair appears to be the master (the correct one was found by trial and error), and entering the IP address of this master succeeded in getting the plug in operating. I have not been able to find a more scientific means of determining the master!!

In terms of future features, the “Set playlist” and “Set Radio” commands (extending the current format) would be top of my “most wanted” features, please!

I have also tested a limited number of the Sonos plugin controls (successfully!!) in SQ Blaster, so my dream of a truly integrated home system is looking better all the time!!. (BTW, and for your interest, ZWave in Australia operates on a different frequency to the US and Europe, so there’s only a limited number of “Oz-certified” devices filtering through so far, causing me some frustration)

Many thanks to Anker and all the others that have contributed to the development of this plugin, and I’m looking forward to future features!

Hi Anker.

I really appreciate you planning to update this Sonos plugin. In addition to implementing the Get functions, it would be good if we can resume the play or status of the previous queue after compling the setfiletoplay function. From what I read on the HouseBot forum, it should be possible to take note of the current playing track in the queue and then resume previous state (if required) once the setfiletoplay is completed. Such a resume function would need to adjust volume, mute status and set track in the queue (or a radio station etc.). For me, it would not matter if the track started from the begining, so no need to resume part way though a track.

In addition to using my Sonos to extend my door bell and phone ringer range, I also plan to use it as a Siren. Since I have multiple Sonos zones, it might be convenient if it was possible to group them or have the same siren sound across all zones in the event of a security alarm trigger.

Hope you are enjoying your vacation, and that you have lots of enery when you get back to update the Sonos plugin :wink:
Many thanks.

jtmoore.