Announcement

Collapse
No announcement yet.

Voice Recognition in Scripting

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

    Voice Recognition in Scripting

    Hello All,

    Just wondering if anyone has any experience in scripting with VR, I am curious how VR can be used in part to call a string, which would then take a variable out of the string itself for processing.

    In HSTV3 you can ask "What is on Channel X tonight" and it gives a response, with this does it create a voice command for every channel, or would it use X as a variable that it would process and then return an answer.

    With VR, if i wanted to be able to ask What is the status of the DEVICENAME, how could that be scripted, do the voice commands allow it to recognize "What is the status of the" and then use the last phrase as a string which could be used in a script?
    HS3 PRO, Win10, WeatherXML, HSTouch, Pushover, UltraGCIR, Heaps of Jon00 Plugins, Just sold and about to move so very slim system.

    Facebook | Twitter | Flickr | Google+ | Website | YouTube

    #2
    The easiest way to see how this works is to look at the vr strings in some of the events you mentioned and see how they are formatted. There's also some information on this in the HomeSeer help files
    See Using HomeSeer > Using Voice Recognition > Voice Commands

    Here are the VR sripting commands:
    http://www.homeseer.com/support/home...ecognition.htm
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Thanks for the resource, after a bit of digging i found what i was looking for, it appears that a command could be created for homeseer like below:

      "Tell me about <DICTATION/>+" where the Dictation component would pull out the string, I was having a look at the shopping_list script example and figured out that the code below is likely where it is extracted:

      In the example below, does it pass the entire string including the dictation phrase across, so the component it uses in the script below is mid(cmd,5,i-6)

      If that is the case, in my example above, if i was to use "tell me about" as the example, would something like the following work in concept?

      All Dims etc

      cmd = system.LastVoiceCommand
      i = instr(1,cmd,"about")
      filteredcmd = Right(cmd,15,i+15)
      hs.writelog "Test","Tell me about: " & filteredcmd

      With the Dictation tag, does that really just tell homeseer to pass the recognised work across as a command, and then in the command you filter the phrase out that was dictated?

      Code:
      sub main()
          dim cmd
          dim all
          dim i
      
          cmd = system.LastVoiceCommand
      
          if cmd = "" then exit sub
          
          'msgbox cmd
      
          select case lcase(cmd)
              case "new shopping list", "clear the shopping list", "clear shopping list"
                  newlist
                  
              case "print shopping list", "print the shopping list"
                  printlist
      
              case "configure shopping list", "configure the shopping list"
                  configure
                  
              case "what do i need to buy", "what is on the shopping list", "read the shopping list", "read shopping list"
                  readlist
      
              case else
                  i = instr(1,cmd,"to")
                  if (i <> 0) and ((i-6) > 4) then
                      saveitem mid(cmd,5,i-6)
                  else
                      hs.writelog "Shopping List","Debug: " & cmd
                  end if
          end select
      end sub
      HS3 PRO, Win10, WeatherXML, HSTouch, Pushover, UltraGCIR, Heaps of Jon00 Plugins, Just sold and about to move so very slim system.

      Facebook | Twitter | Flickr | Google+ | Website | YouTube

      Comment


        #4
        Add a line to write the command to the log so you can see exactly what HomeSeer heard.

        Code:
         
        cmd = system.LastVoiceCommand
        hs.WriteLog("Debug",cmd)
        One thing to keep in mind. Do not set the event to Confirm Voice Command if you are going to parse the command string.

        I ran into this with the weatherXML VR events.

        The event would trigger when someone said "Tell me the forecast for Saturday"
        So LastVoiceCommand = "Tell me the forecast for Saturday"

        HS would ask its comfirmation.

        You would say "Yes"

        Now LastVoiceCommand = "Yes"

        The script now runs and it finds none of the words the script is looking for.


        In my case I do a loop on the words in the LastVoiceCommand and look for "forecast","temperature" or "weather". I set a variable to one it finds.

        At the same time I am also looking for "today","tomorrow","sunday","monday", etc. I set a second variable to this value.

        Now when I exit the loop I know what day and what type of info they want.
        --
        Jeff Farmer
        HS 3, HSPhone
        My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
        Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave

        Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2

        Comment

        Working...
        X