Page 1 of 19
Domoticz-Google-Assistant (dzga)
Posted: Friday 27 March 2020 8:31
by DewGew
Control your Domoticz devices with Google Assistant
Standalone implementation for Domoticz. It means that you can put this server wherever you want, even on another machine. You need to setup a project in Actions on Google Console. You find instructions below.
Based on Pawcio's script at this
forum thread
Required:
- public url
- python >= 3.5
- Make local deployment available trough HTTPS with valid certificate with one below:
- Configure reverse proxy with valid certificate using Let's Encrypt
- Use ngrok (included in dzga) for a secure SSL tunnel with valid public HTTPS URL
- SSL with own domain or dynamic DNS, require ssl key and ssl certficate
Domoticz-Google-Assistant delivers:
- The oauth authorization and smarthome endpoint for the google assistant.
- Two-factor authentication domoticz protected devices. (limited language support)
- Arm Disarm Securitypanel. (limited language support)
- Stream surveillance camera to chromecast.
- Toggel Selector devices
- Thermostat modes
- Query battery level
- Switch Off timer
- Change device type
- Chromecast Notification
- and more..
Installation Raspberry Pi/Ubuntu:
Just run below in terminal
Code: Select all
bash <(curl -s https://raw.githubusercontent.com/DewGew/dzga-installer/master/install.sh)
Installation Docker:
Code: Select all
cd /home/${USER}
git clone https://github.com/DewGew/Domoticz-Google-Assistant -b docker --single-branch
docker-compose -f /home/${USER}/Domoticz-Google-Assistant/docker-compose.yaml up -d
You can access the interface via
http://localhost:3030/settings. The default username is admin and the default password is admin.
Wiki:
https://github.com/DewGew/Domoticz-Goog ... stant/wiki
Sourcecode:
https://github.com/DewGew/Domoticz-Google-Assistant
Please feel free to modify it, extend and improve!
Re: Domoticz-Google-Assistant (dzga)
Posted: Friday 27 March 2020 8:34
by DewGew
Functions on latest V1.7.2
There is new function to change device type, icon and some behavior depending on the device (e.g open/close instead of on/off).
For fully control you can remove
Image_Override from config.
To change device type, add to discription for your device in domoticz:
Code: Select all
<voicecontrol>
devicetype = oven
</voicecontrol>
or in Device_Config in config.yaml:
Code: Select all
Device_Config:
212:
devicetype: 'oven'
Light Device types to choose from is:
light, ac_unit, bathtub, coffemaker, dishwasher, dryer, fan, heater, kettle, media, microwave, outlet, oven, speaker, switch, vacuum, washer, waterheater, window, gate, garage.
For
heater, kettle, waterheater, oven you can also use
merge_thermo_idx to merge thermostat to control temperature.
Code: Select all
<voicecontrol>
devicetype = oven
merge_thermo_idx = 432
</voicecontrol>
Door Contact devices can choose
window, gate or
garage
Selector devices can choose only
vacuum
Feedback is appreciated
Re: Domoticz-Google-Assistant (dzga)
Posted: Friday 27 March 2020 8:50
by Minglarn
Sorry for the dumb question, but this is only valid för ASSISTANT and not Google Home devices?
Re: Domoticz-Google-Assistant (dzga)
Posted: Friday 27 March 2020 9:15
by DewGew
Minglarn wrote: ↑Friday 27 March 2020 8:50
Sorry for the dumb question, but this is only valid för ASSISTANT and not Google Home devices?
Works with everything that has Google Assistant e.g. Google Assistant app, Google Home, Google Nest Hub, Andoid TV etc..
Re: Domoticz-Google-Assistant (dzga)
Posted: Tuesday 31 March 2020 8:20
by ressof
Hi
When I ask google to turn on or off a device it will do so but google answer that there was an error with the device
I have latest domoticz and dzga versions.
This is from my log:
Code: Select all
2020-03-30 16:45:46 - INFO - Request {
"inputs": [
{
"context": {
"locale_country": "SE",
"locale_language": "sv"
},
"intent": "action.devices.EXECUTE",
"payload": {
"commands": [
{
"devices": [
{
"id": "ColorSwitch427"
}
],
"execution": [
{
"command": "action.devices.commands.OnOff",
"params": {
"on": false
}
}
]
}
]
}
}
],
"requestId": "16575895686983337135"
}
2020-03-30 16:45:46 - ERROR - 400 Client Error: Bad Request for url: https://homegraph.googleapis.com/v1/devices:reportStateAndNotification
2020-03-30 16:45:46 - INFO - Error handling message {'inputs': [{'context': {'locale_country': 'SE', 'locale_language': 'sv'}, 'intent': 'action.devices.EXECUTE', 'payload': {'commands': [{'devices': [{'id': 'ColorSwitch427'}], 'execution': [{'command': 'action.devices.commands.OnOff', 'params': {'on': False}}]}]}}], 'requestId': '16575895686983337135'}: {'errorCode': 'unknownError'}
2020-03-30 16:45:46 - INFO - Response {
"payload": {
"errorCode": "unknownError"
},
"requestId": "16575895686983337135"
}
Do you know what the problem could be? It has been working but I don't know which version I was using.
Re: Domoticz-Google-Assistant (dzga)
Posted: Tuesday 31 March 2020 12:10
by DewGew
ressof wrote: ↑Tuesday 31 March 2020 8:20
Hi
When I ask google to turn on or off a device it will do so but google answer that there was an error with the device
I have latest domoticz and dzga versions.
This is from my log:
Code: Select all
2020-03-30 16:45:46 - INFO - Request {
"inputs": [
{
"context": {
"locale_country": "SE",
"locale_language": "sv"
},
"intent": "action.devices.EXECUTE",
"payload": {
"commands": [
{
"devices": [
{
"id": "ColorSwitch427"
}
],
"execution": [
{
"command": "action.devices.commands.OnOff",
"params": {
"on": false
}
}
]
}
]
}
}
],
"requestId": "16575895686983337135"
}
2020-03-30 16:45:46 - ERROR - 400 Client Error: Bad Request for url: https://homegraph.googleapis.com/v1/devices:reportStateAndNotification
2020-03-30 16:45:46 - INFO - Error handling message {'inputs': [{'context': {'locale_country': 'SE', 'locale_language': 'sv'}, 'intent': 'action.devices.EXECUTE', 'payload': {'commands': [{'devices': [{'id': 'ColorSwitch427'}], 'execution': [{'command': 'action.devices.commands.OnOff', 'params': {'on': False}}]}]}}], 'requestId': '16575895686983337135'}: {'errorCode': 'unknownError'}
2020-03-30 16:45:46 - INFO - Response {
"payload": {
"errorCode": "unknownError"
},
"requestId": "16575895686983337135"
}
Do you know what the problem could be? It has been working but I don't know which version I was using.
check if your smart-home-key.json is valid
Re: Domoticz-Google-Assistant (dzga)
Posted: Tuesday 31 March 2020 12:18
by ressof
DewGew wrote: ↑Tuesday 31 March 2020 12:10
ressof wrote: ↑Tuesday 31 March 2020 8:20
Hi
When I ask google to turn on or off a device it will do so but google answer that there was an error with the device
I have latest domoticz and dzga versions.
This is from my log:
Code: Select all
2020-03-30 16:45:46 - INFO - Request {
"inputs": [
{
"context": {
"locale_country": "SE",
"locale_language": "sv"
},
"intent": "action.devices.EXECUTE",
"payload": {
"commands": [
{
"devices": [
{
"id": "ColorSwitch427"
}
],
"execution": [
{
"command": "action.devices.commands.OnOff",
"params": {
"on": false
}
}
]
}
]
}
}
],
"requestId": "16575895686983337135"
}
2020-03-30 16:45:46 - ERROR - 400 Client Error: Bad Request for url: https://homegraph.googleapis.com/v1/devices:reportStateAndNotification
2020-03-30 16:45:46 - INFO - Error handling message {'inputs': [{'context': {'locale_country': 'SE', 'locale_language': 'sv'}, 'intent': 'action.devices.EXECUTE', 'payload': {'commands': [{'devices': [{'id': 'ColorSwitch427'}], 'execution': [{'command': 'action.devices.commands.OnOff', 'params': {'on': False}}]}]}}], 'requestId': '16575895686983337135'}: {'errorCode': 'unknownError'}
2020-03-30 16:45:46 - INFO - Response {
"payload": {
"errorCode": "unknownError"
},
"requestId": "16575895686983337135"
}
Do you know what the problem could be? It has been working but I don't know which version I was using.
check if your smart-home-key.json is valid
How can I check this?
Re: Domoticz-Google-Assistant (dzga)
Posted: Tuesday 31 March 2020 12:40
by DewGew
Re: Domoticz-Google-Assistant (dzga)
Posted: Tuesday 31 March 2020 21:11
by Justintime
The best and easiest way to connect Domticz to Google Home.
Still i get the message "there is an unknown fault" (in dutch) I know this is a language thing. Is this on the roadmap to solve?
Otherwise i know what to do in Domiticz to quiet this.
Re: Domoticz-Google-Assistant (dzga)
Posted: Wednesday 01 April 2020 7:42
by DewGew
Justintime wrote: ↑Tuesday 31 March 2020 21:11
The best and easiest way to connect Domticz to Google Home.
Still i get the message "there is an unknown fault" (in dutch) I know this is a language thing. Is this on the roadmap to solve?
Otherwise i know what to do in Domiticz to quiet this.
I dont get that message. When do you get it?
Re: Domoticz-Google-Assistant (dzga)
Posted: Wednesday 01 April 2020 8:45
by ressof
I have completely removed my config on google and started over but with the same problem.
I have Swedish as language. But this have been working before.
Re: Domoticz-Google-Assistant (dzga)
Posted: Wednesday 01 April 2020 9:20
by DewGew
ressof wrote: ↑Wednesday 01 April 2020 8:45
I have completely removed my config on google and started over but with the same problem.
I have Swedish as language. But this have been working before.
Is it same on all switches or just colorswitch?
Re: Domoticz-Google-Assistant (dzga)
Posted: Wednesday 01 April 2020 9:37
by ressof
DewGew wrote: ↑Wednesday 01 April 2020 9:20
ressof wrote: ↑Wednesday 01 April 2020 8:45
I have completely removed my config on google and started over but with the same problem.
I have Swedish as language. But this have been working before.
Is it same on all switches or just colorswitch?
It seems that it is only on colorswitch that a Domoticz plugin called ShellyMQTT created.
It seems that the plugin creates colorswitch white instead of ight/switch dimmer.
I have a bulb with colorswitch rgbw that is working.
Re: Domoticz-Google-Assistant (dzga)
Posted: Wednesday 01 April 2020 10:18
by DewGew
ressof wrote: ↑Wednesday 01 April 2020 9:37
DewGew wrote: ↑Wednesday 01 April 2020 9:20
ressof wrote: ↑Wednesday 01 April 2020 8:45
I have completely removed my config on google and started over but with the same problem.
I have Swedish as language. But this have been working before.
Is it same on all switches or just colorswitch?
It seems that it is only on colorswitch that a Domoticz plugin called ShellyMQTT created.
It seems that the plugin creates colorswitch white instead of ight/switch dimmer.
I have a bulb with colorswitch rgbw that is working.
Paste the json output here for that device e.g
http://your.domoticz.ip:8080/json.htm?t ... =DEVICEIDX
Re: Domoticz-Google-Assistant (dzga)
Posted: Wednesday 01 April 2020 10:21
by ressof
DewGew wrote: ↑Wednesday 01 April 2020 10:18
ressof wrote: ↑Wednesday 01 April 2020 9:37
DewGew wrote: ↑Wednesday 01 April 2020 9:20
Is it same on all switches or just colorswitch?
It seems that it is only on colorswitch that a Domoticz plugin called ShellyMQTT created.
It seems that the plugin creates colorswitch white instead of ight/switch dimmer.
I have a bulb with colorswitch rgbw that is working.
Paste the json output here for that device e.g
http://your.domoticz.ip:8080/json.htm?t ... =DEVICEIDX
Code: Select all
{
"ActTime" : 1585729270,
"AstrTwilightEnd" : "22:22",
"AstrTwilightStart" : "04:13",
"CivTwilightEnd" : "20:35",
"CivTwilightStart" : "05:59",
"DayLength" : "13:15",
"NautTwilightEnd" : "21:25",
"NautTwilightStart" : "05:09",
"ServerTime" : "2020-04-01 10:21:10",
"SunAtSouth" : "13:17",
"Sunrise" : "06:40",
"Sunset" : "19:55",
"app_version" : "2020.1 (build 11853)",
"result" :
[
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"Color" : "",
"CustomImage" : 0,
"Data" : "Off",
"Description" : "",
"DimmerType" : "abs",
"Favorite" : 0,
"HardwareID" : 11,
"HardwareName" : "ShellyMQTT",
"HardwareType" : "Shelly MQTT",
"HardwareTypeVal" : 94,
"HaveDimmer" : true,
"HaveGroupCmd" : false,
"HaveTimeout" : false,
"ID" : "shellydimmer-F35FDD-0-dimmer",
"Image" : "Light",
"IsSubDevice" : false,
"LastUpdate" : "2020-04-01 10:19:38",
"Level" : 98,
"LevelInt" : 98,
"MaxDimLevel" : 100,
"Name" : "K\u00f6k Tak",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" :
[
0
],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"Status" : "Off",
"StrParam1" : "",
"StrParam2" : "",
"SubType" : "White",
"SwitchType" : "Dimmer",
"SwitchTypeVal" : 7,
"Timers" : "false",
"Type" : "Color Switch",
"TypeImg" : "dimmer",
"Unit" : 1,
"Used" : 1,
"UsedByCamera" : false,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "427"
}
],
"status" : "OK",
"title" : "Devices"
}
Re: Domoticz-Google-Assistant (dzga)
Posted: Wednesday 01 April 2020 11:13
by DewGew
ressof wrote: ↑Wednesday 01 April 2020 10:21
DewGew wrote: ↑Wednesday 01 April 2020 10:18
ressof wrote: ↑Wednesday 01 April 2020 9:37
It seems that it is only on colorswitch that a Domoticz plugin called ShellyMQTT created.
It seems that the plugin creates colorswitch white instead of ight/switch dimmer.
I have a bulb with colorswitch rgbw that is working.
Paste the json output here for that device e.g
http://your.domoticz.ip:8080/json.htm?t ... =DEVICEIDX
- Spoiler: show
-
Code: Select all
{
"ActTime" : 1585729270,
"AstrTwilightEnd" : "22:22",
"AstrTwilightStart" : "04:13",
"CivTwilightEnd" : "20:35",
"CivTwilightStart" : "05:59",
"DayLength" : "13:15",
"NautTwilightEnd" : "21:25",
"NautTwilightStart" : "05:09",
"ServerTime" : "2020-04-01 10:21:10",
"SunAtSouth" : "13:17",
"Sunrise" : "06:40",
"Sunset" : "19:55",
"app_version" : "2020.1 (build 11853)",
"result" :
[
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"Color" : "",
"CustomImage" : 0,
"Data" : "Off",
"Description" : "",
"DimmerType" : "abs",
"Favorite" : 0,
"HardwareID" : 11,
"HardwareName" : "ShellyMQTT",
"HardwareType" : "Shelly MQTT",
"HardwareTypeVal" : 94,
"HaveDimmer" : true,
"HaveGroupCmd" : false,
"HaveTimeout" : false,
"ID" : "shellydimmer-F35FDD-0-dimmer",
"Image" : "Light",
"IsSubDevice" : false,
"LastUpdate" : "2020-04-01 10:19:38",
"Level" : 98,
"LevelInt" : 98,
"MaxDimLevel" : 100,
"Name" : "K\u00f6k Tak",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" :
[
0
],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"Status" : "Off",
"StrParam1" : "",
"StrParam2" : "",
"SubType" : "White",
"SwitchType" : "Dimmer",
"SwitchTypeVal" : 7,
"Timers" : "false",
"Type" : "Color Switch",
"TypeImg" : "dimmer",
"Unit" : 1,
"Used" : 1,
"UsedByCamera" : false,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "427"
}
],
"status" : "OK",
"title" : "Devices"
}
Try latest beta V1.7.4
Re: Domoticz-Google-Assistant (dzga)
Posted: Wednesday 01 April 2020 12:42
by ressof
DewGew wrote: ↑Wednesday 01 April 2020 11:13
ressof wrote: ↑Wednesday 01 April 2020 10:21
- Spoiler: show
-
Code: Select all
{
"ActTime" : 1585729270,
"AstrTwilightEnd" : "22:22",
"AstrTwilightStart" : "04:13",
"CivTwilightEnd" : "20:35",
"CivTwilightStart" : "05:59",
"DayLength" : "13:15",
"NautTwilightEnd" : "21:25",
"NautTwilightStart" : "05:09",
"ServerTime" : "2020-04-01 10:21:10",
"SunAtSouth" : "13:17",
"Sunrise" : "06:40",
"Sunset" : "19:55",
"app_version" : "2020.1 (build 11853)",
"result" :
[
{
"AddjMulti" : 1.0,
"AddjMulti2" : 1.0,
"AddjValue" : 0.0,
"AddjValue2" : 0.0,
"BatteryLevel" : 255,
"Color" : "",
"CustomImage" : 0,
"Data" : "Off",
"Description" : "",
"DimmerType" : "abs",
"Favorite" : 0,
"HardwareID" : 11,
"HardwareName" : "ShellyMQTT",
"HardwareType" : "Shelly MQTT",
"HardwareTypeVal" : 94,
"HaveDimmer" : true,
"HaveGroupCmd" : false,
"HaveTimeout" : false,
"ID" : "shellydimmer-F35FDD-0-dimmer",
"Image" : "Light",
"IsSubDevice" : false,
"LastUpdate" : "2020-04-01 10:19:38",
"Level" : 98,
"LevelInt" : 98,
"MaxDimLevel" : 100,
"Name" : "K\u00f6k Tak",
"Notifications" : "false",
"PlanID" : "0",
"PlanIDs" :
[
0
],
"Protected" : false,
"ShowNotifications" : true,
"SignalLevel" : "-",
"Status" : "Off",
"StrParam1" : "",
"StrParam2" : "",
"SubType" : "White",
"SwitchType" : "Dimmer",
"SwitchTypeVal" : 7,
"Timers" : "false",
"Type" : "Color Switch",
"TypeImg" : "dimmer",
"Unit" : 1,
"Used" : 1,
"UsedByCamera" : false,
"XOffset" : "0",
"YOffset" : "0",
"idx" : "427"
}
],
"status" : "OK",
"title" : "Devices"
}
Try latest beta V1.7.4
Now its working.
Thank you.
Re: Domoticz-Google-Assistant (dzga)
Posted: Saturday 04 April 2020 11:51
by Justintime
DewGew wrote:Justintime wrote: ↑Tuesday 31 March 2020 21:11
Still i get the message "there is an unknown fault" (in dutch) I know this is a language thing. Is this on the roadmap to solve?
Otherwise i know what to do in Domiticz to quiet this.
I dont get that message. When do you get it?
When I give a command "zet Eettafellamp aan" (turn on dining light)
Google is turning on the light. She gives confirmation but than she says there is an unknown error / fault.
I have solved this to put this text in domoticz switch.
<voicecontrol>
nicknames = Eettafellamp
report_state = False
</voicecontrol>
But i have to do with every switch. Except curtains.
Another question. When I say synchronize devices. Domoticz google home is calling it "my test app" where can is change the name?
Re: Domoticz-Google-Assistant (dzga)
Posted: Saturday 04 April 2020 19:26
by EdwinK
One day I will understand all this. I promise.
For domain name, can I use something like noip.com or should it be more as
www.mydomain.com?
Re: Domoticz-Google-Assistant (dzga)
Posted: Monday 06 April 2020 7:35
by DewGew
EdwinK wrote: ↑Saturday 04 April 2020 19:26
One day I will understand all this. I promise.
For domain name, can I use something like noip.com or should it be more as
www.mydomain.com?
You can use noip.com or similar with reverse proxy