Announcement

Collapse
No announcement yet.

Nearly instant HS3 voice control via Android's "Automate" app!

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

    Nearly instant HS3 voice control via Android's "Automate" app!

    I'm excited about this so I had to share.

    Given the recent changes in version 239 which is currently in beta, the JSON API now supports processing voice commands sent as text.

    /JSON?request=voicecommand&phrase=turn on the living room light

    I use an app similar to Tasker called "Automate".

    https://llamalab.com/automate/

    With this app I am able to create what they call a 'Flow' to activate Google's built-in speech to text and send the results to HS. I can activate this flow via an Android widget from any home screen. You can choose from a bunch of different symbols for this icon.

    Why do this, you ask?

    As we all know, the HSTouch app takes at least a few seconds to load. Who likes to wait? With this method, I have nearly instant access to HS via voice.

    I've attached the 'Flow' I have created to do this. Once activated you will hear the usual voice recognition 'ding'. Speak your command. It will then verbally read what it heard you say and show a Yes/No dialog. If No is pressed you will speak again. Once Yes is pressed, it will make the request to HS. It will also read HS's response to you.

    All you need to do is: download attached zip, extract, place on phone; install Automate on your phone via Google Play; open Automate and import the .flo file; install the permissions required for the Flow; finally, edit the HTTP request block within the Flow for your URL, port, and credentials. You can remove the confirmation step for an even quicker solution if you get tired of it.

    With Automate, as I'm sure with Tasker as well, it is relatively easy to create a widget/shortcut on a home screen to send a pre-defined HTTP JSON request to your HS machine, but being able to use your voice gives you practically unlimited options with just one widget/shortcut, and that wasn't available until recently...at least to my knowledge.

    This is thanks to recent development to support Amazon Echo. Thanks HST!

    Of course, this is something I wished HSTouch for Android natively supported, but until then I have this exciting solution.

    I hope others find this useful. Enjoy!

    Edit: To create a home screen shortcut to trigger this flow, long press on a home screen and choose to add a widget. Find the Automate widget and tap it. Choose the black one with the white arrow if you want to be able to define your own icon. Long-press and drag the widget of your choice to the home screen. Select your flow from the list and choose the only option under it. Next, choose your icon and press OK

    New in v2:
    1) Confirmation step optional. Set via variable at the beginning of the flow.
    2) If the default unrecognized command is received, which is currently "That device was not found.", your device will say "What?" and you speak again.
    3) If you say "Cancel" the flow will be ended.

    New in v3:
    1) If "Do you want me to..." or "Please confirm..." is received, your Android device will listen for your response.

    New in v4:
    1) Remain silent and display "Success" if the Alexa silent response of "{}" is received.
    2) If no speech was recognized by VR (voice recognition), or if "Error, bad request: no phrase" is received from HS server, phone will say "speak up" and listen again. Receiving the error message from HS shouldn't happen anymore with the new check on the text received from VR.
    3) Confirmation step disabled by default (this may have changed in v2 or v3). To enable, change the value of "skipConfirm" in the second block in the flow to 1.
    Attached Files
    Last edited by mrceolla; December 23, 2016, 01:37 PM.
    HS4, Insteon, Z-wave, USB-UIRT, Harmony Hubs, Google Hub/Chromecasts/Speakers, Foscam & Amcrest cameras, EZVIZ DB1 doorbell
    Plugins: BLLAN, BLOccupied, BLUSBUIRT, Chromecast, Harmony Hub, Insteon, Jon00 Homeseer/Echo Skill Helper, Harmony Hub, Jon00 DB Charting, MediaController, NetCAM, PHLocation2, Pushover 3P, weatherXML, Z-wave

    #2
    Not that there was much interest in this, but I wanted to post my recent updates. I wanted speedier response as well as handling unrecognized commands.

    The confirmation step is now optional, set via a variable in the very beginning of the flow. Disabling this step sends the command to HS that much faster.

    If the default error response of "That device was not found." is received, your Android will say "What?" and you speak again. If only "What?" sounds funny to you, you can change it. I just wanted something short and sweet. If you speak "Cancel" at any time it will end the loop.

    I've attached the update to the first post. Again, you'll need to edit the HTTP request block in the flow for your own URL, port, and credentials.

    If anyone is trying to get this to work and having trouble I'm happy to try and help.
    HS4, Insteon, Z-wave, USB-UIRT, Harmony Hubs, Google Hub/Chromecasts/Speakers, Foscam & Amcrest cameras, EZVIZ DB1 doorbell
    Plugins: BLLAN, BLOccupied, BLUSBUIRT, Chromecast, Harmony Hub, Insteon, Jon00 Homeseer/Echo Skill Helper, Harmony Hub, Jon00 DB Charting, MediaController, NetCAM, PHLocation2, Pushover 3P, weatherXML, Z-wave

    Comment


      #3
      P.S. Added "Automate" widget instructions to the bottom of the first post.
      HS4, Insteon, Z-wave, USB-UIRT, Harmony Hubs, Google Hub/Chromecasts/Speakers, Foscam & Amcrest cameras, EZVIZ DB1 doorbell
      Plugins: BLLAN, BLOccupied, BLUSBUIRT, Chromecast, Harmony Hub, Insteon, Jon00 Homeseer/Echo Skill Helper, Harmony Hub, Jon00 DB Charting, MediaController, NetCAM, PHLocation2, Pushover 3P, weatherXML, Z-wave

      Comment


        #4
        This is awesome - I use Automate for receiving HS notifications, announcements, and for tracking individual occupancy @ home, so this is a natural extension!

        Comment


          #5
          Glad you like it. I too use Automate as one of the 3 checks for individual occupancy. I'm curious how you use it for notifications/announcements. Maybe you could start a thread for that flow and post it for others?
          HS4, Insteon, Z-wave, USB-UIRT, Harmony Hubs, Google Hub/Chromecasts/Speakers, Foscam & Amcrest cameras, EZVIZ DB1 doorbell
          Plugins: BLLAN, BLOccupied, BLUSBUIRT, Chromecast, Harmony Hub, Insteon, Jon00 Homeseer/Echo Skill Helper, Harmony Hub, Jon00 DB Charting, MediaController, NetCAM, PHLocation2, Pushover 3P, weatherXML, Z-wave

          Comment


            #6
            Nice! Found tasker to user-unfriendly so i will try this

            Comment


              #7
              I've never used Tasker but I've heard the same complaint before. I think Automate's design is brilliant. My only complaint is the name of the app. It makes it hard to search for examples, tips or help. Fortunately I've been able to find Community Flows available from within the app that showed me how to use the pieces I needed to build the Flows I wanted.
              HS4, Insteon, Z-wave, USB-UIRT, Harmony Hubs, Google Hub/Chromecasts/Speakers, Foscam & Amcrest cameras, EZVIZ DB1 doorbell
              Plugins: BLLAN, BLOccupied, BLUSBUIRT, Chromecast, Harmony Hub, Insteon, Jon00 Homeseer/Echo Skill Helper, Harmony Hub, Jon00 DB Charting, MediaController, NetCAM, PHLocation2, Pushover 3P, weatherXML, Z-wave

              Comment


                #8
                I've uploaded version 3 to the first post. Now, if HS responds with "Do you want me to..." or "Please confirm...", you will be able to speak again to respond.
                HS4, Insteon, Z-wave, USB-UIRT, Harmony Hubs, Google Hub/Chromecasts/Speakers, Foscam & Amcrest cameras, EZVIZ DB1 doorbell
                Plugins: BLLAN, BLOccupied, BLUSBUIRT, Chromecast, Harmony Hub, Insteon, Jon00 Homeseer/Echo Skill Helper, Harmony Hub, Jon00 DB Charting, MediaController, NetCAM, PHLocation2, Pushover 3P, weatherXML, Z-wave

                Comment


                  #9
                  Going to load this this evening.

                  Thank you for sharing, will post later how it goes and any interesting use cases I stumble across.

                  Chris

                  Comment


                    #10
                    mrceolla thanks for this!

                    Works awesome.

                    Would be great if this would work even if the Phone is locked.
                    Last edited by Duc998; June 8, 2016, 05:05 PM.

                    Comment


                      #11
                      Glad you like it.

                      It might be possible to trigger a flow while locked, but I haven't looked into it yet. If you ever find a way please let me know.
                      HS4, Insteon, Z-wave, USB-UIRT, Harmony Hubs, Google Hub/Chromecasts/Speakers, Foscam & Amcrest cameras, EZVIZ DB1 doorbell
                      Plugins: BLLAN, BLOccupied, BLUSBUIRT, Chromecast, Harmony Hub, Insteon, Jon00 Homeseer/Echo Skill Helper, Harmony Hub, Jon00 DB Charting, MediaController, NetCAM, PHLocation2, Pushover 3P, weatherXML, Z-wave

                      Comment


                        #12
                        For those of you using this Automate Flow, I encourage you to checkout Jon00 Echo Helper script:

                        http://board.homeseer.com/showthread.php?t=184504

                        With this you can send back custom text to be spoken by your phone. It supports replacement variables. You do not need to modify the Flow in order for this to work. It's freakin awesome. I'm just beginning to explore the possibilities. So far I have:

                        What is the meaning of life?
                        Response: 42
                        HS4, Insteon, Z-wave, USB-UIRT, Harmony Hubs, Google Hub/Chromecasts/Speakers, Foscam & Amcrest cameras, EZVIZ DB1 doorbell
                        Plugins: BLLAN, BLOccupied, BLUSBUIRT, Chromecast, Harmony Hub, Insteon, Jon00 Homeseer/Echo Skill Helper, Harmony Hub, Jon00 DB Charting, MediaController, NetCAM, PHLocation2, Pushover 3P, weatherXML, Z-wave

                        Comment


                          #13
                          How has this thread not blown up? This is awesome for people like me who don't love the idea of an always listening amazon echo in their home, but still want a device that responds to voice commands. Thank you very much for your work on this, it was a piece of cake to setup!

                          Are you aware if you can run events using this as well?
                          Last edited by jon102034050; December 19, 2016, 09:11 PM.

                          Comment


                            #14
                            Glad you like it.

                            I don't quite follow your last question. Perhaps missing a "can"? You can run events via your voice by saying "Run event [event name]". Alternatively, you can create a "Phrase Recognized" trigger to run an event by saying whatever you type into the textbox. Basically, you get to skip saying "Run event" that way. Lastly, you can use Jon00s script I mentioned above to do other cools things based on what you say, including running events.
                            HS4, Insteon, Z-wave, USB-UIRT, Harmony Hubs, Google Hub/Chromecasts/Speakers, Foscam & Amcrest cameras, EZVIZ DB1 doorbell
                            Plugins: BLLAN, BLOccupied, BLUSBUIRT, Chromecast, Harmony Hub, Insteon, Jon00 Homeseer/Echo Skill Helper, Harmony Hub, Jon00 DB Charting, MediaController, NetCAM, PHLocation2, Pushover 3P, weatherXML, Z-wave

                            Comment


                              #15
                              Originally posted by mrceolla View Post
                              Glad you like it.

                              I don't quite follow your last question. Perhaps missing a "can"? You can run events via your voice by saying "Run event [event name]". Alternatively, you can create a "Phrase Recognized" trigger to run an event by saying whatever you type into the textbox. Basically, you get to skip saying "Run event" that way. Lastly, you can use Jon00s script I mentioned above to do other cools things based on what you say, including running events.
                              hah, sorry - so excited about this I forgot how to type... you got my question right, and answered it just as I was hoping, thanks!

                              Comment

                              Working...
                              X