In this tutorial I would like to explain you how you can setup your Android device to interact with Domoticz based voice commands. In my situation I have a Android Nexus 7 wall tablet and it is really cool to say "Ok Goolge" and then "Christmas tree on" and see the lights go on. The benefit is that I don't need a Google Home voice activated speaker and even I can speak Dutch.
P.s. the below setup is quite simple and you don't need to pay for any app. I had a similar setup with Tasker and AutoVoice but that was quite complex.
What you need:
1) you need a Android device with Google Now activated
2) Automate App from the Google Play Store
To interact with Domoticz from an external device I use the JSON method wich is described in the Domoticz Wiki. I will show a lightswitch on command as example in step 3.
Step 1 (enable Google Now):
Make sure that you have given the right permissions and "Ok Google" command is working.
Turn on "Ok Google" on your Android
My settings are:
The above "From any screen" means I can activate a voice command even from standby.
Step 2 (install Automate):
Install the Automate app and make sure you will give it the right permision.
Android Settings -> Accessibility
Make sure you turn it on for the Automate app
It might differ per android device, but I also enabled some permissions (Connectivity and Storage) within the Automate app under Settings -> permissions.
Step 3 (setup your first flow):
- press plus
- insert text: Christmastreeon
- connect OK of box 1 with IN of box 2
- search for "Expression true?"
- insert text: christmastreeon (which is the variable defined earlier) = "Christmas tree on" (which is the text used for recognition)
- connect OK of box 2 with IN of box 3
- connect NO of box 3 with IN of box2
- search for "HTTP request"
- insert text (request URL) http://192.168.1.180:8080/json.htm?type=command¶m=switchlight&idx=99&switchcmd=On
- select request method = GET
- select request content type = JSON
- use your own IP adress for Domoticz
- use the right idx value for the switch
- if you have login credentials in Domoticz enter them here
- connect OK of box 4 with IN of box 2
- press done
- rename the flow towards Christmas tree on and press start
Step 4 (setup your own flows)
I hope you can use the above and create your own flows within the Android Automate app.
I included 2 extra boxes at the end of the flow. See below the example.
- "Interact" where I defined Immediately action " Back", this will perform a tap back button so the Google Now search results will not be displayed
- "Toast show" with the text "Ok, Christmas tree on". A screen popup will be shown.