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.

  1. Create a new Event Profile in Tasker

  2. Choose AutoVoice → Recognized

  3. For the command filter, enter:

  4. Run the routine (?<routine>.+)

  5. Note: Make sure "Use Regex" is checked

  6. Proceed to creating your task (optionally providing a name for the task)

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

  8. (More details on conditional actions)

  9. In the task, create an action using Plugin → SharpTools → A Phrase

  10. Note: A Phrase is the legacy name for A Routine

    1. Use the pencil icon in Tasker to edit the "A Phrase" plugin and select your desired phrase.

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

    3. Example: If %routine ~ goodnight

  11. 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:

A Phrase: "Good Night!"

If %routine ~ "goodnight"

A Phrase: "Good Morning!"

If %routine ~ "good morning"

A Phrase: "Special Phrase!"

If %routine ~ "custom spoken trigger"

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.