Page 1 of 1

Ask domoticz for value of sensor value using Google Assistant

Posted: Friday 12 January 2018 15:13
by crashingdutchman
I have managened to have Domoticz respond to "actions" that I submit to it through the Google Assistant on my phone. The smartswitch that I used to switch on or off the lights in our Christmas tree was hard to reach, so in Google Assistant I did this:
  • I created a so called shortcut so that when I say "Switch off the Christmas tree" Google Assistant does a "switch off the Christmas tree"
  • In IFTTT I created a Recipe using Google Assistant. It listens to the trigger "switch of the Christmas tree"
  • When this trigger is received, IFTTT fires a Webhooks action. This action basically is a request to my Domoticz instance used to switch off a device (see the Domoticz API on how to do that)
  • When the action has finished, Assistant responds with "Your Christmas tree has been switched off"
The Christmas tree has been dismantled a week ago, so I am not using it anymore until December, but I have other actions defined in Google Assistant too. When I say "Good night" or "Good evening", all devices in a certain group are switched off and when I say "Good morning" to Google Assistant the same group is switched on.

I wanted to develop this further to have my Google Assistant to tell me the temperature in the "living room", "office" or "outside" when I ask for it. Have not yet found out how to do that.

Suggestions are welcome!

Re: Ask domoticz for value of sensor value using Google Assistant

Posted: Friday 12 January 2018 15:53
by PeterFleur
Take a look at the thread about Controlicz in this forum for a nice way to integrate Domoticz with Google Home

Sent from my SM-G930F using Tapatalk


Re: Ask domoticz for value of sensor value using Google Assistant

Posted: Friday 12 January 2018 16:14
by DewGew

Re: Ask domoticz for value of sensor value using Google Assistant

Posted: Monday 15 January 2018 9:59
by crashingdutchman
Thank you both for your replies. I am going to look into that now.

Re: Ask domoticz for value of sensor value using Google Assistant

Posted: Tuesday 26 February 2019 3:45
by CarlosDom
Controlicz is not free anymore.
Does anybody know how to retrieve a domoticz temperature from google home?
Thanks

Re: Ask domoticz for value of sensor value using Google Assistant

Posted: Tuesday 26 February 2019 11:47
by fratton
I use : https://github.com/dohliam/stream2chromecast

SH:

Code: Select all

#!/bin/bash
fichier=/tmp/message.mp3
IPGH="192.168.1.78"
message=$1 # text message
kill -9 `ps aux | grep 'stream2chromecast.py' | awk '{print $2}'`

rm -f $fichier

curl -s -G "http://translate.google.com/translate_tts" --data "ie=UTF-8&total=1&idx=0&client=tw-ob&&tl=fr-FR" --data-urlencode "q=$message" -A "Mozilla" --compressed -o $fichier

chown pi:pi $fichier
chmod 666 $fichier

python /home/pi/domoticz/scripts/sh/stream2chromecast/stream2chromecast.py -devicename $IPGH $fichier &

sleep 10s
kill -9 `ps aux | grep 'stream2chromecast.py' | awk '{print $2}'`
rm -f $fichier
LUA :

Code: Select all

local ligne='sh /home/pi/domoticz/scripts/sh/stream2chromecast/notification_google_home.sh "'..s_temperature..' degrés" &'
os.execute(ligne)
IFTTT WebHooks Call Example to the Sentence "What is the home temperature" :[/code]