Android Voice Controlled Home Automation – How To

This is the post which most geeks are looking forward to. How did I create S.A.R.A.H, the android based voice control for home automation?

Similar to my post on Siri based voice control, I’ve never built anything myself. I just find things and put them together. Before we start, let’s look at the video which inspired me to do so.

Coincidently, this guy also has a Z-Wave based home automation with Vera, which makes it possible for me to achieve similar capabilities quickly with an Android tablet. He uses his phone to control Netflix, XBMC while I use my tablet to talk to SQ Blaster Plus to control my Starhub cable, DVD player etc.

What you need

So this is what you need to have to achieve my demo:

  1. Vera 2/3 (or Vera Lite)
  2. Android Phone/Tablet
  3. Tasker App
  4. AutoVoice App
  5. AuthomationHD App
  6. SQ Blaster Plus (and your iOS device running SQ Remote HD)
Basically, Tasker and AutoVoice is the key to the magic. Tasker is like the father of all automation app on your Android phone. I would call it a phone automation app such that you can virtually configure your phone to do anything when specific events happen. Because of Tasker that I had even considered dropping out of the Apple Fanboy camp. AutoVoice is a plugin of Tasker that gave Tasker a voice recognition capability. You will need to purchase both apps to get going.
As I usually do not reinvent the wheel, I will not be guiding you on how to use Tasker and AutoVoice. However I will point you to the resources on what they can achieve and the basics. You may come back to continue on this guide once you have gotten an idea on how Tasker and AutoVoice work. Resources as follows:
So from this point onwards, I assume you already know Tasker and AutoVoice. If you are really lazy to go through the above resources, you can also simply follow the steps below without understanding. Basically I just want to save explaining Tasker and jump to how to but you will be able to create more complex combination if you have read the above. I’ll be showing a basic guide for each video which I posted earlier. I’m using an android tablet in this guide and I am assuming you have already installed the required apps listed above.

Create a button on home screen

1. Click on Tasks Tab
2. Create a Task by tapping +
3. Input Task Name “Autovoice”
4. Create an Action by tapping +
5. Tap on Plugin
6. Tap on Autovice Recognize
7. Tap on Edit
8. Tap on the Tick on top right corner of Tasker App
9. Tap on Back to see the list of Tasks
10. Go to homescreen and add a Task widget
11. Select the “Autovoice” Task you had created in the above step
12. Tap the icon at bottom right of Tasker screen (an icon with 9 small squares)
13. Tap on Build in Icon
14. Select any icon you wish to use

A icon will be created in the home screen. After tapping on the icon, you will see the usual Google Voice Assistant waiting for you to say something. For now don’t say anything, let’s create the command first.

Voice control light 

1. Open Tasker App
2. Create a Tasker profile by tapping +
3. Tap on State
4. Tap on Plugin
5. Tap on AutoVoice Recognized
6. Tap on Edit
7. Check Event Behaviour
8. Tap on Command Filter
9. Input “Dining” as the Command Filter
10. Tap on the Tick on top right corner of Tasker App
11. Tap on Back
12. Tap on New Task
13. You may skip naming of the New Task
14. Create an Action by tapping +
15. Tap on Misc
16. Tap on Send Intent
17. In the Action field input “android.intent.action.VIEW”
18. In the Data field input “authomation://device/<your vera id>/<your device number>/toggle” (I entered authomation://device/14567/36/toggle you will be able to find out your vera id and the respective device number of your lights in the AuthomationHD app. For a full list of intent for Authomation app, click here)
19. In the Target field select “Activity”
20. Tap on Back until you see the list of profiles

Now go back to the home screen and tap on the icon you created in the home screen earlier and say “Dining”. The magic should happen. With this profile, when I say “Dining on”, the “Dining” command is recognise and the lights toggle on and when I say “Dining off”, the lights toggle off. This why S.A.R.A.H seems to be intelligent but the setup is done to assume that the user is not dumb enough to say “Dining on” when the light is already on. With multiple profiles setup, you will be able to say multiple commands within the same sentence. You can even say ” Blah blah dining blah blah kitchen” and both lights will toggle. Now you see the trick? 🙂

Voice control AV equipment

1. Open Tasker App
2. Create a Tasker profile by tapping +
3. Tap on State
4. Tap on Plugin
5. Tap on AutoVoice Recognized
6. Tap on Edit
7. Check Event Behaviour
8. Tap on Command Filter
9. Input the “On TV” as the Command Filter
10. Tap on the Tick on top right corner of Tasker App
11. Tap on Back
12. Tap on New Task
13. You may skip naming of the New Task
14. Create an Action by tapping +
15. Tap on Net
16. Tap on HTTP Post
17. In the Server:Port field input “<your SQ Blaster IP address>/docmnd.xml”
18. In the Data/File field input the corresponding XML command for turning on your TV (I’ve entered a command in this format “<docommand key=’dev2089815610′ seq=’0′ time=’0′ command=’On,Power On/Off’ repeat=’0′ ir_data=’UT235802′ ch=’0’/>”). This will be different for your SQ Blaster Plus. To find out the XML command for your respective AV equipment, you will need to sniff the http packet when you use SQ Remote HD on your iOS device. This guide will show you how.
19. Tap on Back until you see a list of profiles 

Now go back to the home screen and tap on the icon you created in the home screen earlier and say “On TV”. You TV should turn on. 🙂

Voice control Sonos

For Sonos and Vera owner, you can actually install a plugin for Sonos in vera where eventually you can setup a scene in Vera to make Sonos play, stop or perform a text to speech command.  To do so, you can refer to the guides below:

 

As the Sonos plugin is constantly being updated, you may encounter some problems along the way. However I think the play and stop command should be rather stable. Again, I’ll not be re-inventing the wheel to explain how to setup the plugin since the resources are available.

Once you had setup a scene that play Sonos, you can create a Tasker profile similar to the steps to voice control a light. The only difference is instead of sending intent for toggling a light (i.e “authomation://device/14567/36/toggle”) you send an intent for activating a scene (i.e “authomation://scene/3123456/33”).

Conclusion

Sorry for the long textual guide. I could have posted a video on how to setup everything in a video but the links I’ve posted in this article already had video tutorials. I believe if you are technically inclined, this article would be able to give you a clue on how to put things together. Once you master Tasker, which is not difficult, the sky is the limit. However, I welcome any queries and may post more detailed guide if required. Enjoy!

Domotics

Advertisements

2 Replies to “Android Voice Controlled Home Automation – How To”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.