Voice-activated HA via tasker

IVB

Senior Member
Saw this video making the rounds on Google Plus about using tasker & voice-recognition. Will look into it myself later, since I already use tasker this shouldn't be too hard. 
 
from what i read, it's pretty simple.  he's using the autovoice tasker plugin and maps keywords to tasks.  if he says "blah blah blah bar lights blah blah blah", it sends a command to his vera (maybe an http get?) to toggle the bar lights.  so, if he says "bar lights on" when they're on, it'll turn them off.  here's some other details http://goo.gl/q4Zwl
 
You could pretty easily use the CQC generic IP trigger driver to have such a thing send text strings via TCP to CQC to trigger actions. Or send an HTTP request to the web server to do it.
 
Holy crap did AutoVoice make this simple.  I used http://www.pocketables.com/2013/05/how-to-use-the-autovoice-tasker-plug-in.html]this simple how-to[/url] guide. Took me all of a few minutes to set up my first voice-recognized command. Given that I already had the web server configured for inbound requests as http://www.charmedquark.com/vb_forum/showthread.php?t=10777]per this guide[/url], all I had to do was add another CQC inbound trigger for each command. So far its only "Closet Light On" and "Closet Light Off". Pretty simple to add new ones though.
 
Up to a half dozen voice commands that are the most commonly forgotten items (MBR Closet Light On/Off, MBR Light On/Off, ArmStay).
 
Can't seem to get one working right ("AddSoapToDishwasherAndStart").  Damn. I swear I never remember to do that until I'm actually under the covers.
 
Here's the latest iteration of the use of AutoVoice...

Android Home Automation Demo Voice + NFC

Combines Tasker, AutoVoice and NFC tags.

zWave lock in action also included 
smile.gif


-Ben
 
This was fairly timely as I just bought an Android tablet.  This thread then resulted in my buying Tasker and AutoVoice in hopes of adding some voice control functionality to Elve.  I quickly rigged up a proof of concept but I'm not sure it is the best way to set this up.  Essentially, when AutoVoice receives a command I have it sending (via HTTP get) an HTTP API URL to Elve to change the value of a global variable to true.  A rule in Elve that looks for that global variable to become true then executes the relevant commands and then sets the variable to false again.
 
1. I'm sure there is a more efficient and better way to meld Tasker an Elve - anyone have any better ideas on how to trigger events in Elve using Tasker?  I couldn't figure out how to get the TCP Generic Driver working with Tasker and Elve as that would likely be a better approach.
2. As Elve uses basic HTTP authentication I need to send my username and password in the clear in the URL that talks to Elve.  Again, probably not the end of the world as this is all occurring on a local network but still not my preferred approach.
 
This is pretty cool stuff...  Any thoughts or feedback would be appreciated!
 
Would probably be easier to use the Elve Command Line tool. (ElveCommandLine.exe)
That will give you a "runscript" option so you can simply send a "lighting.SetLightLevel(x, xx);"
 
I'm using HTTP post as well to send to CQC but I'm only doing it internally in the house so am not too concerned about clear text. I may change my mind on this later but for now I'm most interested in getting things to function 
 
At the moment I have a specific keyword that is required prior to any further automation command processing. The one example I have is to toggle my alarm on and off. I already had the alarm processing in place from working on triggering automation events with NFC tags.
 
I am still working out the framework of how I am going to process voice commands (and NFC) from my android devices to the automation system. My initial thinking is that I want to avoid getting too specific with command syntax and like 1st demo video posted at the beginning of this thread (write up on the site I linked to later in this text) I want to keep the voice interaction natural and general. I don't want to have to remember (or have my wife remember) anything too specific or it just won't fly. Once I frame it up more I'll post here.
 

For great tutorials on Tasker and the use of AutoVoice check this site out. There is a whole section on AutoVoice.

 
And yes you are correct, this is very cool stuff, I was cackling like a happy mad scientist yesterday when I got the alarm to turn on and off via voice...   :D
 
-Ben
 
I looked into it more closely and it looks like any kind of generic TCP connection with tasker is a no-go so I think the HTTP GET will work in my case.  I wasn't sure how to embed HTTP POST commands (which would allow for longer commands) but the GET seems to work OK.  I ended up abandoning AutoVoice though as i keep running into what seemed like odd bugs (it would sometimes repeatedly trigger the voice input and it wouldn't always wait until received the voice command before sending the URL string to Elve).  I switched to the built in GET VOICE which seems to be working really well.  
 
I am passing the entire recognized text string to Elve as a variable and I am processing it within a rule there.  So far I have found Tasker's interface to be a bit odd, especially as it relates to Auto Voice.  
 
My commands aren't completely free form speech but they are pretty easy to remember ("Arm Stay", "Arm Night", "Weather Report", "Last Caller" etc.)  I flash the recognized text up on the Elk Keypads as well.  I just programmed in a scripted conversation with the alarm to freak out my kids as well.
 
Something like this would be SUPER EASY to program for iOS (recognize text string from voice input and then transmit that as a variable via HTTP) which would be way better for us as we have a number of iOS devices but only one Android device.
 
Superjer2000 said:
I looked into it more closely and it looks like any kind of generic TCP connection with tasker is a no-go so I think the HTTP GET will work in my case.  
 
if you install sl4a and python, you should be able to call python scripts from tasker to initiate tcp connections, but then you might as well bypass tasker & go straight to python (sample sans sockets http://goo.gl/Ffk9E )
 
I played around a bit more and did a couple of things:
1. Built a really simple ios program with a text field and send command button. When the app loads it puts the focus on the text box so all I do is press the dictation button on the keyboard that comes up and then say my command "patio light on" which is dictated into ghr text box and when i press the send command button the app sends the http string to elve which then turns on the light.

2. Much neater in my book though was downloading the kinect sdk and creating the same functionality with a vb program. Now anywhere within ear shot of the kinect hooked up to the computer in my kitchen I can say "Amy patio light on" and the system turns the light on. (The system is named Amy after the ivona voice that I use for text to speech in the house."

I would highly recommend downloading the sdk for the kinect it is extremely powerful.
 
Back
Top