Announcement

Collapse
No announcement yet.

Whats wrong with my script....

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

    Whats wrong with my script....

    Since I have used 1.5, Homeseer will not execute "Bed Time Shut Down" until it triggers "Enable Security"

    hs.TriggerEvent "Bed Time Shut Down"
    hs.mediafilename = "c:\Program files\homeseer\sounds\waves.mP3"

    hs.SetDeviceStatus "v6",2
    hs.waitsecs 200
    hs.TriggerEvent "Enable Security"

    THIS IS THE FULL SCRIPT>>>>>>>>>>>>>&g t;>>>>

    sub main()

    dim i


    ' exit if voice recognition is not enabled
    if hs.LastVoiceCommand="not enabled" then
    exit sub
    end if

    hs.speak "OK, when do you want me to wake you up?"


    ' clear out the last used voice command
    hs.LastVoiceCommand=""

    ' create voice commands
    hs.AddVoiceCommand "fiveuh clock"
    hs.AddVoiceCommand "six oh clock"
    hs.AddVoiceCommand "sevenuh clock"
    hs.AddVoiceCommand "eight oh clock"
    hs.AddVoiceCommand "Let me sleep in"
    hs.AddVoiceCommand "nevermind"

    ' wait for a voice command

    do
    i=hs.LastVoiceCommand
    if i<>"" then exit do
    hs.WaitEvents

    loop

    ' check recognition here

    select case i

    case "fiveuh clock"
    hs.EnableEvent "Wake UP at 5 am"
    hs.DisableEvent "Wake UP"
    hs.DisableEvent "Wake UP on Sunday"
    hs.DisableEvent "Wake UP at 7 am"
    hs.speak "OK, I will wake you at five oh clock tomorrow."


    case "six oh clock"
    hs.EnableEvent "Wake UP"
    hs.DisableEvent "Wake UP on Sunday"
    hs.DisableEvent "Wake UP at 7 am"
    hs.DisableEvent "Wake UP at 5 am"
    hs.speak "OK, I will wake you at six tomorrow."


    case "sevenuh clock"
    hs.EnableEvent "Wake UP at 7 am"
    hs.DisableEvent "Wake UP"
    hs.DisableEvent "Wake UP at 5 am"
    hs.DisableEvent "Wake UP on Sunday"
    hs.speak "See you at seven uh clock"


    case "eight oh clock"
    hs.EnableEvent "Wake UP on Sunday"
    hs.DisableEvent "Wake UP"
    hs.DisableEvent "Wake UP at 5 am"
    hs.DisableEvent "Wake UP at 7 am"
    hs.Speak "See you at eight o clock"


    case "Let me sleep in"
    hs.DisableEvent "Wake UP"
    hs.DisableEvent "Wake UP at 5 am"
    hs.DisableEvent "Wake UP on Sunday"
    hs.DisableEvent "Wake UP at 7 am"
    hs.Speak "OK, sleep well"
    hs.TriggerEvent "Bed Time Shut Down"

    case "nevermind"
    hs.Speak "OK, event cancelled"
    exit sub

    case else
    hs.speak "I did not hear you"
    exit sub
    end select

    hs.TriggerEvent "Bed Time Shut Down"
    hs.mediafilename = "c:\Program files\homeseer\sounds\waves.mP3"

    hs.SetDeviceStatus "v6",2
    hs.waitsecs 200
    hs.TriggerEvent "Enable Security"

    end sub

    #2
    Dave,
    I would try removing the line - hs.waitsecs 200
    and edit the line hs.TriggerEvent "Enable Security" to hs.DelayTrigger 200, "Enable Security"

    I have a similiar script and it runs fine

    Gene

    Comment

    Working...
    X