Run SmartThings Routine with Voice
Post date: Jan 23, 2016 5:33:20 PM
In this tutorial, we will demonstrate how to use Tasker, AutoVoice, and SharpTools to run a SmartThings routine using your voice. At the end of this tutorial, you will be able to say "Okay Google, run the routine Good Morning" and have the "Good Morning!" routine/phrase run.
This tutorial uses the SmartThings Voice Control with Tasker tutorial as a baseline. If you are unfamiliar with using AutoVoice or Tasker, I would strongly recommend reviewing the SmartThings Voice Control with Tasker tutorial.
Create a new Event Profile in Tasker
Choose AutoVoice → Recognized
For the command filter, enter:
Run the routine (?<routine>.+)
Note: Make sure "Use Regex" is checked
Proceed to creating your task (optionally providing a name for the task)
At this point, we will create several actions for each desired phrase and will make these actions trigger conditional upon our desired phrase being spoken.
In the task, create an action using Plugin → SharpTools → A Phrase
Note: A Phrase is the legacy name for A Routine
Use the pencil icon in Tasker to edit the "A Phrase" plugin and select your desired phrase.
In the Action Edit screen for "A Phrase", scroll down to the If section and enter the %routine variable on the left and the phrase on the right that you would like to trigger the action.
Example: If %routine ~ goodnight
Repeat steps 5-7 for each desired phrase. When you are finished adding Phrases, press back multiple times to fully exit Tasker and enable the profile.
In the end, your task will have several actions like:
Note: For debugging purposes, you may want to include a simple Notify or Flash action to show the contents of the variable captured with AutoVoice. Sometimes the words captured by AutoVoice/Google are slightly different than you expected and you will want to adjust your conditional actions accordingly (eg. "good night" → "goodnight", "10" → "ten")
For additional troubleshooting steps, see the troubleshooting section of the SmartThings Voice Control with Tasker tutorial.