Domoticz-Google-Assistant (dzga) Topic is solved

Alexa, Google Home and Siri

Moderator: leecollings

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

Re: Domoticz-Google-Assistant (dzga)

Post by DewGew »

jpvaneijk wrote: Saturday 02 December 2023 12:49
louresman wrote: Friday 01 December 2023 20:44 Hi DewGew,

After the latest update, I can now access the user interface and see my Domoticz devices.
Thanks for your work fixing this issue.
Just to be clear: This is not on Bookworm or a RPi 5 right?
Thanx
DZGA-Flask schould now work in bookworm

Code: Select all

bash <(curl -s https://raw.githubusercontent.com/DewGew/dzga-installer/master/DZGA-Flask-install.sh)
Raspberry Pi 3 | domoticz | Aeon Labs Z-Stick GEN5 | RFlink gateway
NanoPi NEO-air | REGO6XX interface | Machinon theme | Homebridge | Domoticz Google Assistant | ideAlarm
jpvaneijk
Posts: 76
Joined: Thursday 07 June 2018 21:57
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Noordwijk, Netherlands
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by jpvaneijk »

DewGew you are a hero. I was planning a rollback to the RPi 4B with Bullseye tomorrow.
Super thanks for your work, no doubt it will have taken a lot of time again.

At least you made me very happy. Thanks!
jpvaneijk
Posts: 76
Joined: Thursday 07 June 2018 21:57
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Noordwijk, Netherlands
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by jpvaneijk »

Still, I do encounter a little problem unfortunately.
DZGA Flask seems to work for the most part. the server data is filled and there seems to be a connection between Domoticz and DZGA Flask.
I have created a new admin and SSL also seems to be working as I can log in nicely with my domain name.
The Smart-home-key.json file is uploaded and DZGA sees version DZGA-Flask Version: 23.9 and Domoticz Version: 2023.2.

When I want to sync my devices, nothing actually happens and they do not become visible. I created a new key for the Smart-home-key.json file just to be sure, but this did not help either. I am sending the data from the log. It seems I am missing something.
Anybody have an idea?

Incidentally, I have also tried several times to upload a photo that is placed neatly in the DZGA folder but does not show up in the user interface. The photo is 200/200 and both jpg and png have been tried. Of course with the correct name of the newly created admin.
This is obviously not a very big problem. :D

Code: Select all

2023-12-08 00:01:21 Smarthome server has started.
2023-12-08 00:01:21 Running with ssl
2023-12-08 00:01:28 Starting new HTTP connection (1): 192.168.1.9:8080
2023-12-08 00:01:28 http://192.168.1.9:8080 "GET /json.htm?type=command&param=getversion HTTP/1.1" 200 314
2023-12-08 00:01:28 Starting new HTTP connection (1): 192.168.1.9:8080
2023-12-08 00:01:28 http://192.168.1.9:8080 "GET /json.htm?type=command&param=getusers HTTP/1.1" 200 202
2023-12-08 00:01:34 Starting new HTTP connection (1): 192.168.1.9:8080
2023-12-08 00:01:34 http://192.168.1.9:8080 "GET /json.htm?type=command&param=getversion HTTP/1.1" 200 314
2023-12-08 00:01:56 Starting new HTTP connection (1): 192.168.1.9:8080
2023-12-08 00:01:56 http://192.168.1.9:8080 "GET /json.htm?type=command&param=getversion HTTP/1.1" 200 314
2023-12-08 00:01:59 Starting new HTTP connection (1): 192.168.1.9:8080
2023-12-08 00:01:59 http://192.168.1.9:8080 "GET /json.htm?type=command&param=getversion HTTP/1.1" 200 314
2023-12-08 00:01:59 Error on request:
Traceback (most recent call last):
  File "/home/MY USERNAME/DZGA-Flask/env/lib/python3.11/site-packages/werkzeug/serving.py", line 364, in run_wsgi
    execute(self.server.app)
  File "/home/MY USERNAME/DZGA-Flask/env/lib/python3.11/site-packages/werkzeug/serving.py", line 328, in execute
    write(data)
  File "/home/MY USERNAME/DZGA-Flask/env/lib/python3.11/site-packages/werkzeug/serving.py", line 300, in write
    self.wfile.write(hex(len(data))[2:].encode())
  File "/usr/lib/python3.11/socketserver.py", line 834, in write
    self._sock.sendall(b)
  File "/usr/lib/python3.11/ssl.py", line 1241, in sendall
    v = self.send(byte_view[count:])
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/ssl.py", line 1210, in send
    return self._sslobj.write(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2393)
2023-12-08 00:05:08 Starting new HTTP connection (1): IP ADRES:8080
2023-12-08 00:05:08 http://IP ADRES:8080 "GET /json.htm?type=command&param=getversion HTTP/1.1" 200 314
2023-12-08 00:05:08 Starting new HTTP connection (1): IP ADRES:8080
2023-12-08 00:05:08 http://IP ADRES:8080 "GET /json.htm?type=command&param=getusers HTTP/1.1" 200 202
2023-12-08 00:16:15 Starting new HTTP connection (1): IP ADRES:8080
2023-12-08 00:16:15 http://IP ADRES:8080 "GET /json.htm?type=command&param=getversion HTTP/1.1" 200 314
2023-12-08 00:16:15 Error on request:
Traceback (most recent call last):
  File "/home/MY USERNAME/DZGA-Flask/env/lib/python3.11/site-packages/werkzeug/serving.py", line 364, in run_wsgi
    execute(self.server.app)
  File "/home/MY USERNAME/DZGA-Flask/env/lib/python3.11/site-packages/werkzeug/serving.py", line 328, in execute
    write(data)
  File "/home/MY USERNAME/DZGA-Flask/env/lib/python3.11/site-packages/werkzeug/serving.py", line 300, in write
    self.wfile.write(hex(len(data))[2:].encode())
  File "/usr/lib/python3.11/socketserver.py", line 834, in write
    self._sock.sendall(b)
  File "/usr/lib/python3.11/ssl.py", line 1241, in sendall
    v = self.send(byte_view[count:])
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/ssl.py", line 1210, in send
    return self._sslobj.write(data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2393)
jpvaneijk
Posts: 76
Joined: Thursday 07 June 2018 21:57
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Noordwijk, Netherlands
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by jpvaneijk »

I am still trying to provide some additional information. I run into some other strange things that do not clarify for me, but perhaps another person.

When I log in with http://xxx.xxx.xxx.x:8181/settings I get into the user interface just fine and everything seems to work fine there.
The same is true when I log in with https://MyDomain.nl.
At first I create a new user with admin rights, upload the smart-home-key.json and fill in all the details that are otherwise necessary. I leave the SSL untouched for now because if I fill the info incorrectly, I won't get into the user interface and then have to reinstall DZGA-Flask.
Everything then seems to work fine but I don't get to see any devices even after several reboots and syncs.

I also created a new project on Actions on Google with a different name than I was using on DZGA. No better results with this either unfortunately.
In the Google Home app I can find my created project just fine: [test] DZGA2.
I am then directed via mydomainname to the login screen of DZGA-Flask and I log in with the user I created with admin rights.
I then get the response: Could not reach [test] DZGA2. Please try again.
After trying several times, of course, no result other than this.

It is strange that I can still log in with my old [test] DZGA. I no longer have the old DZGA running anywhere but in Google Home the old devices appear, which remain grayed out.

But then, suddenly and out of nowhere, devices appear in the dashboard and on the devices tab. straight from Domoticz.
No idea how that can happen so suddenly to an hour but apparently my settings are correct.
By the way, the status of found devices does not seem right either. Where lamps are off in the dashboard they are indeed on, also in Domoticz.
So tried again to link the GH app but unfortunately also without result.

I was able to reproduce this a few times. But the devices keep coming per very late and there is no connection between the GH app after logging into the app. So the connection seems to be there but after logging in something goes missing.

The log from DZGA Flask has become quite extensive and cannot be sent along because it exceeds the maximum number of characters. However, I cannot read it sufficiently to make sense of it.
I am hoping for some more guidance and am quite willing to do some testing but am hardly getting anywhere myself.

Please let me kno what kind of info you need to resolve this.

Thanx
jpvaneijk
Posts: 76
Joined: Thursday 07 June 2018 21:57
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Noordwijk, Netherlands
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by jpvaneijk »

Got it!!
Sorry for the extensive writing above but it looks like I was able to partially fix it.
When I created a new project Actions on Google, I found out that some new things need to be filled such as contacts, developers, email addresses and more. Even photos.

I found a description of what I mean here: https://github.com/mikejac/node-red-con ... uctions.md (see from item 14)
For the privacy part, I recommend creating a document with any text that you place in a publicly accessible place such as Google Drive, for example.
The text I used myself is:
"This application is intended for the private use of its developer. Any unauthorized users which connect to this service should have no expectation of privacy or protection of their data."

I thought I had everything filled correctly but got stuck with [test] app could not be reached, please try again after logging in.

I decided to create another new project, filling these details a bit more extensively. I also created another ClientID and SecretID and a new smart-home-key.json. After that I deleted Google Home from my mobile and reinstalled it.
Now I could log in immediately and all devices became visible in the Google Home app.

It remains strange that it took so long for the devices to become visible in DZGA-Flask but at least for now it seems to be working. So far.
Sorry for all the spamming but still wanted to share the solution
jpvaneijk
Posts: 76
Joined: Thursday 07 June 2018 21:57
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Noordwijk, Netherlands
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by jpvaneijk »

Pffffffffff,
Once more, after a few hours work, I'm complety lost again: [test] app could not be reached, please try again.
I noticed that things translated a bit messily from Domoticz. Devices I put in a room in Google Home were found in the wrong room. In Google Home, devices were set to offline, where they did work just fine. After several syncs and restarts of Domoticz and Flask, I thought it would be good to reconnect the [test] app as well. So that didn't seem to be possible. Anyone with good ideas while I continue to mess around?

One other question. I'm using Harmony Hub Control for My TV/Netflix/Prime activitys. https://github.com/gordonb3/HarmonyHubControl/
In Domoticz, activities like 'Watch TV' are formatted as on/of type. In Google Home, these are grouped into lights. so everything turns on and off, including the TV that is.
Is there a way for Google Home not to see these activities as lights?
In Domoticz I've already had the switches from 'on/or' to 'Push On Button' and 'Mediaplayer' but that didn't work. Don't know at this point if that is due to the missing connection between the [test] app and Flask.
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by EdwinK »

Pffffffffff,
Once more, after a few hours work, I'm complety lost again
Can agree on this. For now I put in on hold until there is some more time to figure this all out.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by Xavier82 »

I agree with the remarks above.

Luckely I run DZGA-flask on my test environment with Domoticz BETA release (always updated to beta release).
There are some other issues which I hope can be fixed.

On Github I created an issue about the "Hide" feature slide. When setting this to disabled and save the config, nothing is being saved.
When I logout en login back again the setting is gone (went back to Enable).
Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by Xavier82 »

Hi all,

I hope somebody wants to help me to get DZGA-Flask running, meaning connection to Google Home/Assistant with Ngrok

Running DZGA-Flask on Rpi4B (8GB) with Bullseye OS.
Running Domoticz version 2024.2.
Running DZGA-Flask version 24.1
Both running on the same Rpi4B.

Created DZGA user (with rights of "user") in Domoticz and added devices which may be handled bij DZGA-Flask (Google Home).
In Domoticz in Settings in Security API Basic Auth is enabled.

In DZGA-Flask I created a user (DZGA).
I have configured the Domoticz URL (With IP and port of Domoticz).
I have configured DOmoticz user (DZGA) and the corresponding password.
Domoticz roomplan id is set to "0" (zero).
Google Assistant is set to "Enabled"

Server settings in DZGA-Flask:
Actions on Google Client id: number from "Google APIs & Services" credentials \ OAth 2.0 Client IDs and then the client ID
Actions on Google Client secret: secret from "Google APIs & Services" credentials \ OAth 2.0 Client IDs and then the client secret.

I have uploaded the smart-home-key.json in the upload folder of DZGA-Flask.

On the "Info" tab I can see:
DZGA-Flask Version: 24.1
Domoticz Version: 2024.2

Devices from Domoticz are present in Dashboard and in Devices tab.

The issue I have is with Ngrok (stable tunnel) and connection with Google Home.

I created a project and followed all the steps in the guido of DZGA-Flask.

I have Ngrok agent installed.
I have added the authtoken to the config file.

Then in the cli (Via Putty) I run the command: ngrok http 8181
A tunnel is created with a forward to http://localhost:8181.
Is this port correct or do I need to use an other port?
Does the forward needs to go to DZGA-Flask?

I use the tunnellink in Google Actions:
Http://code-myIP.ngrok-free.app/smarthome
and in account linking:
Autherization url: https://code-myIP.ngrok-free.app/oauth
Token URL: https://code-myIP.ngrok-free.app/token
I press save and after that I press Test.

Then I go to Google Home app on my andoid phone.
I go to settings and I add the project. I need to proceed.
So far so good.
Then I get a screen where I need to login to DZGA
I use username and password with which I login to dzga local on my rpi.

Then Google Home says its linking.
And a short while after Google Home says it can't reach the project ([test] Domoticz Google Assistant)

I hope somebody can help.

Thanks!
meal
Posts: 103
Joined: Monday 04 March 2019 14:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: France
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by meal »

Hello

Context of my domoticz application:
Version: 2024.2 (build 15866)
Build Hash: d7e442ae0-modified
Compile Date: 2024-01-20 16:18:19
dzVents Version: 3.1.8
Python Version: 3.9.2 (default, Mar 12 2021, 04:06:34) [GCC 10.2.1 20210110]

I updated my dzga add on to version 1.23.12 and found 3 issues :

- Door lock does not report the correct state in smarthome_exec method : issue 351
- Pin code not recognized when arm/disarm Security System : issue 352
- Impossible to set the temperature of a waterheater : issue 353

All the issues are created in Domoticz-Google-Assistant GitHub.

For each issue I have suggested a solution to fix it which has been tested successfully on my system.

Hope this might be helpful.

BR
meal
Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by Xavier82 »

@meal:
As can be found in the readme file Domoticz-Google-Assistant isn't supported anymore.
https://github.com/DewGew/Domoticz-Goog ... /README.md

Maybe better luck with DZGA-Flask?
meal
Posts: 103
Joined: Monday 04 March 2019 14:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: France
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by meal »

Hello Xavier82

Thank you for the information.

I have a Domoticz-Google-Assistant up and running so far.

If I switch to DZGA-Flask do I have to create a new project in Google Action Console or can I reuse the one I have setup for Domotics-Google-Assistant ?

Many thanks for the reply.
BR
meal
Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by Xavier82 »

@meal: You should be able to reuse the existing one. Make sure you copy the .json file from Domoticz-Google-Assistant to DZGA-Flask and also copy all the credentials to DZGA-Flask.
Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by Xavier82 »

All,

I hope this information can also help others.

Because I had issues with adding DZGA to Google Home with this error: "can't reach the project ([test] Domoticz Google Assistant)" I have contacted Google and asked to investigate this issue, and so they did.

One of the main reasons for this error is because Google expects specific "traits" for each device type.
Device types and traits which can be handled by Google can be found here:
https://developers.home.google.com/clou ... ud/guides/

In my case I use Door Contacts (Inverted) in Domoticz which are stated as device type "Light".
Google expects for device type light the trait "OnOff" but Domoticz reports back "Unlocked" or "Locked" and this creates a mismatch.

When adding the service in Google Home "[test] projectname" Google makes a devicesync and checks if device types and traits are correct.
Unfortunatly you don't get back the mismatches to troubleshoot and Google Home gives the error: "can't reach the project ([test] Domoticz Google Assistant)".

Google support gives me this link https://developers.home.google.com/tool ... ator?hl=en which can be used to validate the devicetypes and traits.

This issue is also mentioned by @meal in this post: "by meal » Friday 26 January 2024 1:51".

Could this be an enhancement in Domoticz? Change devicetype from "light/switch" to "Lock"
Kedi
Posts: 536
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by Kedi »

You can do that by changing the Switch Type when you edit the widget.
Logic will get you from A to B. Imagination will take you everywhere.
Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by Xavier82 »

Hi Kedi,

I did that, but in Domoticz this device has Device Type "Light/Switch" and Subtype "Switch" with data"Locked" (at this moment).
meal
Posts: 103
Joined: Monday 04 March 2019 14:59
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.7
Location: France
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by meal »

Hello

In my application the device type in domoticz is Door Lock

and in it description I added the following information

<voicecontrol>
devicetype = door
</voicecontrol>

BR
meal
Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by Xavier82 »

Dewgew has updated DZGA.
DoorLockInverted wasn't modeled in DZGA-Flask and is now added.

Though in Domoticz:
Doorlock type Domoticz.png
Doorlock type Domoticz.png (11.06 KiB) Viewed 1292 times
Google knows 2 types:
Door https://developers.home.google.com/clou ... uides/door
Lock https://developers.home.google.com/clou ... uides/lock

In Domoticz it is of type "Light/Switch", teached based on auto MQTT for Shelly device since I use a Shelly1 to report state and open/close garagedoor.
So there is the mismatch.
User avatar
DewGew
Posts: 579
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10618
Location: Sweden
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by DewGew »

https://github.com/DewGew/DZGA-Flask is no on V24.9 enjoy!
Feedback is most wanted
Raspberry Pi 3 | domoticz | Aeon Labs Z-Stick GEN5 | RFlink gateway
NanoPi NEO-air | REGO6XX interface | Machinon theme | Homebridge | Domoticz Google Assistant | ideAlarm
rensbr
Posts: 61
Joined: Friday 27 July 2018 19:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Domoticz-Google-Assistant (dzga)

Post by rensbr »

Maybe a very stupid question. I was using the old dzga, but it is not supported anymore, so I'm trying to change that to this plugin. But I'm running into troubles implemnting this. Google stopped with the use of Action, see: https://developers.google.com/assistant/ca-sunset, so the steps mentioned in: https://github.com/DewGew/DZGA-Flask/wi ... -on-Google can not be executed.

Edit: In order to solve the above problem, I have used the excisting project and changed the settings (and stopped the old integration) and it now seems to work. But for new users this is a problem i think.

Edit2: It seems that the new implementation is a little more stable than the old one, that is great. But when i'm trying to talk to Google Home, I'm still getting quite a lot the message 'Sorry I cannot reach House'. or 'Sorry House is currently unavailable'.

When I then look in the Google Home app all the devices are offline, and when I refresh the devices (by swipeing down) the most of the time the devices come back online) Like the status is not updated in the background, or something. Any thoughts on that?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests