Announcement

Collapse
No announcement yet.

HS Speech recognition from textstring?

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

    HS Speech recognition from textstring?

    Hi, I have modify my android phone so I can use Android voice application to post the speech as text to a asp file on hs server that handle the data.

    For example if I say "Turn on the kitchen lamp" i got a string sent to hs-server "turn on the kitchen lamp"

    Is there any way to use the built in function for hs speech recognition or do I have to write everything from start and try to do artificial intelligence. I just try some quick and dirty asp scripting.

    I am in bed with flu and headaches and try to pass the time, but the brain is not at top level at the moment.

    PHP Code:
    str_text lcase(request.form("text"))
    arr_words split(str_text," ")
    If 
    arr_words(0) = "turn" Then
    select 
    case arr_words(1)
        case 
    "on"
        
    str_command 2
            
    if arr_words(2) = "the" Then
        str_place 
    arr_words(3
        
    str_unit =arr_words(4)
        
        else
        
    str_place arr_words(2
        
    str_unit arr_words(3)
        
    End If
        case 
    "off"
        
    str_command 3
            
    if arr_words(2) = "the" Then
        str_place 
    arr_words(3
        
    str_unit =arr_words(4)
        else
        
    str_place arr_words(2
        
    str_unit arr_words(3)
        
    End If
        case 
    "shut"
        
    str_command 3
            
    if arr_words(2) = "the" Then
        str_place 
    arr_words(3
        
    str_unit =arr_words(4)
        else
        
    str_place arr_words(2
        
    str_unit arr_words(3)
        
    End If
    end select

    hs
    .SetDeviceStatusByName str_place " " str_unit,str_command
    response
    .write "I have now " arr_words(0) & " " & case arr_words(1) & " " str_place " " str_unit
    End 
    If 
    Please excuse any spelling and grammatical errors I may make.
    --
    Tasker Plugin / Speech Droid
    Tonlof | Sweden

    #2
    I'm confused.
    You stated "Hi, I have modify my android phone so I can use Android voice application to post the speech as text to a asp file on hs server that handle the data.

    For example if I say "Turn on the kitchen lamp" i got a string sent to hs-server "turn on the kitchen lamp""
    So do you have this working or not?
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Originally posted by Rupp View Post
      I'm confused.
      So do you have this working or not?
      That part works but to avoid hundreds if else depending on how you pronounce the command. The script that I wrote together manage only if you say exactly right. I was just hoping to harness the power of the HS Speech recognition if it were possible. http://www.homeseer.com/support/home...e_commands.htm
      Please excuse any spelling and grammatical errors I may make.
      --
      Tasker Plugin / Speech Droid
      Tonlof | Sweden

      Comment


        #4
        Can you explain the mechanics of how this is done?

        Is the script living on the phone?

        How are you going from the Android to the HS Server?

        Oh, Hope you feel better.
        Don

        Comment


          #5
          Originally posted by donstephens View Post
          Can you explain the mechanics of how this is done?

          Is the script living on the phone?

          How are you going from the Android to the HS Server?

          Oh, Hope you feel better.
          [Phone]
          I run Tasker on my phone.

          Simplification of events
          1. Button trigger Androd Speech Application
          2. When speaking is finish it save the text to a variable
          3. Tasker make a http post like a standard form post to hs webserver.
            It can send it with post or get method.
            PHP Code:
            http://192.168.2.100/voice.asp?text=turn+on+the+bedroom+lamp 

          [Homeseer]
          1. voice.asp handle the textstring
          2. voice.asp send back text to phone.

          "Turn on the bedroom lamp" is very basic but it should also work if you say it in differant way "Turn bedroom lamp on"


          Or even more advanced commands and I like the way HS can handle voice command so this is my goal.
          Please excuse any spelling and grammatical errors I may make.
          --
          Tasker Plugin / Speech Droid
          Tonlof | Sweden

          Comment


            #6
            Interesting. Thanks for the explanation.
            Don

            Comment


              #7
              If noone have any solution that I can use the HS-builtin function for voice together with textstring, I think I'll resolve it with generating regex pattern automatically from the HS floor, room and name etc.
              Please excuse any spelling and grammatical errors I may make.
              --
              Tasker Plugin / Speech Droid
              Tonlof | Sweden

              Comment


                #8
                I solved it with several regular expressions.

                From my Samsung Galaxy S2 (Android) I just press a button to speech.
                I can say the commands in many different way and it still working
                Turn on the ceiling lamp in master bedroom
                Please turn on master bedroom ceiling lamp
                Master bedroom ceiling lamp on
                If the key words are with so it does not matter how you say the sentence.
                Directly after HS have finish the mission, the samsung is reading back confirmation message. "Ceiling lamp in master bedroom has now turned on."
                Please excuse any spelling and grammatical errors I may make.
                --
                Tasker Plugin / Speech Droid
                Tonlof | Sweden

                Comment


                  #9
                  Originally posted by tonlof View Post
                  I solved it with several regular expressions.

                  From my Samsung Galaxy S2 (Android) I just press a button to speech.
                  I can say the commands in many different way and it still working
                  Turn on the ceiling lamp in master bedroom
                  Please turn on master bedroom ceiling lamp
                  Master bedroom ceiling lamp on
                  If the key words are with so it does not matter how you say the sentence.
                  Directly after HS have finish the mission, the samsung is reading back confirmation message. "Ceiling lamp in master bedroom has now turned on."
                  I'm very interested in how you accomplished this. I have the same phone and use tasked frequently. Could you please post your tasked configuration or export the xml and also post a copy of your HS script?

                  Thanks a lot!
                  M

                  Comment


                    #10
                    Originally posted by manxam View Post
                    I'm very interested in how you accomplished this. I have the same phone and use tasked frequently. Could you please post your tasked configuration or export the xml and also post a copy of your HS script?

                    Thanks a lot!
                    M
                    I need a few more days to try and improve. Then upload it in a new thread in the Scripts & Plug-Ins: Development and Libraries

                    I announced here when it is up.
                    Please excuse any spelling and grammatical errors I may make.
                    --
                    Tasker Plugin / Speech Droid
                    Tonlof | Sweden

                    Comment


                      #11
                      Can't wait for your writeup!

                      Cheers,
                      M

                      Comment


                        #12
                        Unfortunately, I have to fix a customer server crash , so I have not had time to do much more but I promise that I will return as soon as I have some free time. Sorry for the delay Maybe weekend...)
                        Please excuse any spelling and grammatical errors I may make.
                        --
                        Tasker Plugin / Speech Droid
                        Tonlof | Sweden

                        Comment


                          #13
                          No problem Tony. Real life sometimes gets in the way of the important things!

                          Comment


                            #14
                            SpeechDroid Script

                            Hi, I have upload it here, enjoy
                            http://board.homeseer.com/showthread.php?p=1007049
                            /Tonlof
                            Please excuse any spelling and grammatical errors I may make.
                            --
                            Tasker Plugin / Speech Droid
                            Tonlof | Sweden

                            Comment

                            Working...
                            X