Autovoice, tasker and Domoticz

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

Post Reply
PeterFleur
Posts: 32
Joined: Sunday 08 March 2015 13:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.4739
Contact:

Autovoice, tasker and Domoticz

Post 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 5093 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 5093 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 5093 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
RaspberryPI
ZWave
RFXtrx433E
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: Autovoice, tasker and Domoticz

Post 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
PeterFleur
Posts: 32
Joined: Sunday 08 March 2015 13:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.4739
Contact:

Re: Autovoice, tasker and Domoticz

Post 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
RaspberryPI
ZWave
RFXtrx433E
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: Autovoice, tasker and Domoticz

Post 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
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: Autovoice, tasker and Domoticz

Post 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
ben92
Posts: 57
Joined: Thursday 14 August 2014 17:41
Target OS: Linux
Domoticz version: beta
Location: France
Contact:

Re: Autovoice, tasker and Domoticz

Post 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
User avatar
galadril
Posts: 828
Joined: Monday 07 September 2015 10:32
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Contact:

Re: Autovoice, tasker and Domoticz

Post by galadril »

old topic, but im looking into Tasker integrations with a plugin app
https://www.domoticz.com/forum/viewtopi ... 37&t=32696
Solar panels of Ginlong, Omnik-Solar, Transenergy or Solarman?? Try my Android app:
https://play.google.com/store/apps/deta ... ongmonitor
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest