Announcement

Collapse
No announcement yet.

Script for setting Location

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

    Script for setting Location

    I need to work up a script for setting my location based on which speaker app instance I am using to talk to HS.

    I have a virtual device v5, and if I speak into the kitchen speaker app I want v5 to be set to kitchen.

    Is this possible?

    #2
    Maybe I can be more specific.

    If I speak into a speaker app on a pc call "Theatre" can the attention word from that speaker instance be intercepted, and then update a virtual device with "Theatre"?

    This would allow me to srite the scripts so they talk back on only the speaker instace that initiated them.

    I have tried the Intercept attention phrase example for the help file but i don't know where to put the script so it runs when I say the attention phrase...
    Last edited by zippy; March 22, 2006, 08:50 AM.

    Comment


      #3
      Try this script. Put in in a script named check_vcmd.txt and drop it into the scripts directory.

      sub main()

      sLastCmd = hs.lastvoicecommand
      hs.writelog "test", sLastCmd
      hs.setDeviceString "r1", sLastCmd
      end sub

      You will need to create the r1 virtual device.
      -Rupp
      sigpic

      Comment


        #4
        I emailed support and they gave the same thing.

        Here is what happened... my speaker app instance on a different pc than hs has an attention phrase of "Theatre" So when I say" theatre" i want the script to set r1 to "theatre". I also want it to change the acknowlege phrase to some thing else.

        At current though it does not change r1 to theatre it changes it to a command I used earlier.

        For instance The last time I used hs I said turn basement lights off. So now when I call the attention phrase "theatre", instead of setting it to theatre it sets it to turn basement lights off.

        Wierd.

        Comment


          #5
          Also found a post here http://board.homeseer.com/showthread.php?t=111183that says check_vcmd.txt is not used by speaker apps.

          That seems a little strang that something designed to work with VR does not work with the VR app.

          Any ideas?

          Comment


            #6
            Rupp (et al)


            I want to use the check_vcmd script too and couldn't get it working (even though it was copied straight from the help file). It's important for me to do this for testing as well as other things.

            BTW: not sure that your script below would work - it'll just list the last command, not WHERE the command was generated from (ie, Bedroom, Kitchen etc).

            Zippy: I use an AP800 mixer with multiple mic's. The AP800 has a port from which I can determine which Mic was used and therefore get a location. Ie, I don't use the speaker app.

            Martin

            Comment


              #7
              myapp can you give me a little layout info as to how the mixer lets HS know which mic is being used?

              Comment


                #8
                myapp,
                HS currently does not know which speaker app sends the request but no matter which speaker app sends the request the lastvoicecommand will list the last voice command HS spoke. So if you say computer and the computer says yes sir and you say what is the time and the computer says 10pm then 10 pm will be the last voice command. The point is the file check_vcmd.txt will fire on prior to VR being processed.
                -Rupp
                sigpic

                Comment


                  #9
                  Zippy

                  The AP800 has a 25pin (DB25) status port on it's rear (2 actually). Each pin on the port has a different usage - but a status pin exists for each mic you have plugged into the AP800. I tell the AP800 to only allow 1 mic to "turn on" at once (and always the one that hears the loudest change in noise - ie, the one I'm talking to). Therefore the status of 1 mic will be "on" whilst the others will be "off".

                  I take these cables into a SECU-16 (an add-on to the Ocelot) with digital inputs. Therefore I have each (relevant) pin from the AP800 status port wired into a different digital input on the SECU-16. The SECU-16 / Ocelot communicates with HS, reading each of the inputs. I have an event running on status change of each of the devices associated with the inputs (labelled Lounge Mic, Bedroom Mic etc) that sets a virtual device to the last mic gated (or turned on). Therefore, I always know where the last command was issued from.

                  It would be better to set this in the check_vcmd.txt script, but as other posts state, I can't get it to fire for me in HS2.

                  There is lots of background on the AP800 / AP400 units, mostly by Dantelope, Paul Koslow, Gardner and they have a lot of really good posts on the site. Dantelope has also written some pretty cool VB to do more with the AP800 which is a pretty versatile unit.

                  Martin

                  Martin

                  Comment


                    #10
                    check_vcmd.txt

                    Rupp

                    I understand the use of the hs.lastvoicecommand and the use of the check_vcmd.txt script. However, Zippy wants to know WHERE the command was issued from, not the command itself. Ie, he needs to know which speaker app sent the command (can you have one check_vcmd per speaker app - ie does it run locally or on the server?).

                    Secondly, I can't get the check_vcmd.txt script to fire. It's in my scripts directory but doesn't run. Any idea why? The link that Zippy pasted refers to that also. I need the script to be able to change voice settings.

                    Martin

                    Comment


                      #11
                      Originally posted by myapp
                      Rupp

                      I understand the use of the hs.lastvoicecommand and the use of the check_vcmd.txt script. However, Zippy wants to know WHERE the command was issued from, not the command itself. Ie, he needs to know which speaker app sent the command (can you have one check_vcmd per speaker app - ie does it run locally or on the server?).

                      Secondly, I can't get the check_vcmd.txt script to fire. It's in my scripts directory but doesn't run. Any idea why? The link that Zippy pasted refers to that also. I need the script to be able to change voice settings.

                      Martin
                      Thus my first line in my post below :
                      "HS currently does not know which speaker app sends the request..." This is coming in a future release of HS.

                      Not sure why it will not fire. What version of Hs are you using? Did you try the script posted in this forum?
                      -Rupp
                      sigpic

                      Comment


                        #12
                        OK - did more testing. I think the confusion lies here..


                        Your script does indeed work and changes the virtual device to the last command. All good. However, the help documention states that you should be able to intercept the attention phrase, which indeed is not happening. Ie, the check_vcmd.txt script is not running when you say the attention phrase, but only when you say a command AFTER the attention phrase. The help states:


                        It may be desirable to intercept a voice command before it can be processed. For example, you may have a voice command that includes all members of your family. You can intercept the attention phrase and set the voice recognition speaker for the desired individual. This is accomplished through the use of a special script.
                        So when I do the following:

                        sub main()
                        sLastCmd = hs.lastvoicecommand

                        if sLastCmd="Martin" then
                        'hs.setspeaker "Martin"
                        hs.speak "hello Martin"
                        end if

                        if s="becky" then
                        hs.setspeaker "Becky"
                        hs.speak "hello Becky"
                        end if

                        if s="*" then
                        hs.speak "I don't understand"
                        end if

                        end sub

                        Can you interept the attention phrase or not? That is the specific thing that isn't working and I need it so that I can change the voice recognition profile.

                        Martin
                        Last edited by myapp; March 24, 2006, 08:40 AM.

                        Comment


                          #13
                          No you can no longer intercept the attention phrase. This is probably left over from the days prior to the speaker app and when HS handled all the speech. A trouble ticker needs to be generated on this error in the help files.
                          -Rupp
                          sigpic

                          Comment


                            #14
                            Thanks

                            OK - thanks. Shame, it would have been really useful to use this!

                            Comment


                              #15
                              Originally posted by myapp
                              OK - thanks. Shame, it would have been really useful to use this!
                              It's being added in a future release.
                              -Rupp
                              sigpic

                              Comment

                              Working...
                              X