Examples‎ > ‎

SmartThings Voice Control with Tasker

posted Dec 5, 2014, 4:39 PM by Joshua Lyon   [ updated Feb 15, 2016, 5:33 PM ]

In this tutorial, we will briefly demonstrate how to use Tasker, AutoVoice, and SharpTools to control your home with your voice. At the end of the tutorial, you will be able to say Okay Google, turn the lamp off and have your lamp turn off. 


You might also be interested in the following SharpTools articles:

Requirements:

  • Tasker - automation for Android
  • AutoVoice (Pro) - voice recognition for Tasker
  • SharpTools - SmartThings control for Tasker

Instructions

  1. Open Tasker
  2. In Profiles, click the "+" icon to add a new profile
  3. Select Event > Plugin > AutoVoice > Recognized
  4. Click the pencil icon to configure the AutoVoice plugin
  5. Tap command filter and paste in:
    turn(?<z1> my| the)? (?<device>.+) (?<command>on|off)
    Note: the (?<device>.+) saves the spoken device name to the %device Tasker variable
  6. Check the Use Regex box
  7. Select the checkmark at the top of the screen to save your plugin settings
  8. Press the back button on your phone to save the Tasker event profile
  9. At the prompt to select a Task, select New Task
  10. Leave the optional Task Name blank and click the check mark to continue
  11. Click the + icon at the bottom of the screen to add an action
  12. Choose Plugin > SharpTools > A Thing
  13. Click the pencil icon to configure the SharpTools plugin
  14. Click the 'tag' icon at the top of the screen
    Note: This puts the SharpTools plugin in Tasker Variable entry mode
  15. Enter %device in the first field
  16. Enter %command in the second field
  17. Press Apply
  18. Press the back button on your phone to save the Action
  19. Press the back button again to close out the Task Edit
  20. Press the back button again to exit out of Tasker and start the profile

Now you should be able to say "Turn the device_name off" where device_name is a device you have enabled in the 'Authenticate' section of the SharpTools settings.


Troubleshooting:

  • Make sure you can manually toggle the desired device from the main SharpTools interface
  • Make sure the command is a valid command such as "on" or "off"
  • If you hard-coded the command, make sure you used the proper case
    Most commands start with a lowercase letter like "on" or "toggle"
  • Make sure AutoVoice is recognizing your device name exactly as it is spelled in SmartThings
  • SharpTools supports partial matching. If you have several devices with "Hall" in their name and say "Turn the hall on", SharpTools will match all devices with the word 'hall' in the name and trigger the command on each device. (eg. Upstairs Hall, Downstairs Hall, Shallow Light)
  • Make sure you have a licensed copy of AutoVoice - the free version truncates the received command to 4 characters.
  • Make sure you are saying the phrase in the correct order. If you are following the guide above, the phrase would be "Turn the [device] [on]"
  • If the 'Apply' button is grayed out (or missing) in the 'A Thing' view, try selecting a device which has a command from the drop down selections before switching to Tasker Variable mode.

Sending Logs

If you are still having difficulty getting the example to work, try looking at the logs. If you are still having difficulty, please send all three items listed below to support@boshdirect.com
  • AutoVoice Logs: Clear the logs in AutoVoice, try speaking the phrase again, then review (and/or send) the logs.
  • SharpTools Logs: Open SharpTools Settings, select the log icon from the action bar, then select the mail icon from the action bar.
    • Make sure you send the SharpTools logs immediately after performing the action. SharpTools uses the built in Android logging system which may overwrite itself after waiting too long.
    • Before pressing send on the email, make sure there is a log file attached. If not, press back to go back to the log viewer and try tapping the email icon again.
  • Tasker Profile Export: export the Tasker profile in descriptive format by long pressing on the profile
    • Note: You will need to have Menu / Prefs / UI / Beginner Mode unchecked.
Comments