Page 14 of 15
Re: Domoticz to Google Assistant integration
Posted: Thursday 12 March 2020 12:04
by ressof
DewGew wrote: ↑Tuesday 10 March 2020 19:39
ressof wrote: ↑Tuesday 10 March 2020 19:19
Hi
I wonder if I can use Google to change a selector switch?
If it is possible can I have any text on the selector or must it be predefined?
User: Turn on [Level Name] on living room light.
Google Assistant: Turning on [Level Name] on living room light?
When I say "Turn on [Level Name] on living room light." the selector switch in domoticz is changed but Google Assistant is saying there was a problem with living room light. Im using swedish as language.
Re: Domoticz to Google Assistant integration
Posted: Thursday 12 March 2020 12:22
by DewGew
ressof wrote: ↑Thursday 12 March 2020 12:04
DewGew wrote: ↑Tuesday 10 March 2020 19:39
ressof wrote: ↑Tuesday 10 March 2020 19:19
Hi
I wonder if I can use Google to change a selector switch?
If it is possible can I have any text on the selector or must it be predefined?
User: Turn on [Level Name] on living room light.
Google Assistant: Turning on [Level Name] on living room light?
When I say "Turn on [Level Name] on living room light." the selector switch in domoticz is changed but Google Assistant is saying there was a problem with living room light. Im using swedish as language.
Do you use latest? There was a issue with report state before.
Re: Domoticz to Google Assistant integration
Posted: Thursday 12 March 2020 12:34
by Justintime
DewGew wrote:ressof wrote: ↑Thursday 12 March 2020 12:04
DewGew wrote: ↑Tuesday 10 March 2020 19:39
User: Turn on [Level Name] on living room light.
Google Assistant: Turning on [Level Name] on living room light?
When I say "Turn on [Level Name] on living room light." the selector switch in domoticz is changed but Google Assistant is saying there was a problem with living room light. Im using swedish as language.
Do you use latest? There was a issue with report state before.
That would be nice. Repore state means Google home assistant is reporting that the command is succeeded in voice?
Re: Domoticz to Google Assistant integration
Posted: Thursday 12 March 2020 12:36
by DewGew
Justintime wrote: ↑Thursday 12 March 2020 12:34
DewGew wrote:ressof wrote: ↑Thursday 12 March 2020 12:04
When I say "Turn on [Level Name] on living room light." the selector switch in domoticz is changed but Google Assistant is saying there was a problem with living room light. Im using swedish as language.
Do you use latest? There was a issue with report state before.
That would be nice. Repore state means Google home assistant is reporting that the command is succeeded in voice?
Report state is already working if you added the json file. But some devices seems not to work correct, like selector, I think think its a language issue.
Re: Domoticz to Google Assistant integration
Posted: Thursday 12 March 2020 12:48
by Justintime
@DewGew
As Ngrok is noob proof and works flawless I am going to try with Nginx. Because it's a bit of a shame to fill in the credentials Echt time in Google.
In the Nginx configuration file you need to specify ports and a server name.
Do I have to fill in ports from Domoticz? Or just random
And what for the server name? Just think of one.?
Or is it my DNS name from the router.
Which ports needs to be open? Only SSL or both.
Sorry for all these questions. Tried to get Nginx running in the past but never succeeded.
Re: Domoticz to Google Assistant integration
Posted: Thursday 12 March 2020 12:54
by DewGew
Justintime wrote: ↑Thursday 12 March 2020 12:48
@DewGew
As Ngrok is noob proof and works flawless I am going to try with Nginx. Because it's a bit of a shame to fill in the credentials Echt time in Google.
In the Nginx configuration file you need to specify ports and a server name.
Do I have to fill in ports from Domoticz? Or just random
And what for the server name? Just think of one.?
Or is it my DNS name from the router.
Which ports needs to be open? Only SSL or both.
Sorry for all these questions. Tried to get Nginx running in the past but never succeeded.
See the guide in
https://github.com/DewGew/Domoticz-Goog ... erse-proxy
Dont forget to open port 443 and port 80 to nginx server
Re: Domoticz to Google Assistant integration
Posted: Thursday 12 March 2020 13:42
by Justintime
DewGew wrote:Justintime wrote: ↑Thursday 12 March 2020 12:48
@DewGew
As Ngrok is noob proof and works flawless I am going to try with Nginx. Because it's a bit of a shame to fill in the credentials Echt time in Google.
In the Nginx configuration file you need to specify ports and a server name.
Do I have to fill in ports from Domoticz? Or just random
And what for the server name? Just think of one.?
Or is it my DNS name from the router.
Which ports needs to be open? Only SSL or both.
Sorry for all these questions. Tried to get Nginx running in the past but never succeeded.
See the guide in
https://github.com/DewGew/Domoticz-Goog ... erse-proxy
Dont forget to open port 443 and port 80 to nginx server
Yes I understand... Looks pretty straight forward, But i have other ports signed to Domoticz http and ssl.
Do they need to be pointed domoticz ports to the config file? Or can I choose random ports different than Domoticz. Because 80 and 443 is a bit too common.
And the servername where I have to fill in seatrip.example.com.
Can I choose Just a random name?
Re: Domoticz to Google Assistant integration
Posted: Thursday 12 March 2020 14:09
by DewGew
Justintime wrote: ↑Thursday 12 March 2020 13:42
DewGew wrote:Justintime wrote: ↑Thursday 12 March 2020 12:48
@DewGew
As Ngrok is noob proof and works flawless I am going to try with Nginx. Because it's a bit of a shame to fill in the credentials Echt time in Google.
In the Nginx configuration file you need to specify ports and a server name.
Do I have to fill in ports from Domoticz? Or just random
And what for the server name? Just think of one.?
Or is it my DNS name from the router.
Which ports needs to be open? Only SSL or both.
Sorry for all these questions. Tried to get Nginx running in the past but never succeeded.
See the guide in
https://github.com/DewGew/Domoticz-Goog ... erse-proxy
Dont forget to open port 443 and port 80 to nginx server
Yes I understand... Looks pretty straight forward, But i have other ports signed to Domoticz http and ssl.
Do they need to be pointed domoticz ports to the config file? Or can I choose random ports different than Domoticz. Because 80 and 443 is a bit too common.
And the servername where I have to fill in seatrip.example.com.
Can I choose Just a random name?
Do have reverse proxy for domoticz also?
if you want to access both domoticz and dzga you can something like proxy_pass:
Code: Select all
location /assistant/ {
proxy_pass http://127.0.0.1:3030;
}
location /domo/ {
proxy_pass http://127.0.0.1:8080;
}
Address will be
https://public.address/domo for domoticz and
https://public.adress/assistant for dzga
https://docs.nginx.com/nginx/admin-guid ... rse-proxy/
Re: Domoticz to Google Assistant integration
Posted: Thursday 12 March 2020 19:34
by ressof
DewGew wrote: ↑Thursday 12 March 2020 12:36
Justintime wrote: ↑Thursday 12 March 2020 12:34
DewGew wrote:
Do you use latest? There was a issue with report state before.
That would be nice. Repore state means Google home assistant is reporting that the command is succeeded in voice?
Report state is already working if you added the json file. But some devices seems not to work correct, like selector, I think think its a language issue.
What json file?
Re: Domoticz to Google Assistant integration
Posted: Thursday 12 March 2020 19:37
by DewGew
In latest beta I added timer function for lights, switches, fan, heater, kettle.
To make this work you need Domoticz version above 4.11687 (dzVents 3.0.0). Also you need to add a dzVents script in Domoticz to act like a timer. You can name the script what ever you want.
dzVents script:
Code: Select all
return {
on = {
customEvents = { 'TIMER' },
},
execute = function(dzga, item)
local device = dzga.devices(item.data.idx)
if (device.active and item.data.cancel) then
dzga.log('Stop timer for ' .. device.name, dzga.LOG_FORCE)
device.cancelQueuedCommands()
else
dzga.log('No timer is running for' .. device.name, dzga.LOG_FORCE)
end
if item.data.on == true then
device.cancelQueuedCommands()
device.switchOn()
dzga.log('Switch ' .. device.name .. ' On for: ' .. item.data.time .. ' sec', dzga.LOG_FORCE)
device.switchOff().afterSec(item.data.time)
end
end
}
Now you can use timer like:
"Turn on kithen light for 5 minutes" or "Turn on heater for 30 minutes"
To cancel timer:
"Stop kitchen light timer" (you have to turn off light/switch manually)
If you set a timer before the time run out. Time resets with new time.
Feel free to improve!
Re: Domoticz to Google Assistant integration
Posted: Thursday 12 March 2020 19:42
by DewGew
ressof wrote: ↑Thursday 12 March 2020 19:34
DewGew wrote: ↑Thursday 12 March 2020 12:36
Justintime wrote: ↑Thursday 12 March 2020 12:34
That would be nice. Repore state means Google home assistant is reporting that the command is succeeded in voice?
Report state is already working if you added the json file. But some devices seems not to work correct, like selector, I think think its a language issue.
What json file?
Smart-home-key.json
Explained in wiki
https://github.com/DewGew/Domoticz-Goog ... -on-Google
Re: Domoticz to Google Assistant integration
Posted: Thursday 12 March 2020 23:19
by Justintime
Just as I thought can't get Nginx to work.
When i login in my domain:port I can give in the name and password. I come on a page with page not found.
Configured with openssl
When i do sudo Nginx - t it gives syntax OK.
Re: Domoticz to Google Assistant integration
Posted: Friday 13 March 2020 7:12
by ressof
DewGew wrote: ↑Thursday 12 March 2020 19:42
ressof wrote: ↑Thursday 12 March 2020 19:34
DewGew wrote: ↑Thursday 12 March 2020 12:36
Report state is already working if you added the json file. But some devices seems not to work correct, like selector, I think think its a language issue.
What json file?
Smart-home-key.json
Explained in wiki
https://github.com/DewGew/Domoticz-Goog ... -on-Google
Ok, That file I have.
I upgraded to latest version of your program and now when I try to change selector switch with Google Assistant it dosent work at all.
Re: Domoticz to Google Assistant integration
Posted: Friday 13 March 2020 10:09
by DewGew
ressof wrote: ↑Friday 13 March 2020 7:12
Ok, That file I have.
I upgraded to latest version of your program and now when I try to change selector switch with Google Assistant it dosent work at all.
I'm running domoticz beta 4.11724, dzga beta v1.6.5 and it's working correct.
I added a selector switch named
"Tore" with levels:
'Soluppgång' and
'Solnedgång' then I restarted dzga then sync my devices. Now I called voice command:
"Aktivera soluppgång på Tore".
Works correct.
Re: Domoticz to Google Assistant integration
Posted: Friday 13 March 2020 10:14
by DewGew
Justintime wrote: ↑Thursday 12 March 2020 23:19
Just as I thought can't get Nginx to work.
When i login in my domain:port I can give in the name and password. I come on a page with page not found.
Configured with openssl
When i do sudo Nginx - t it gives syntax OK.
I as told before I dont use or used nginx revers' proxy. Seems like I need to try it out..
Did configure proxy_pass?
Try https://public_url/assistant/settings
Re: Domoticz to Google Assistant integration
Posted: Thursday 19 March 2020 10:39
by fransiefrans
Hi all,
I'm pleased to see this project. Thank all of you who helped to put this together.
I have no experience with coding at all beside copy and past.
With the following part I have some trouble understanding what I must do.
Make local deployment available trough HTTPS with valid certificate with one below:
Use ngrok for a secure SSL tunnel with valid public HTTPS URL
Configure reverse proxy with domain name and valid certificate using Lets Encrypt
SSL with own domain or dynamic DNS, require ssl key and ssl certficate
Is there someone who can show me how to do this?
can anyone tell me what I fill in @ your public url? I can't figure it out; https://[your public url]/oauth
Thanks in advance!
Re: Domoticz to Google Assistant integration
Posted: Sunday 22 March 2020 12:31
by fabry91
Pawcio wrote: ↑Wednesday 06 March 2019 12:12
Domoticz to Google Assistan integration
Before first launch, config.py must be modified properly:
PORT_NUMBER = 3030 -> port number for the aog server
SMARTHOMEPROVIDERGOOGLECLIENTID = 'AxqqWpwYj4' - Client ID issued by your Actions to Google, check actions on google configuration
SMARTHOMEPROVIDEGOOGLECLIENTSECRET = '11MH3uWlMVrqa7FAbKLBoNUMCyLC22' - Client secret
SMARTHOMEPROVIDERAPIKEY = 'zOzaSyBu5Y8W7EiHvO1eyPmOAtZRxM9GaLP_uLA' ->
https://github.com/actions-on-google/sm ... quest-sync
DOMOTICZ_URL='http://[DOMOTICZ_IP]:[PORT]'
U_NAME_DOMOTICZ = 'domoticz user name'
U_PASSWD_DOMOTICZ = 'domoticz user password'
#oauth credentials -> required for app linking
U_NAME = 'username'
U_PASSWD = 'password'
if required nicknames, room hint and ack for selected devices can be added:
DEVICE_CONFIG = {
'135' : { - domoticz's idx of the device
'nicknames' : ['Kitchen Blind One'], - list of the nicknames
'room' : 'Kitchen' , - room hint
'ack' : True}, - ack for command execution
starting aog server:
python3 aog
Hello,
I'm so sorry if this is gonna be a stupid question: where I can find the configuration file
config.py, I've searched everywhere in my raspb, I'm sure I already have python 3.5 installed.
Thank you very much

Re: Domoticz to Google Assistant integration
Posted: Sunday 22 March 2020 12:54
by DewGew
Re: Domoticz to Google Assistant integration
Posted: Sunday 22 March 2020 12:56
by DewGew
fabry91 wrote: ↑Sunday 22 March 2020 12:31
Hello,
I'm so sorry if this is gonna be a stupid question: where I can find the configuration file
config.py, I've searched everywhere in my raspb, I'm sure I already have python 3.5 installed.
Thank you very much
Read above
Re: Domoticz to Google Assistant integration
Posted: Sunday 22 March 2020 15:05
by fabry91
DewGew wrote: ↑Sunday 22 March 2020 12:56
fabry91 wrote: ↑Sunday 22 March 2020 12:31
Hello,
I'm so sorry if this is gonna be a stupid question: where I can find the configuration file
config.py, I've searched everywhere in my raspb, I'm sure I already have python 3.5 installed.
Thank you very much
Read above
Hello DewGew,
okay all set-up, last thing I don't have understand, how and where I can write the command to e.g.: open "main gate", open "gate", where main gate and gate are idx (relay) connected to my domoticz system and then control the drive gate and walk gate.
Thank you!!