Announcement

Collapse
No announcement yet.

Voice Recognition Response Scripts??

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

    Voice Recognition Response Scripts??

    Hey Everyone,
    I don't know if I have found the correct place to post this question but so far this seems to be the best spot I could find. First let me say I am a complete newbie to scripting. I am still researching through the manual and other information I can find but there are still a couple areas of Voice Recognition I am having trouble figuring out. Here is what I want to do.

    IMO the best feature about a home automation panel is the ability to have it monitor various items and alert me to their status. I don't want to have to remember to ask HS if a certain action has been performed or to report the status of a device. I want HS to alert me of the status and then ask what I would like it to do. So far my thinking for implementing this goes something like this.

    Based on a specific trigger, HS speaks an announcement to a specific host. HS then uses the GetListenStatus to verify the host is listening. If host is not listening then it uses the StartListen command to set the host to Listen. (does this still require the "attention" phrase to be spoken before HS is actually listening for commands?)

    The phrase spoken by HS would end with a question that would require the person to respond to direct HS which action to take next. My though would be somehow creating a temp variable that HS would store and set based on the response, very much the same way it ask whether the event that was spoken was the correct event for verification.

    Example of this would be in the morning my "I'm Awake" event starts and HS would run through its normal sequence of events and then ask "Would you like me to make a pot of coffee now or should I wait until later?" Granted the answer would always be RIGHT NOW, the option to say no and have HS respond accordingly is badly desired. This would be great for "You have a new Email, Would you like me to read it to now?", "Motion Detected, Should I remind the kids it is past there bedtime?", etc....

    Any help or advice on functions or procedures I should use to accomplish this would be helpful. Thanks Alot

    #2
    Here is what I am using...

    This is a simple bedtime script that I use. I trigger it with "Time for bed" and this script gets intitiated.It should wait for your response. You can easily modify it to your needs.


    'This script will ask you when you want to wake up. Given your response it will
    'enable\disable the appropriate events and wake you up the next day on time.


    sub main()

    dim i

    system.speak "OK, when do you want me to wake you up?" '==============WILL WAIT HERE

    ' 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"


    do

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

    loop


    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"
    system.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"
    system.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"
    system.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"
    system.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"
    system.Speak "OK, sleep well"


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

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

    hs.TriggerEvent "Bed Time Shut Down"
    hs.SetDeviceStatus "v6",2
    hs.DelayTrigger 300, "Enable Security"

    end sub

    Comment


      #3
      What would cool is if it would call you. I am far from a script writer, so I am just making a suggestion. Nothing wakes me up any better then the phone ringing.
      Just a suggestion, the rest of it sound like a great idea too.

      Its great you have that skill,
      Thanks for sharing,
      Danielbo
      danielbo

      Comment

      Working...
      X