Domoticz to Google Assistant integration

Alexa, Google Home and Siri

Moderator: leecollings

ressof
Posts: 60
Joined: Thursday 20 April 2017 7:20
Target OS: Linux
Domoticz version: Latest
Contact:

Re: Domoticz to Google Assistant integration

Post 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.
User avatar
DewGew
Posts: 581
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10618
Location: Sweden
Contact:

Re: Domoticz to Google Assistant integration

Post 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.
Raspberry Pi 3 | domoticz | Aeon Labs Z-Stick GEN5 | RFlink gateway
NanoPi NEO-air | REGO6XX interface | Machinon theme | Homebridge | Domoticz Google Assistant | ideAlarm
Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Domoticz to Google Assistant integration

Post 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?


Last edited by Justintime on Thursday 12 March 2020 12:34, edited 2 times in total.
User avatar
DewGew
Posts: 581
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10618
Location: Sweden
Contact:

Re: Domoticz to Google Assistant integration

Post 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.
Raspberry Pi 3 | domoticz | Aeon Labs Z-Stick GEN5 | RFlink gateway
NanoPi NEO-air | REGO6XX interface | Machinon theme | Homebridge | Domoticz Google Assistant | ideAlarm
Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Domoticz to Google Assistant integration

Post 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.

User avatar
DewGew
Posts: 581
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10618
Location: Sweden
Contact:

Re: Domoticz to Google Assistant integration

Post 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
Raspberry Pi 3 | domoticz | Aeon Labs Z-Stick GEN5 | RFlink gateway
NanoPi NEO-air | REGO6XX interface | Machinon theme | Homebridge | Domoticz Google Assistant | ideAlarm
Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Domoticz to Google Assistant integration

Post 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?
User avatar
DewGew
Posts: 581
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10618
Location: Sweden
Contact:

Re: Domoticz to Google Assistant integration

Post 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/
Raspberry Pi 3 | domoticz | Aeon Labs Z-Stick GEN5 | RFlink gateway
NanoPi NEO-air | REGO6XX interface | Machinon theme | Homebridge | Domoticz Google Assistant | ideAlarm
ressof
Posts: 60
Joined: Thursday 20 April 2017 7:20
Target OS: Linux
Domoticz version: Latest
Contact:

Re: Domoticz to Google Assistant integration

Post 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?
User avatar
DewGew
Posts: 581
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10618
Location: Sweden
Contact:

Re: Domoticz to Google Assistant integration

Post 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!
Raspberry Pi 3 | domoticz | Aeon Labs Z-Stick GEN5 | RFlink gateway
NanoPi NEO-air | REGO6XX interface | Machinon theme | Homebridge | Domoticz Google Assistant | ideAlarm
User avatar
DewGew
Posts: 581
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10618
Location: Sweden
Contact:

Re: Domoticz to Google Assistant integration

Post 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
Raspberry Pi 3 | domoticz | Aeon Labs Z-Stick GEN5 | RFlink gateway
NanoPi NEO-air | REGO6XX interface | Machinon theme | Homebridge | Domoticz Google Assistant | ideAlarm
Justintime
Posts: 228
Joined: Thursday 21 May 2015 9:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Contact:

Re: Domoticz to Google Assistant integration

Post 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. Image
ressof
Posts: 60
Joined: Thursday 20 April 2017 7:20
Target OS: Linux
Domoticz version: Latest
Contact:

Re: Domoticz to Google Assistant integration

Post 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.
User avatar
DewGew
Posts: 581
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10618
Location: Sweden
Contact:

Re: Domoticz to Google Assistant integration

Post by DewGew »

ressof wrote: Friday 13 March 2020 7:12
DewGew wrote: Thursday 12 March 2020 19:42
ressof wrote: Thursday 12 March 2020 19:34
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.
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.
Raspberry Pi 3 | domoticz | Aeon Labs Z-Stick GEN5 | RFlink gateway
NanoPi NEO-air | REGO6XX interface | Machinon theme | Homebridge | Domoticz Google Assistant | ideAlarm
User avatar
DewGew
Posts: 581
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10618
Location: Sweden
Contact:

Re: Domoticz to Google Assistant integration

Post 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
Raspberry Pi 3 | domoticz | Aeon Labs Z-Stick GEN5 | RFlink gateway
NanoPi NEO-air | REGO6XX interface | Machinon theme | Homebridge | Domoticz Google Assistant | ideAlarm
fransiefrans
Posts: 59
Joined: Sunday 14 June 2015 13:22
Target OS: Raspberry Pi / ODroid
Domoticz version: stable
Location: Netherlands
Contact:

Re: Domoticz to Google Assistant integration

Post 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!
User avatar
fabry91
Posts: 67
Joined: Sunday 09 December 2018 16:52
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Italy
Contact:

Re: Domoticz to Google Assistant integration

Post 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 :|
User avatar
DewGew
Posts: 581
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10618
Location: Sweden
Contact:

Re: Domoticz to Google Assistant integration

Post by DewGew »

Dzga has been changed alot. Visit https://github.com/DewGew/Domoticz-Google-Assistant for new version
Raspberry Pi 3 | domoticz | Aeon Labs Z-Stick GEN5 | RFlink gateway
NanoPi NEO-air | REGO6XX interface | Machinon theme | Homebridge | Domoticz Google Assistant | ideAlarm
User avatar
DewGew
Posts: 581
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10618
Location: Sweden
Contact:

Re: Domoticz to Google Assistant integration

Post 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
Raspberry Pi 3 | domoticz | Aeon Labs Z-Stick GEN5 | RFlink gateway
NanoPi NEO-air | REGO6XX interface | Machinon theme | Homebridge | Domoticz Google Assistant | ideAlarm
User avatar
fabry91
Posts: 67
Joined: Sunday 09 December 2018 16:52
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Italy
Contact:

Re: Domoticz to Google Assistant integration

Post 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!!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest