Page 1 of 1

Autovoice, tasker and Domoticz

Posted: Sunday 28 February 2016 9:52
by PeterFleur
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:
Screenshot_2016-02-21-10-15-00.png
Screenshot_2016-02-21-10-15-00.png (134.83 KiB) Viewed 5096 times
In command filter type:
Screenshot_2016-02-27-11-01-03.png
Screenshot_2016-02-27-11-01-03.png (117.17 KiB) Viewed 5096 times
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&param=switchlight&idx=%device&switchcmd=%onoff
Like this:
Screenshot_2016-02-28-09-39-21.png
Screenshot_2016-02-28-09-39-21.png (111.44 KiB) Viewed 5096 times
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

Re: Autovoice, tasker and Domoticz

Posted: Wednesday 02 March 2016 23:48
by stlaha2007
Hi Peter,

Im not to familiar with Tasker, but your solutions sounds good.
However if understand correctly you want Tasker to replace a variable with a idx number, which it needs to get from domoticz by name like Hall or Living?

I have seen a solution (wiki/script examples/lua or python) that does request (device)names and gives the accompaning idx. Within Domoticz context.

But i doubt you can do something like that from Tasker, unless its capable of running python or lua, of which i'm sure it can't.



Grtz,
Stephan

Re: Autovoice, tasker and Domoticz

Posted: Thursday 03 March 2016 0:01
by PeterFleur
Hi Stephan,

Within tasker you can run JSON scripts with variables. So that's the idea to send a name to a json script which gives back a idx number and to use that again in the task.

Peter

Re: Autovoice, tasker and Domoticz

Posted: Thursday 03 March 2016 0:12
by stlaha2007
Like i said, don't know al about tasker. And if there are json-scripts that can be run within tasker, it cant be that hard to implement.

Maybe i'm mistaken, but i though that json can be seen as a kind of markup language. Haven't seen scripts like programming languages like perl/c#/python which where json scripts.

So if json is also a scripting language, i have to google around a bit and see how that compares to my knowledge of perl/bash/python.

Grtz,
Stephan

Re: Autovoice, tasker and Domoticz

Posted: Thursday 03 March 2016 9:41
by stlaha2007
Peter,

Have a look at this site (doing simular thing): https://m.reddit.com/r/tasker/comments/ ... api_parse/

Also find some other info about whats possible with tasker (didn't want to buy within 7 days ;-). However mainly javascript can be run, and json can be parsed.

More info about JavaScript(let) in Tasker:
http://tasker.dinglisch.net/userguide/e ... cript.html

Hope you can figure it out...

Grtz,
Stephan

Re: Autovoice, tasker and Domoticz

Posted: Thursday 03 March 2016 10:59
by ben92
Hi,

I made this with tasker and autovoice, you can see here for source : http://easydomoticz.com/forum/viewtopic ... =961#p8570

Maybe it can help you.... but its in french

Re: Autovoice, tasker and Domoticz

Posted: Friday 15 May 2020 20:32
by galadril
old topic, but im looking into Tasker integrations with a plugin app
https://www.domoticz.com/forum/viewtopi ... 37&t=32696