Google voice

From Domoticz
Jump to: navigation, search


Register at - Please read the FAQ first

Add the devices you want to control into Room Plans in your Domoticz instance

setup port forwarding for your SSL port - this only works with HTTPS

Enable the skill on your Google Home or Google Assistant - and you're done :)


Since Nov 2015, Google voice controls the number of call per IP. So if you have a dynamic IP, and are not lucky, you may be banned.

So this service may not be usable anymore. If so, use VoiceRSS. I have updated the wiki with a VoiceRSS howto, look here :


This script will play a string into google translate. It is useful to allow domoticz to give voice notifications.

Dependencies - hardware / software / operating system

  • To trigger this script you can use Trigger a bash script method or any other method.
  • Make sure you have a working sound card on domoticz computer
  • Make sure you have internet access on domoticz computer
  • Make sure mplayer is installed : sudo apt-get install mplayer

Domoticz Setup - switches, variables, version


Installation instructions

Copy this script in your domoticz\scripts\ folder.

Script with comments Part 1 (lua)

local sensor  = 'Talk - Garbage'
local sensor2 = 'Talk - Recycling'
local sensor3 = 'Talk - Robot'
local sensor4 = 'Talk - Washing'
local sensor5 = 'Talk - Good Morning'
local sensor6 = 'Talk - Humidity'
local sensor7 = 'Security Panel'
local sensor8 = 'Talk - Compost'

commandArray = {} 

if (devicechanged[sensor] == 'On') then
os.execute ("/root/domoticz/domoticz/scripts/ Bring the garbage bag out")

if (devicechanged[sensor2] == 'On') then
os.execute ("/root/domoticz/domoticz/scripts/ Bring the recycling bin out")

if (devicechanged[sensor3] == 'On') then
os.execute ("/root/domoticz/domoticz/scripts/ Clean Mr. Robot")

if (devicechanged[sensor4] == 'On') then
os.execute ("/root/domoticz/domoticz/scripts/ Wash the clothes that are dirty")

if (devicechanged[sensor5] == 'On') then

os.execute ("/root/domoticz/domoticz/scripts/ Buesnas dias Wendy")
os.execute ("/root/domoticz/domoticz/scripts/ " .."today is %A, in %B %d %Y ") )
os.execute ("/root/domoticz/domoticz/scripts/ enjoy your day" )

commandArray['Talk - Weather Now']='On'

if (devicechanged[sensor7] == 'Arm Home') then
os.execute ("/root/domoticz/domoticz/scripts/ Security panel is set to Arm Home")

if (devicechanged[sensor7] == 'Normal') then
os.execute ("/root/domoticz/domoticz/scripts/ Security panel is set to Disarm")

if (devicechanged[sensor7] == 'Arm Away') then
os.execute ("/root/domoticz/domoticz/scripts/ Security panel is set to Arm Away")

if (devicechanged[sensor8] == 'On') then
os.execute ("/root/domoticz/domoticz/scripts/ Bring the composting bin out")

return commandArray

Script with comments Part 2 (bash)

For the language type check this : HERE

mplayer -ao alsa -noconsolecontrols "$*" > /dev/null 2>&1

In some setups the statement above does not work, use the following to download an MP3 with the requested text and play that with mplayer

curl '' -H 'Referer:' -H 'User-Agent: stagefright/1.2 (Linux;Android 5.0)' > google_tts.mp3
mplayer -ao alsa google.tts.mp3

Example of use (if relevant) i.e. output files / screen displays