Announcement

Collapse
No announcement yet.

Delay Action Not Working

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

    Delay Action Not Working

    I am trying to create an event (scripted) that when my wife turns on her music in the bathroom in the morning it first plays the weather for her. It's randomly working though. Seems that sometimes the script waits for the speech to finish before moving forward, and other times it just plain runs thru it, ignoring the delay I have in there.

    I am using this from the doc to create the delay. Am I using it wrong?

    Code:
    hs.PluginFunction("BLSpeech", "", "ContinueAfterSpeaking", Nothing)
    Code:
    Sub Main (Parms as Object)
    Try
    dim House_Mode as String = hs.devicestring(1060)
    Dim Weather as string = hs.devicestring(756)
    dim playerInstance as string
    dim Args(1) as object
    playerInstance = "Player_b827ebb275f9"
    Args(0) = "pandora playlist play item_id:6799a2a7.0.0"
    Args(1) = False
    hs.PluginFunction("BLRussound", "", "SetZonePower", New Object(){1,5,"On"})
    System.Threading.Thread.CurrentThread.Sleep(1000)
    If House_Mode = "Sleep" OrElse House_Mode = "Dawn" OrElse House_Mode = "Morning" then
        hs.speak ("{speaker=Bathroom,volume=28, source=2} " & Weather, True)
        hs.PluginFunction("BLSpeech", "", "ContinueAfterSpeaking", Nothing)
    Else
        hs.speak ("{speaker=Bathroom,volume=40, source=2} " & Weather, True)
        hs.PluginFunction("BLSpeech", "", "ContinueAfterSpeaking", Nothing)
    End If
        hs.PluginFunction("BLRussound", "", "SetZoneSource", New Object(){1,5,5})
        hs.PluginFunction("SqueezeBox", playerInstance, "PlayerSendCLICommand", Args)
        Catch ex As Exception
    hs.WriteLog("Pandora Weather Script", "Exception " & ex.ToString)
    End Try
    End Sub

    #2
    Not sure if it's related, but this also always returns false:

    Code:
    Dim isSpeaking As Boolean = hs.PluginFunction("BLSpeech", "", "IsHomeseerSpeaking", Nothing)
    Even when speech is actively happening.

    Edit: Does Appear to be related when looking at the logs. Returns false when it checks.
    Attached Files
    Last edited by waynehead99; April 18, 2016, 01:30 PM.

    Comment


      #3
      Tried the event in the screenshot as well. This doesn't work either. The lights flashed immediately well the voice was speaking.

      No one else is seeing this? I am running the latest versions of both BLSpeech and BLRussound.
      Attached Files

      Comment

      Working...
      X