Announcement

Collapse
No announcement yet.

Sonos *Real-time* Script Library

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Sonos *Real-time* Script Library

    I am calling this library the Sonos Realtime Script Library (SRSL). Please try it and share feedback.

    MichaelD inspired me with his Sonos script library. He demonstrated the potential of Sonos integration with Homeseer. However, his scripts lacked a few features that I really wanted and that many people on the Homeseer forums have been requesting for a while. So, I started hacking a few weeks ago and decide that my script library is sufficiently stable that perhaps others are willing to use it / test it.

    The two main features it has which are lacking in MichaelD's scripts are
    1) real-time updates without polling -- each zone player has a single virtual device in Homeseer that is set any time the zone player's properties change. For example, if a zone player is stopped, HS will know, and you can turn off your amplifier.

    2) in addition to using the scripts to temporarily route Homeseer TTS over your Sonos network, you can also use them to route another line-input over the Sonos network. In my case, I use this with the output of a Gentner AP10 to enable hands-free full-room speaker phones in every room of my house (I have in-wall microphones and in-ceiling speakers in each room to make this happen).

    Check the release notes in the attached ZIP file for a chronology of the features added over time.

    If you have questions, please read the documentation (MS-Word format) included in the attached ZIP. Among other things, it delineates the full functionality of the script library. Thanks!
    Attached Files
    Last edited by jerny; April 2, 2009, 10:40 PM. Reason: Updated ZIP file

    #2
    Minor update to v0.91

    Woops. If anyone tried it already, I apologize. I uploaded the wrong version. I just replaced it with a corrected one. Thanks

    Comment


      #3
      Excitement turns to sadness ...

      <TABLE cellSpacing=2 cellPadding=0 width="100%" border=0><TBODY><TR><TD class=LOGDateTime0 noWrap align=left>9/17/2007 5:58:18 PM </TD><TD class=LOGType0 align=left colSpan=3>Info </TD><TD class=LOGEntry0 align=left colSpan=8>Event Trigger "Startup - Debug"</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/17/2007 5:58:18 PM </TD><TD class=LOGType1 align=left colSpan=3>Info </TD><TD class=LOGEntry1 align=left colSpan=8>Running script in background: startup.txt</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/17/2007 5:58:18 PM </TD><TD class=LOGType0 align=left colSpan=3>Startup </TD><TD class=LOGEntry0 align=left colSpan=8>Scripting is OK</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/17/2007 5:58:19 PM </TD><TD class=LOGType1 align=left colSpan=3>Error </TD><TD class=LOGEntry1 align=left colSpan=8>Running script, script run or compile error in file: Sonos.vbh5:Invalid procedure call or argument: 'hs.WriteLog' in line 686 More info: Invalid procedure call or argument: 'hs.WriteLog'</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/17/2007 5:58:19 PM </TD><TD class=LOGType0 align=left colSpan=3>Sonos </TD><TD class=LOGEntry0 align=left colSpan=8>Error: HS variable SonosDebugLevel has not been set</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/17/2007 5:58:19 PM </TD><TD class=LOGType1 align=left colSpan=3>aaaSonos </TD><TD class=LOGEntry1 align=left colSpan=8>Error: HS variable ZPCount has not been set</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/17/2007 5:58:19 PM </TD><TD class=LOGType0 align=left colSpan=3>Sonos </TD><TD class=LOGEntry0 align=left colSpan=8>Error: HS variable ZPCount has not been set</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/17/2007 5:58:19 PM </TD><TD class=LOGType1 align=left colSpan=3>aaaSonos </TD><TD class=LOGEntry1 align=left colSpan=8>Cannot access SRSL state variables. Init may not have been completed. Try calling Init() again</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/17/2007 5:58:19 PM </TD><TD class=LOGType0 align=left colSpan=3>Sonos </TD><TD class=LOGEntry0 align=left colSpan=8>Cannot access SRSL state variables. Init may not have been completed. Try calling Init() again</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/17/2007 5:58:19 PM </TD><TD class=LOGType1 align=left colSpan=3>Error </TD><TD class=LOGEntry1 align=left colSpan=8>Running script, script run or compile error in file: Sonos.vbh13:Type mismatch: 'ZPCount' in line 1579 More info: Type mismatch: 'ZPCount'</TD></TR></TBODY></TABLE>

      HomeSeer version 2.2.0.11 Starting Now (Standard Build)
      Windows XP SP2

      Any ideas ? REALLY loking forward to using this plugin for realtime

      Comment


        #4
        Hmm. Just noticed in the docs the realtime status doesnt actually give you a status - a technical misnomer !

        This plugin wont help me in that case - all I need to know is if the zoneplayer has been played, paused, or stopped - THEN I can control the amp .

        How can I control the amp if i dont know if you are trying to start or stop a zp ?

        Comment


          #5
          Woops

          Originally posted by TBG View Post
          Hmm. Just noticed in the docs the realtime status doesnt actually give you a status - a technical misnomer !

          This plugin wont help me in that case - all I need to know is if the zoneplayer has been played, paused, or stopped - THEN I can control the amp .

          How can I control the amp if i dont know if you are trying to start or stop a zp ?
          From your log, it looks like I may have posted the wrong version again. I'l double check when I get home tonight.

          When you get a real-time update, you can then query the library to find out if a zone player is playing, paused or stopped. So, every time you get an update, just run the querty to find out what status has changed. It should work. Sorry about the bugs. I'll get them addressed shortly and post a new ZIP file.

          Comment


            #6
            No way oif just having a status update say the play state rather than having to go out and query it ?

            Comment


              #7
              Stupid error corrected

              Originally posted by TBG View Post
              No way oif just having a status update say the play state rather than having to go out and query it ?
              I posted a v0.92 to correct the idiotic bug I left in the prior posting. I foolishly made a small tweak AFTER I finished testing and failed to test again after the tweak. Now it should work fine for you.

              With regard to the interface for getting an updated zoneplayer state, I could create a virtual device just to monitor play state, but that's a weekend effort. For now, this simple script snippet should do the trick for you


              in startup.txt, immediately after running "Updateson" in sonos.vbh, include this snippet:
              dim a
              hs.createvar "ZPState"
              a = hs.RunEX("Sonos.vbs","GetProperty","zpname|transportstate")
              'change zpname to the zone player name you want to monitor in the prior line
              hs.savevar "ZPState", a

              create a script called updatestate.txt, that is triggered to run by an event anytime there is a change to the 'status change' virtual device of the corresponding ZP:
              Dim newstate, oldstate
              oldstate = hs.getvar ("ZPState")
              newstate = hs.RunEX("Sonos.vbh","GetProperty","zpname|transportstate")
              hs.savevar "ZPState", newstate
              if newstate <> oldstate THEN
              do whatever you want to do
              END IF

              That should do it. If there is popular demand to create a new set of virtual devices that simply monitors the transportstate of each zone, I can create them, but the above seems like a pretty easy approach and avoids the need to create tons of virtual devices in HS.

              Let me know how it goes.

              Comment


                #8
                OK, great - bit more success but more errors below.

                As for state changes, I'm still thinking a virtual device for each ZP it finds, with a variable for it's current state would be preferable - then I can use the HS quick commands or simpler scripts to trigger things. Essentially, once a state change has occurred, if it's start, then i send a flag to the alarm connectec to homeseer and it controls all the amp/plasma/etc switching - all solid state stuff. If you have a status flag of start, stop, etc, then a value of 0, 1, 2 associated with that can be used to directly set a flag in the alarm with limited script.

                <TABLE cellSpacing=2 cellPadding=0 width="100&#37;" border=0><TBODY><TR><TD class=LOGDateTime0 noWrap align=left>9/18/2007 8:39:56 AM </TD><TD class=LOGType0 align=left colSpan=3>SONOS Info </TD><TD class=LOGEntry0 align=left colSpan=8>Searching for Zone Players</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/18/2007 8:40:06 AM </TD><TD class=LOGType1 align=left colSpan=3>SONOS Info </TD><TD class=LOGEntry1 align=left colSpan=8>Zone Player discovery completed: 6 Zone Players found</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/18/2007 8:40:06 AM </TD><TD class=LOGType0 align=left colSpan=3>Sonos </TD><TD class=LOGEntry0 align=left colSpan=8>Sonos Real-time Script Library (SRSL) version 0.92 beta is initializing...</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/18/2007 8:40:06 AM </TD><TD class=LOGType1 align=left colSpan=3>Sonos </TD><TD class=LOGEntry1 align=left colSpan=8>Operating with authorized TRIAL license key for Trial Username.</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/18/2007 8:40:06 AM </TD><TD class=LOGType0 align=left colSpan=3>Sonos </TD><TD class=LOGEntry0 align=left colSpan=8>Searching for zone players. This can take as long as 10 seconds.</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/18/2007 8:40:16 AM </TD><TD class=LOGType1 align=left colSpan=3>Sonos </TD><TD class=LOGEntry1 align=left colSpan=8>UPnP discovery complete: 6 zone players were found.</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/18/2007 8:40:16 AM </TD><TD class=LOGType0 align=left colSpan=3>Sonos </TD><TD class=LOGEntry0 align=left colSpan=8>Found zone player: Millie's Room with uuid:RINCON_000000000000000</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/18/2007 8:40:17 AM </TD><TD class=LOGType1 align=left colSpan=3>Database Item </TD><TD class=LOGEntry1 align=left colSpan=8>Saving Device EnSuite Status Change</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/18/2007 8:40:18 AM </TD><TD class=LOGType0 align=left colSpan=3>Error </TD><TD class=LOGEntry0 align=left colSpan=8>Running script, script run or compile error in file: Sonos.vbh438:Object doesn't support this property or method: 'hs.SetDeviceValueByNameByName' in line 822 More info: Object doesn't support this property or method: 'hs.SetDeviceValueByNameByName'</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/18/2007 8:40:18 AM </TD><TD class=LOGType1 align=left colSpan=3>Database Item </TD><TD class=LOGEntry1 align=left colSpan=8>Saving Device EnSuite Status Change</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/18/2007 8:40:19 AM </TD><TD class=LOGType0 align=left colSpan=3>Database Item </TD><TD class=LOGEntry0 align=left colSpan=8>Saving Device EnSuite TTS Vol</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/18/2007 8:40:19 AM </TD><TD class=LOGType1 align=left colSpan=3>Sonos </TD><TD class=LOGEntry1 align=left colSpan=8>Error: HS variable SonosDebugLevel has not been set</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/18/2007 8:40:19 AM </TD><TD class=LOGType0 align=left colSpan=3>Database Item </TD><TD class=LOGEntry0 align=left colSpan=8>Saving Device EnSuite TTS Vol</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/18/2007 8:40:19 AM </TD><TD class=LOGType1 align=left colSpan=3>Sonos </TD><TD class=LOGEntry1 align=left colSpan=8>Error: HS variable ZPCount has not been set</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/18/2007 8:40:19 AM </TD><TD class=LOGType0 align=left colSpan=3>Sonos </TD><TD class=LOGEntry0 align=left colSpan=8>Cannot access SRSL state variables. Init may not have been completed. Try calling Init() again</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/18/2007 8:40:19 AM </TD><TD class=LOGType1 align=left colSpan=3>Error </TD><TD class=LOGEntry1 align=left colSpan=8>Running script, script run or compile error in file: Sonos.vbh13:Type mismatch: 'ZPCount' in line 1580 More info: Type mismatch: 'ZPCount'</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/18/2007 8:40:19 AM </TD><TD class=LOGType0 align=left colSpan=3>Error </TD><TD class=LOGEntry0 align=left colSpan=8>Running script: File not found: Sonos.vbs</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/18/2007 8:40:20 AM </TD><TD class=LOGType1 align=left colSpan=3>Database Item </TD><TD class=LOGEntry1 align=left colSpan=8>Saving Device EnSuite Phone Vol</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/18/2007 8:40:20 AM </TD><TD class=LOGType0 align=left colSpan=3>Database Item </TD><TD class=LOGEntry0 align=left colSpan=8>Saving Device EnSuite Phone Vol</TD></TR></TBODY></TABLE>
                Last edited by TBG; September 18, 2007, 07:42 AM.

                Comment


                  #9
                  Another fixed posted

                  I posted another fix. It looks like you're also still using the old .WSC and the old startup.txt additions. Please replace everything with the new versions in the new ZIP.

                  Comment


                    #10
                    Done.

                    Only thing is, I'm not getting a ZPState variable and therefore nowt happens when the state changes of the specificed ZP. The script you said to add to the startup.txt was :

                    dim a
                    hs.createvar "ZPState"
                    a = hs.RunEX("Sonos.vbh","GetProperty","living room|transportstate")
                    'change zpname to the zone player name you want to monitor in the prior line
                    hs.savevar "ZPState", a


                    By increasing the debug to 3, I can see these events happening each time I press play/pause on the DCR - so it looks like it is detecting a change, but there's no ZPState device for it to apply to, and therefore I cannot trigger anything from

                    9/19/2007 10:28:23 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:23 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:24 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:24 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:24 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:25 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:25 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:26 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:26 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:26 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:27 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:27 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:28 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:28 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:28 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:29 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:29 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:29 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:30 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:30 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:31 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:31 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:31 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:32 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:32 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:28:32 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:29:30 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:29:33 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:29:35 AM Sonos HS variables retrieved successfully in getControlSettings
                    9/19/2007 10:29:38 AM Sonos HS variables retrieved successfully in getControlSettings
                    Last edited by TBG; September 19, 2007, 04:24 AM.

                    Comment


                      #11
                      Originally posted by TBG View Post
                      Done.

                      Only thing is, I'm not getting a ZPState variable and therefore nowt happens when the state changes of the specificed ZP. The script you said to add to the startup.txt was :

                      dim a
                      hs.createvar "ZPState"
                      a = hs.RunEX("Sonos.vbh","GetProperty","living room|transportstate")
                      'change zpname to the zone player name you want to monitor in the prior line
                      hs.savevar "ZPState", a
                      First, are you making it through the Init function okay? Does it discover all of your zone players?

                      Second, if you add this line to the startup script just before the hs.savevar line, what shows up in the log? (It should show you the transportstate (play,pause or stop) of the zone player named living room)
                      hs.writelog "Sonostest",a

                      Originally posted by TBG View Post
                      By increasing the debug to 3, I can see these events happening each time I press play/pause on the DCR - so it looks like it is detecting a change, but there's no ZPState device for it to apply to, and therefore I cannot trigger anything from
                      What is happening to the virtual device called Living Room Status Change? If you trigger an event on the change of this device, you can monitor what is happening to the zone player.

                      Comment


                        #12
                        Lounge Status Change doesnt appear to change if i keep pressing play/pause. Perhaps all it needs it this ZPState virtual zone fixing - it never gets created.

                        Logs from a fresh startup with the changes you mentioned :

                        <TABLE cellSpacing=2 cellPadding=0 width="100&#37;" border=0><TBODY><TR><TD class=LOGDateTime0 noWrap align=left>9/19/2007 6:25:48 PM </TD><TD class=LOGType0 align=left colSpan=3>SONOS Info </TD><TD class=LOGEntry0 align=left colSpan=8>Zone Player discovery completed: 6 Zone Players found</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/19/2007 6:25:49 PM </TD><TD class=LOGType1 align=left colSpan=3>Sonos </TD><TD class=LOGEntry1 align=left colSpan=8>Sonos Real-time Script Library (SRSL) version 0.93 beta is initializing...</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/19/2007 6:25:49 PM </TD><TD class=LOGType0 align=left colSpan=3>Sonos </TD><TD class=LOGEntry0 align=left colSpan=8>Operating with authorized TRIAL license key for Trial Username.</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/19/2007 6:25:49 PM </TD><TD class=LOGType1 align=left colSpan=3>Sonos </TD><TD class=LOGEntry1 align=left colSpan=8>Searching for zone players. This can take as long as 10 seconds.</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/19/2007 6:25:58 PM </TD><TD class=LOGType0 align=left colSpan=3>Sonos </TD><TD class=LOGEntry0 align=left colSpan=8>UPnP discovery complete: 6 zone players were found.</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/19/2007 6:25:59 PM </TD><TD class=LOGType1 align=left colSpan=3>Sonos </TD><TD class=LOGEntry1 align=left colSpan=8>Found zone player: Millie's Room with uuid:RINCON_00000000000000000</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/19/2007 6:25:59 PM </TD><TD class=LOGType0 align=left colSpan=3>Sonos </TD><TD class=LOGEntry0 align=left colSpan=8>Found zone player: EnSuite with uuid:RINCON_00000000000000000</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/19/2007 6:26:00 PM </TD><TD class=LOGType1 align=left colSpan=3>Sonos </TD><TD class=LOGEntry1 align=left colSpan=8>Found zone player: Gym with uuid:RINCON_00000000000000000</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/19/2007 6:26:01 PM </TD><TD class=LOGType0 align=left colSpan=3>Sonos </TD><TD class=LOGEntry0 align=left colSpan=8>Found zone player: Dining Room with uuid:RINCON_00000000000000000</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/19/2007 6:26:02 PM </TD><TD class=LOGType1 align=left colSpan=3>Sonos </TD><TD class=LOGEntry1 align=left colSpan=8>Found zone player: Kitchen with uuid:RINCON_00000000000000000</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/19/2007 6:26:03 PM </TD><TD class=LOGType0 align=left colSpan=3>Sonos </TD><TD class=LOGEntry0 align=left colSpan=8>Found zone player: Lounge with uuid:RINCON_00000000000000000</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/19/2007 6:26:04 PM </TD><TD class=LOGType1 align=left colSpan=3>Sonos </TD><TD class=LOGEntry1 align=left colSpan=8>- TTS line input found on Kitchen zone player as "HomeSeer Announce"</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/19/2007 6:26:04 PM </TD><TD class=LOGType0 align=left colSpan=3>Sonos </TD><TD class=LOGEntry0 align=left colSpan=8>- Phone line input "Phone" not found</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/19/2007 6:26:04 PM </TD><TD class=LOGType1 align=left colSpan=3>Sonos </TD><TD class=LOGEntry1 align=left colSpan=8>SRSL initialization complete.</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/19/2007 6:26:05 PM </TD><TD class=LOGType0 align=left colSpan=3>Sonos </TD><TD class=LOGEntry0 align=left colSpan=8>SRSL real-time updates turned on.</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/19/2007 6:26:05 PM </TD><TD class=LOGType1 align=left colSpan=3>Sonostest </TD><TD class=LOGEntry1 align=left colSpan=8>Pause</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/19/2007 6:26:05 PM </TD><TD class=LOGType0 align=left colSpan=3>Info </TD><TD class=LOGEntry0 align=left colSpan=8>Finished initializing scripting</TD></TR><TR><TD class=LOGDateTime1 noWrap align=left>9/19/2007 6:26:05 PM </TD><TD class=LOGType1 align=left colSpan=3>Startup </TD><TD class=LOGEntry1 align=left colSpan=8>Starting scheduler</TD></TR><TR><TD class=LOGDateTime0 noWrap align=left>9/19/2007 6:26:05 PM </TD><TD class=LOGType0 align=left colSpan=3>Startup </TD><TD class=LOGEntry0 align=left colSpan=8>Start up complete.</TD></TR></TBODY></TABLE>

                        Comment


                          #13
                          Are you sure? When you are on the HS devices page in your web browser and hit F5 to refresh the page, does that Lounge Status Change device show its value as Changed or Unchanged?

                          Comment


                            #14
                            It says Changed but the time is when I start HS.

                            Thereafter it never changes. And I wouldnt expect it to according to your docs - it will only change if I go and GET the property. And I only GET the property once the zpstate has changed so i can fire off the script.

                            Comment


                              #15
                              No, that's not how it works.

                              The value of the virtual device will change IN REALTIME from "Unchanged" to "Changed" any time the status of the zone player changes. There are a lot of things that will cause the status of the zone player to change. It changes when the song/track changes. It changes when the volume changes. It changes when the zone player is stopped. etc.

                              In order to figure out what changed, you need to use Getproperty. The time to call Getproperty is when the virtual device goes from unchanged to changed. Calling Getproperty automatically flips the virtual device value from changed back to unchanged. As an aside, calling Getproperty should take no time flat because the zone player automatically keeps its entire status up to date in my COM object (so there is no upnp communication triggered by GetProperty).

                              Make sense?

                              Comment

                              Working...
                              X