Announcement

Collapse
No announcement yet.

SonosController Plugin General Forum

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SonosController Plugin General Forum

    I'm glad to announce a new plug-in that controls Sonos players.

    I started as most of you, using the scripts that are available but soon ran into trouble when I tried to kick off other scripts that were triggered from this script. It was most likely my lack of understanding of all the great features these scripts already provide and my eagerness to challenge myself, so I wrote my own plug-in.

    Starting out just trying to get albumart in HSTouch screens, it quickly became an obsession and the plug-in now supports music browsing capabilities, TTS announcements, Speakerproxy functions, proper triggers and actions, linking and unlinking of zones.

    You can find it on the updater, I'm very motivated to add more features to it.

    Please post your comments, good or bad to this forum

    Dirk

    Find the latest Beta here (http://board.homeseer.com/showthread.php?t=144724)

    The current Help file you can find here and is of course part of the installer package
    Attached Files
    Last edited by dcorsus; December 28th, 2011, 03:22 AM. Reason: Latest Help file posted

  • #2
    Originally posted by dcorsus View Post
    I'm glad to announce a new plug-in that controls Sonos players.

    I started as most of you, using the scripts that are available but soon ran into trouble when I tried to kick off other scripts that were triggered from this script. It was most likely my lack of understanding of all the great features these scripts already provide and my eagerness to challenge myself, so I wrote my own plug-in.

    Starting out just trying to get albumart in HSTouch screens, it quickly became an obsession and the plug-in now supports music browsing capabilities, TTS announcements, Speakerproxy functions, proper triggers and actions, linking and unlinking of zones.

    You can find it on the updater, I'm very motivated to add more features to it.

    The plug in was extensively tested against Sonos SW R32, there is however a new SW version available and unfortunately, the Sonos engineers made some changes that rendered playing regular internet radio stations impossible and I'm in the process of fixing that.

    Fix should be available soon, but before I release a new version, I want to add support for the newly announced Sonos Wireless dock for iPod.

    While introducing the changes to support the WD100 Wireless Dock, I noted the following issues with v1.0.0.30:

    • plugin has the Balance setting Left/Right mixed up, is corrected in next release
    • I accidentally broke setting and toggling of Shuffle and Repeat modes. Is fixed in next release


    Please post your comments, good or bad to this forum

    Dirk

    I'm going to post the latest Beta on this posting but the latest official version can be downloaded from the updater
    This all sounds really awesome even though I don't have a SONOS system (yet). Been looking at something like this for a while, but don't relish the idea of all the HSTouch screen design work to make it happen. Do you have sample HSTouch screens as part of the plug-in package? That would really speed up the integration and likely reduce your support efforts if functional screen samples were provided. Just a thought.

    Just like the HSTouch iPhone app was a selling point for upgrading my HS system to HSPro, this plug-in availability may accelerate the SONOS purchase
    huggy_d1

    Automating made easy

    Comment


    • #3
      Originally posted by huggy_d1 View Post
      This all sounds really awesome even though I don't have a SONOS system (yet). Been looking at something like this for a while, but don't relish the idea of all the HSTouch screen design work to make it happen. Do you have sample HSTouch screens as part of the plug-in package? That would really speed up the integration and likely reduce your support efforts if functional screen samples were provided. Just a thought.

      Just like the HSTouch iPhone app was a selling point for upgrading my HS system to HSPro, this plug-in availability may accelerate the SONOS purchase
      The package includes a Music Template for this plug-in which shows, start/stop/pause/next/prev buttons, track and artist and album artwork.

      Only thing you have to do is copy it in the right HST Designer sub-directory and it will show up under "Custom" and you just drop it onto your screen, that's it. The plug-in also supports the standard HS MusicAPI, so the default music browser that comes with HST Designer works as well albeit it doesn't support Radio stations and now with the Wireless Dock + iPod combination, audiobooks and podcasts will be supported by the plug-in as well.

      Dirk

      Comment


      • #4
        Originally posted by huggy_d1 View Post
        This all sounds really awesome even though I don't have a SONOS system (yet). Been looking at something like this for a while, but don't relish the idea of all the HSTouch screen design work to make it happen. Do you have sample HSTouch screens as part of the plug-in package? That would really speed up the integration and likely reduce your support efforts if functional screen samples were provided. Just a thought.

        Just like the HSTouch iPhone app was a selling point for upgrading my HS system to HSPro, this plug-in availability may accelerate the SONOS purchase

        Here is an example by Mark Anderson, made with the plug-in and I believe the template or some part thereof. HST designer makes it easy to start from a custom template, make some changes to it and save it again as a music custom template. Then all you have to do is drop it x times on your screen where x is the number of players you have.
        Attached Files

        Comment


        • #5
          How to Print Out a Manual?

          I have downloaded the plugin got it working and found the help screens, but is there anyway to print out a manual?

          Comment


          • #6
            Originally posted by Toby Lankester View Post
            I have downloaded the plugin got it working and found the help screens, but is there anyway to print out a manual?
            Toby,

            I guess the help file must not be very descriptive because it is the manual.

            I did not describe in detail how to do standard HomeSeer actions, like creating events or do general scripting, you can find these things explained in the HomeSeer documentation. The help file does go into more detail where things are non-standard like the .ini file or how to set up announcements.

            If you let me know what you are looking for, I'd be more the happy to reply with an explanation and while doing so, understand which parts of the Help file could us more .... uhummm ... help

            Dirk

            Comment


            • #7
              I only had a quick look last night, but I could not work out how create an X10 triggered event that would link all zones into "party mode". Along the lines of; when the X10 code "A1 On" is received link all zones.

              Sorry if this is really obvious, I am sure once I get started it will all make sense.

              The other reason I was looking for more documentation was that I have often found that reading a manual shows me something can be done I had not thought of.

              Comment


              • #8
                Originally posted by Toby Lankester View Post
                but I could not work out how create an X10 triggered event that would link all zones into "party mode". Along the lines of; when the X10 code "A1 On" is received link all zones.

                Here goes ....

                go into the config file which you can find in the HS rootdirectory with subdirectory CONFIG

                In the HSPI_SONOSCONTROLLER.INI file add the following lines:

                [LinkgroupNames]
                Names=Party
                [LinkgroupZoneSource]
                Party =Patio;1
                [LinkgroupZoneDestination]
                Party =Master Bedroom|Family Room|Patio


                First of all; the [LinkgroupNames] part will create control buttons in HS under the UPNPMaster. You will have to restart HS for the buttons to show up but after you restart HS you will see two buttons: "Link - Party" and "Unlink - Party"


                Now go into HS, open the Event page, click add event, name the event something like "Party - On", go to trigger tab, select your X10 device and the "status - on", go to the action tab, click add action, select HS device action and set action to click the "Link - Party" button (going off memory here so the syntax might be a bit off).


                Now with respect to which zone should do what. The [LinkgroupZoneSource] section holds the info of which zone will be Master (meaning the music on that zone will stream to all the other linked zones). In the example above, I use the Patio as the Master/Source. Do note you have to put a ";" character behind the zone name to indicate you want to use it as a music source and not as an Audio Input source (the latter you would do for Announcements). If you omit the ";" character then the Sourcezone will switch to its audio-input port.


                In the [LinkgroupZoneDestination] section you add all the zones that need to be part of the linkgroup, you separate each one of them with a "|" character. If you want to preset the volume, you can do that as follows:


                Party =Master Bedroom;75|Family Room;50|Patio


                In this example, the Master Bedroom volume will be set to 75, the Family Room to 50 and the Patio left unchanged


                Note that when you "activate" the Link group configuration, the Plug-in will store all information such as queue info, track that was playing and where it was in the queue and track. If you now use the "Unlink" button, all zones will go back to what they were doing before you activated the Link.


                Hope this helps


                Dirk

                Comment


                • #9
                  Dirk, thanks for your help.

                  This is a lot harder than I thought it would be, I had assummed I would do everything within HS without the need to save stuff to the C drive of my HomeTroller II (which is a pain to do).

                  Given that we have 13 zones all with long names I thnik this is a weekend task rather than an after work one!!

                  What will happen if we add a new zone or rename an existing one, will we need to go to the HS rootdirectory and update everything there?

                  Comment


                  • #10
                    Originally posted by Toby Lankester View Post
                    This is a lot harder than I thought it would be, I had assummed I would do everything within HS without the need to save stuff to the C drive of my HomeTroller II (which is a pain to do).
                    It is intended to bring configurations of linked zones eventually under "on-line" control via the "config" web pages. Given its more dynamic nature (and my limited knowledge on HTML) it wasn't on top of my lists of things to do but you gave me extra motivation to raise its priority. So indeed for time being, you'll be needing NotePad or Wordpad and add manually some lines to the file

                    There is an option via the API to write your own scripts to manipulate these configurations without the need to reset HS, but it would still require you to store a script on the Hometroller and require you to know scripting. I wonder whether you can use the on-line HS command capabilities to update the configuration settings without the need to write anything on the Hometroller Drive, but now you need multiple-weekends unless you are a scripting guru.

                    Originally posted by Toby Lankester View Post
                    What will happen if we add a new zone or rename an existing one, will we need to go to the HS rootdirectory and update everything there?
                    Yes you would in either case. For new zones, doing this through on-line web config as described above would take away that pain, now your remark on renaming zones is an interesting one. I would assume it wouldn't happen very often but on the other hand, it wouldn't be too hard for the plugin to work with UDN (UniqueDeviceIdentifiers) rather then "Friendly Names" which would solve that problem. Unfortunately as long as I don't support "on-line configuration" it will make things really complex to do them manually. Do you change your names frequently? It wouldn't be to hard to support both ways ie use of Friendly names or UDN. It would mean though that now you need to write down the UDNs for each zone and then key them in manually into the config file.

                    Dirk

                    Comment


                    • #11
                      A couple of Linking issues

                      Need some explanation for how things are working, and may have found a bug.

                      I am running latest plugin, sonos v3.3,

                      I have 7 zones and I have setup grouping for 3 groups in ini file., device buttons show up.
                      here is a snip from my ini regarding the grouping:

                      [LinkgroupNames]
                      Names=Party|TTSALL|Core
                      [LinkgroupZoneSource]
                      TTSALL=HomeSeer
                      Party=Living Room;1
                      Core=Kitchen;1
                      [LinkgroupZoneDestination]
                      TTSALL=HomeSeer;45|Dining Room;40|Kitchen;40|Living Room;40|Master Bedroom;35|Bedroom|Office;35
                      Party=HomeSeer;45|Dining Room;40|Kitchen;40|Living Room;40|Master Bedroom;35|Bedroom|Office;35
                      Core=Kitchen;40|Dining Room;35|Living Room;35

                      I have a queue setup in the Living Room zone.

                      When I test device buttons the Link Party works, but shows this error in the homeseer log:

                      11/2/2010 10:14:14 PM - SONOSCONTROLLER - ERROR in PlaySongNow for zoneplayer = Living Room with UPNP Error = UPNP_E_INVALID_ARGUMENTS . URI=x-rincon:RINCON_000E5811101A01400, MetaData= Error =System.Runtime.InteropServices.COMException (0x80040208): A user-supplied component or subscriber raised an exception (Exception from HRESULT: 0x80040208) at UPNPLib.IUPnPService.InvokeAction(String bstrActionName, Object vInActionArgs, Object& pvOutActionArgs) at HSPI_SONOSCONTROLLER.ZonePlayerController.PlaySongNow(String URI, String MetaData)

                      unlinking the Party restores previous zone state.

                      When I test the link TTSALL ,it seperates all zone players. This is the group I have set to play from the HomeSeer output. when i unlink it reverts back to previous zone state.
                      It does change all zones to play from the Homeseer inputs so this is probably as it is programmed to work, just doesn't show up as a "linked group". Is this normal for line input?

                      When I test the link Core button, the grouping works fine but throws up the same error as the Party link. Unlink restores previous zone state. After it links the zones it doesn't do anything such as play the queue or is this the reason for the error message?

                      Next I created an Event which uses a device action from the Music UPNP Master to Link Core. Problem is when I test the event it Links the TTSALL instead of Core. I can see it running the wrong command in the homeseer log. When I choose Link TTSALL it linked the Party instead. Seems like the variables in the dropdown box were mapped incorrectly or something. Can you see if this can be duplicated? If you need any log files or debug info let me know.

                      One more question. What is the number following the ; when defining the [LinkgroupSource] for? I see you use a ;1 in your examples and say that the ; denotes play music, but I didn't notice an explanation for the 1.

                      I can see this plugin becomming very useful for me.

                      --
                      Alan

                      Comment


                      • #12
                        Originally posted by mbdirtfarmer View Post
                        11/2/2010 10:14:14 PM - SONOSCONTROLLER - ERROR in PlaySongNow for zoneplayer = Living Room with UPNP Error = UPNP_E_INVALID_ARGUMENTS . URI=x-rincon:RINCON_000E5811101A01400, MetaData= Error =System.Runtime.InteropServices.COMException (0x80040208): A user-supplied component or subscriber raised an exception (Exception from HRESULT: 0x80040208) at UPNPLib.IUPnPService.InvokeAction(String bstrActionName, Object vInActionArgs, Object& pvOutActionArgs) at HSPI_SONOSCONTROLLER.ZonePlayerController.PlaySongNow(String URI, String MetaData)

                        unlinking the Party restores previous zone state.

                        duh ... clearly a bug. I started writing the plug-in for TTS and in that case it was perfectly normal to have the zone which is connected to the Audio-input as part of your destination zone. I later added linking zones for music modes and in that case the source zone cannot be the destination zone, causes a bit of a loop you see. I'll add some code in the next release to allow you to add the source zone to the destination list because you may want to control the output volume. So in your case, remove (for time being) the "Living Room" from your destination zone list for Linkgroup named Party.In case of Core, the Kitchen is the offender. Thanks for pointing out this issue.


                        Originally posted by mbdirtfarmer View Post
                        It does change all zones to play from the Homeseer inputs so this is probably as it is programmed to work, just doesn't show up as a "linked group". Is this normal for line input?
                        For TTS mode this is indeed the way it was designed. All Zones are routed to the Audio Input of the Source Zone specified and automatically set to "Play". If you use the Speak action in HS and do the little $SONOS$TTSALL$ prefix, the plug-in should nicely switch all zones, speak and return them all to what they were doing. Note that restoring Internet radio stations can take few seconds (connecting and buffering) so restoring 10 zones all streaming internet radio could take a bit.


                        Originally posted by mbdirtfarmer View Post
                        When I test the link Core button, the grouping works fine but throws up the same error as the Party link. Unlink restores previous zone state. After it links the zones it doesn't do anything such as play the queue or is this the reason for the error message
                        Try this again after you removed Kitchen from the destination list for Linkgroup "Core"

                        Originally posted by mbdirtfarmer View Post
                        Next I created an Event which uses a device action from the Music UPNP Master to Link Core. Problem is when I test the event it Links the TTSALL instead of Core. I can see it running the wrong command in the homeseer log. When I choose Link TTSALL it linked the Party instead. Seems like the variables in the dropdown box were mapped incorrectly or something. Can you see if this can be duplicated? If you need any log files or debug info let me know.
                        Will look at this, I did try the buttons the other day, after I added the "Mute all"/"Unmute all" buttons the last minute. IJust looked at it, code was broken ... second bug


                        Originally posted by mbdirtfarmer View Post
                        One more question. What is the number following the ; when defining the [LinkgroupSource] for? I see you use a ;1 in your examples and say that the ; denotes play music, but I didn't notice an explanation for the 1.
                        The number "1" has no meaning (yet) and can be omitted, just the ";" is important. When your posting came in I was sweating over creating on-line configuration support for creating/modifying/deleting linkgroups so all the .ini mumbo jumbo will be hidden soon.

                        Thanks for taking the time to write this up, should have this straightened out within a few days.

                        Dirk
                        Last edited by dcorsus; November 3rd, 2010, 12:42 AM. Reason: Confirmed second bug

                        Comment


                        • #13
                          Originally posted by mbdirtfarmer View Post
                          .................and may have found a bug.

                          Version 1.0.0.32 posted to fix above issues

                          Dirk

                          Comment


                          • #14
                            Thanks for the prompt reply and fix. I will fix up my linkgroups in the ini and work on some events.
                            --
                            Alan

                            Comment


                            • #15
                              Originally posted by mbdirtfarmer View Post
                              Thanks for the prompt reply and fix. I will fix up my linkgroups in the ini and work on some events.
                              --
                              Alan

                              No need to change Linkgroups. V1.0.0.32 should take care of having the source zone in the destination zone list so you can set the volume for that zone as well. Let me know if you stumble on some other oddities or issues or perhaps have some ideas for the use of the ";1" indicator

                              Dirk

                              Comment

                              Working...
                              X