Autovoice, tasker and Domoticz
Posted: Sunday 28 February 2016 9:52
I've managed to control my Domoticz with voice commands by using Autovoice and tasker and would like to share this for more input.
Cause i still need to find out how i can query Domoticz with json to find the idx of the named device. I still need to convert the name to a idx number within tasker to get this to work.
I assume in this that you already installed Autovoice and Tasker on the android device.
In Autotask go to Profiles and press the plus. Choose State -> Plugin -> Autovoice -> Recognized
In the new screen choose the edit button and tick Event behaviour and Use Regex like this: In command filter type: This is the pattern Autovoice is gonna recognize:
Domotica is the trigger for the Domotica command
(?<device>.+) is the device we want to operate
(?<onoff>.+) is the command we want to execute (On or Off)
Click OK and on the next screen the V.
Go back to the main screen and choose New task and type the name of the task.
An empty taskscreen wil open.
Click the Plus to add the task. Use Net ->HTTP get to create the http task to do stuff on Domoticz
Type the servername and port of the Domoticz server (I my case raspberrypi:8080) on server:port
In the path type:
json.htm?type=command¶m=switchlight&idx=%device&switchcmd=%onoff
Like this: Because i still need to figure out how to query Domoticz to convert names to idx i added one extra task above this specific task to convert a variable.
Click the plus and choose: Variables ->Variable search and replace
At variable type %device
At Search set the name of the device you're calling in the voice command. Like Hall light
At Replace matches type the IDX of the Hall light
If you now start Autovoice (by clicking twice on the home button is most Android devices) and say: Domotica Hall Light On it should work.
Does anybody know how to query Domoticz within Tasker to get rit of the variable too? Then i could make a wiki of it.
Thanks!
Peter
Cause i still need to find out how i can query Domoticz with json to find the idx of the named device. I still need to convert the name to a idx number within tasker to get this to work.
I assume in this that you already installed Autovoice and Tasker on the android device.
In Autotask go to Profiles and press the plus. Choose State -> Plugin -> Autovoice -> Recognized
In the new screen choose the edit button and tick Event behaviour and Use Regex like this: In command filter type: This is the pattern Autovoice is gonna recognize:
Domotica is the trigger for the Domotica command
(?<device>.+) is the device we want to operate
(?<onoff>.+) is the command we want to execute (On or Off)
Click OK and on the next screen the V.
Go back to the main screen and choose New task and type the name of the task.
An empty taskscreen wil open.
Click the Plus to add the task. Use Net ->HTTP get to create the http task to do stuff on Domoticz
Type the servername and port of the Domoticz server (I my case raspberrypi:8080) on server:port
In the path type:
json.htm?type=command¶m=switchlight&idx=%device&switchcmd=%onoff
Like this: Because i still need to figure out how to query Domoticz to convert names to idx i added one extra task above this specific task to convert a variable.
Click the plus and choose: Variables ->Variable search and replace
At variable type %device
At Search set the name of the device you're calling in the voice command. Like Hall light
At Replace matches type the IDX of the Hall light
If you now start Autovoice (by clicking twice on the home button is most Android devices) and say: Domotica Hall Light On it should work.
Does anybody know how to query Domoticz within Tasker to get rit of the variable too? Then i could make a wiki of it.
Thanks!
Peter