Announcement

Collapse
No announcement yet.

pre-announcement chime, link and unlink

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

    pre-announcement chime, link and unlink

    Great plug-in! I have setup Sonos to play a pre-announcement chime before ever announcement message. It is working but the unlink function gets messed up. I am not using any beta of the plug-in. Sonos V3.3

    For example, if the radio (or anything else) is playing and an announcement is needed... Sonos plays the wave file and the announcement is made. But the radio does not continue to play after the announcement. It will usually go back to the radio station but not play it. I think I know what is happening. Right after the chime is played it appears that the Sonos is about to play the radio again but then of course the announcement is made next. Before I added the chime the radio would return playing after announcements. These are my commands/scripst/logs:

    Device Command: Sonos SONOSCONTROLLER Music UPNP Master Value Set set to All Zones Mute Off Run script: &hs.speakex 60,"D:\shares\Music\Pre_announcementchimes\timbre1.wav" Run script: &hs.speakex 60, "please lock front door"
    05/11/2010 10:16:13 AM Event Event Trigger "Front door unlocked" 05/11/2010 10:16:13 AM Device Control Device: Sonos SONOSCONTROLLER Music UPNP Master ([1) Value set to 3 05/11/2010 10:16:13 AM Event Running script statement immediately: &hs.speakex 60,"D:\shares\Music\Pre_announcement chimes\timbre1.wav" 05/11/2010 10:16:13 AM SONOSCONTROLLER SetIOEx called for SONOSCONTROLLER Sonos Music UPNP Master, Cmd=19 05/11/2010 10:16:13 AM SONOSCONTROLLER SpeakIn announcement chimes\timbre1.wav, Wait=False, called for Device = 60, Text = D:\shares\Music\Pre_Host = 05/11/2010 10:16:13 AM SONOSCONTROLLER SpeakerProxy activated with Device = 0 Text = D:\shares\Music\Pre_announcement chimes\timbre1.wav and LinkgroupName = TTS 05/11/2010 10:16:13 AM SONOSCONTROLLER HandleLinking called with LinkgroupName = TTS and OnEvent = True 05/11/2010 10:16:14 AM SONOSCONTROLLER HandleLinking done with LinkgroupName = TTS and OnEvent = True 05/11/2010 10:16:18 AM SONOSCONTROLLER HandleLinking called with LinkgroupName = TTS and OnEvent = False 05/11/2010 10:16:19 AM SONOSCONTROLLER HandleLinking done with LinkgroupName = TTS and OnEvent = False 05/11/2010 10:16:19 AM Event Running script statement immediately: &hs.speakex 60, "please lock front door" 05/11/2010 10:16:19 AM SONOSCONTROLLER SpeakIn called for Device = 60, Text = please lock front door, Wait=False, Host = 05/11/2010 10:16:19 AM SONOSCONTROLLER SpeakerProxy activated with Device = 0 Text = please lock front door and LinkgroupName = TTS 05/11/2010 10:16:19 AM SONOSCONTROLLER HandleLinking called with LinkgroupName = TTS and OnEvent = True 05/11/2010 10:16:22 AM Device Update Device: Z-Wave Z-Wave Interface Dinning Rm Luminance value set to 58 (5800/%) 05/11/2010 10:16:22 AM SONOSCONTROLLER HandleLinking done with LinkgroupName = TTS and OnEvent = True 05/11/2010 10:16:22 AM TTS Speak: ()lease lock front door 05/11/2010 10:16:24 AM SONOSCONTROLLER HandleLinking called with LinkgroupName = TTS and OnEvent = False 05/11/2010 10:16:24 AM SONOSCONTROLLER HandleLinking done with LinkgroupName = TTS and OnEvent = False

    To fix this, is there a way to create the script so that the Sonos is linked and wait until both the chime and announcement are done and then unlink the Sonos?
    Note. I noticed if the zone player is muted the announcement would be muted also. That is why I use the command for All zones mute off. Is there a command to just turn off the mute on the zone player that is doing the announcement?

    Deon

    #2
    Originally posted by w0012979 View Post
    To fix this, is there a way to create the script so that the Sonos is linked and wait until both the chime and announcement are done and then unlink the Sonos?
    There is a way to do this through scripting. Instead of using the spreakerproxy function of the plug-in, you would actually not use Speaker proxy at all (that means either turn flag of, or not use the special prefix or special device code).
    Your script would trigger a device action which is "Link - xxxx" which is a button under the UPNP Master device
    Then your script has to wait for LinkgroupState to become true. You do this by calling the SonosTTSWait.vb (which the installer put on your PC in the hsroot\Scripts directory) and call the Function WaitForTTS function. The function will return as soon as the plug-in has established the linked configuration (alternatively you can just add a wait to your script). Now you do all the speaker actions that you would like to do. Once done you generate one more event which is the Unlinking of the TTS zone.

    What will be more user friendly is that I allow Multiple actions to be grouped in one SpeakerEx command so the plug-in will play them sequentially. Multiple actions for example separated by a "|" character. I'll add it to the list of feature requests


    Originally posted by w0012979 View Post
    Note. I noticed if the zone player is muted the announcement would be muted also. That is why I use the command for All zones mute off. Is there a command to just turn off the mute on the zone player that is doing the announcement?
    Deon
    I thought about this one to, but decided that if the zone is muted, the user doesn't want music neither announcements. There is a unmute-all button which you can call from a script. Now the trick is when to call it. If you were to script everything as above, you can call unmute after the link operating, then do the announcements. If you now activate the Unlink function, remember the plug-in will store state as before the Link action was done, that means that any zone that was initially muted will (should :-)) go back to mute.
    I can see another configurable option here to "overrule" a muted zone or not but as I wrote, I can see people creating scripts, events and actions but then when they want to exclude a zone, they can just mute it and the zone will not be disturbed by anything as opposed to changing the configuration each time

    Dirk

    Comment


      #3
      I have done this. Thanks. It seems to work ok but I get an error in the log. What does it mean?

      05/11/2010 10:08:13 PM Event Event Trigger "Garage door unlocked"
      05/11/2010 10:08:13 PM Device Control Device: Sonos SONOSCONTROLLER Music UPNP Master ([1) Value set to 3
      05/11/2010 10:08:13 PM Device Control Device: Sonos SONOSCONTROLLER Music UPNP Master ([1) Value set to 6
      05/11/2010 10:08:13 PM Event Running script in background: SonosTTSWait.vb
      05/11/2010 10:08:13 PM Error 1 Running script SonosTTSWait.vb :method not found
      05/11/2010 10:08:13 PM SONOSCONTROLLER SetIOEx called for SONOSCONTROLLER Sonos Music UPNP Master, Cmd=19
      05/11/2010 10:08:13 PM SONOSCONTROLLER SetIOEx called for SONOSCONTROLLER Sonos Music UPNP Master, Cmd=19
      05/11/2010 10:08:13 PM SONOSCONTROLLER HandleLinking called with LinkgroupName = TTS and OnEvent = True
      05/11/2010 10:08:14 PM SONOSCONTROLLER HandleLinking done with LinkgroupName = TTS and OnEvent = True
      05/11/2010 10:08:18 PM TTS Speak ()lease lock the garage door
      05/11/2010 10:08:20 PM SONOSCONTROLLER SetIOEx called for SONOSCONTROLLER Sonos Music UPNP Master, Cmd=19
      05/11/2010 10:08:20 PM SONOSCONTROLLER HandleLinking called with LinkgroupName = TTS and OnEvent = False
      05/11/2010 10:08:20 PM Device Control Device: Sonos SONOSCONTROLLER Music UPNP Master ([1) Value set to 7
      05/11/2010 10:08:37 PM SONOSCONTROLLER HandleLinking done with LinkgroupName = TTS and OnEvent = False

      Event action:

      Device Command:
      Sonos SONOSCONTROLLER Music UPNP Master Value Set set to All Zones Mute Off
      Device Command:
      Sonos SONOSCONTROLLER Music UPNP Master Value Set set to Link-TTS
      Run script:
      SonosTTSWait.vb
      Speak and wait:
      D:\shares\Music\Pre_announcement chimes\timbre1.wav
      Speak and wait:
      please lock the garage door
      Device Command:
      Sonos SONOSCONTROLLER Music UPNP Master Value Set set to Unlink-TTS

      Deon

      Comment


        #4
        Originally posted by w0012979 View Post
        I have done this. Thanks. It seems to work ok but I get an error in the log. What does it mean?

        05/11/2010 10:08:13 PM Error 1 Running script SonosTTSWait.vb :method not found
        Deon,

        the script needs an input as to the Method. Your screen should look something like this and I would reverse your mute command with the ttson so you will go back to the original state after TTS, including muting zones
        Attached Files

        Comment


          #5
          Originally posted by w0012979 View Post
          I have setup Sonos to play a pre-announcement chime before ever announcement message.
          is there a way to create the script so that the Sonos is linked and wait until both the chime and announcement are done and then unlink the Sonos?
          Deon,

          if you can wait, I have already added to v 1.0.0.36 the capability to pass a concatenated string into the speakerproxy and then the plug-in will link, play or say each piece of announcement and when all announcements are done, unlink. I wanted to add a few more things before I release v1.0.0.36 but if you cannot wait email me and I'll email you an updated dll.

          Dirk

          Comment

          Working...
          X