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.
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.
Comment