Page 5 of 15

Re: Domoticz to Google Assistant integration

Posted: Tuesday 03 September 2019 9:31
by DewGew
EscApe wrote: Monday 02 September 2019 19:39 I have the same problem with my Nefit Easy thermostat. Google assistant says that setting the temperature is not supported. I verified that the execute routine in class TemperatureSettingTrait (trait.py) does not run at all by putting in print statement in it and running your program from the command line.
After some experimenting I still don't understand how the capabilities of devices are determined. I can manually change the temperature from Domoticz and the Domoticz (json) api.

result of http://your.ipadress:8080/json.htm?type=devices&rid=IDX :

Code: Select all

{
   "ActTime" : 1567445303,
   "AstrTwilightEnd" : "22:27",
   "AstrTwilightStart" : "04:38",
   "CivTwilightEnd" : "20:55",
   "CivTwilightStart" : "06:10",
   "DayLength" : "13:34",
   "NautTwilightEnd" : "21:39",
   "NautTwilightStart" : "05:26",
   "ServerTime" : "2019-09-02 19:28:23",
   "SunAtSouth" : "13:32",
   "Sunrise" : "06:45",
   "Sunset" : "20:20",
   "app_version" : "4.11231",
   "result" : [
      {
         "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "BatteryLevel" : 255,
         "CustomImage" : 0,
         "Data" : "18.5",
         "Description" : "",
         "Favorite" : 1,
         "HardwareID" : 4,
         "HardwareName" : "Nefit EASY",
         "HardwareType" : "Nefit Easy HTTP server over LAN interface",
         "HardwareTypeVal" : 68,
         "HaveTimeout" : false,
         "ID" : "0010101",
         "LastUpdate" : "2019-09-02 19:28:18",
         "Name" : "CV.Setpoint",
         "Notifications" : "false",
         "PlanID" : "11",
         "PlanIDs" : [ 11 ],
         "Protected" : false,
         "SetPoint" : "18.5",
         "ShowNotifications" : true,
         "SignalLevel" : "-",
         "SubType" : "SetPoint",
         "Timers" : "false",
         "Type" : "Thermostat",
         "TypeImg" : "override_mini",
         "Unit" : 1,
         "Used" : 1,
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "29"
      }
   ],
   "status" : "OK",
   "title" : "Devices"
}
It should work..
I made an issue https://github.com/DewGew/Domoticz-Goog ... /issues/32
I can't find whats wrong hopefully someone can help.

Re: Domoticz to Google Assistant integration

Posted: Tuesday 03 September 2019 17:51
by DewGew
DewGew wrote: Tuesday 03 September 2019 9:31
EscApe wrote: Monday 02 September 2019 19:39 I have the same problem with my Nefit Easy thermostat. Google assistant says that setting the temperature is not supported. I verified that the execute routine in class TemperatureSettingTrait (trait.py) does not run at all by putting in print statement in it and running your program from the command line.
After some experimenting I still don't understand how the capabilities of devices are determined. I can manually change the temperature from Domoticz and the Domoticz (json) api.

result of http://your.ipadress:8080/json.htm?type=devices&rid=IDX :

Code: Select all

{
   "ActTime" : 1567445303,
   "AstrTwilightEnd" : "22:27",
   "AstrTwilightStart" : "04:38",
   "CivTwilightEnd" : "20:55",
   "CivTwilightStart" : "06:10",
   "DayLength" : "13:34",
   "NautTwilightEnd" : "21:39",
   "NautTwilightStart" : "05:26",
   "ServerTime" : "2019-09-02 19:28:23",
   "SunAtSouth" : "13:32",
   "Sunrise" : "06:45",
   "Sunset" : "20:20",
   "app_version" : "4.11231",
   "result" : [
      {
         "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "BatteryLevel" : 255,
         "CustomImage" : 0,
         "Data" : "18.5",
         "Description" : "",
         "Favorite" : 1,
         "HardwareID" : 4,
         "HardwareName" : "Nefit EASY",
         "HardwareType" : "Nefit Easy HTTP server over LAN interface",
         "HardwareTypeVal" : 68,
         "HaveTimeout" : false,
         "ID" : "0010101",
         "LastUpdate" : "2019-09-02 19:28:18",
         "Name" : "CV.Setpoint",
         "Notifications" : "false",
         "PlanID" : "11",
         "PlanIDs" : [ 11 ],
         "Protected" : false,
         "SetPoint" : "18.5",
         "ShowNotifications" : true,
         "SignalLevel" : "-",
         "SubType" : "SetPoint",
         "Timers" : "false",
         "Type" : "Thermostat",
         "TypeImg" : "override_mini",
         "Unit" : 1,
         "Used" : 1,
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "29"
      }
   ],
   "status" : "OK",
   "title" : "Devices"
}
It should work..
I made an issue https://github.com/DewGew/Domoticz-Goog ... /issues/32
I can't find whats wrong hopefully someone can help.
Thermostat is working now in my end. Others have issues? Try Re-link your integration to the Google Assistant or restart your test in actions on google / deploy / account linking click on 'Test'

Re: Domoticz to Google Assistant integration

Posted: Tuesday 03 September 2019 22:39
by freakyman88
DewGew wrote: Tuesday 03 September 2019 17:51
DewGew wrote: Tuesday 03 September 2019 9:31
EscApe wrote: Monday 02 September 2019 19:39 I have the same problem with my Nefit Easy thermostat. Google assistant says that setting the temperature is not supported. I verified that the execute routine in class TemperatureSettingTrait (trait.py) does not run at all by putting in print statement in it and running your program from the command line.
After some experimenting I still don't understand how the capabilities of devices are determined. I can manually change the temperature from Domoticz and the Domoticz (json) api.

result of http://your.ipadress:8080/json.htm?type=devices&rid=IDX :

Code: Select all

{
   "ActTime" : 1567445303,
   "AstrTwilightEnd" : "22:27",
   "AstrTwilightStart" : "04:38",
   "CivTwilightEnd" : "20:55",
   "CivTwilightStart" : "06:10",
   "DayLength" : "13:34",
   "NautTwilightEnd" : "21:39",
   "NautTwilightStart" : "05:26",
   "ServerTime" : "2019-09-02 19:28:23",
   "SunAtSouth" : "13:32",
   "Sunrise" : "06:45",
   "Sunset" : "20:20",
   "app_version" : "4.11231",
   "result" : [
      {
         "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "BatteryLevel" : 255,
         "CustomImage" : 0,
         "Data" : "18.5",
         "Description" : "",
         "Favorite" : 1,
         "HardwareID" : 4,
         "HardwareName" : "Nefit EASY",
         "HardwareType" : "Nefit Easy HTTP server over LAN interface",
         "HardwareTypeVal" : 68,
         "HaveTimeout" : false,
         "ID" : "0010101",
         "LastUpdate" : "2019-09-02 19:28:18",
         "Name" : "CV.Setpoint",
         "Notifications" : "false",
         "PlanID" : "11",
         "PlanIDs" : [ 11 ],
         "Protected" : false,
         "SetPoint" : "18.5",
         "ShowNotifications" : true,
         "SignalLevel" : "-",
         "SubType" : "SetPoint",
         "Timers" : "false",
         "Type" : "Thermostat",
         "TypeImg" : "override_mini",
         "Unit" : 1,
         "Used" : 1,
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "29"
      }
   ],
   "status" : "OK",
   "title" : "Devices"
}
It should work..
I made an issue https://github.com/DewGew/Domoticz-Goog ... /issues/32
I can't find whats wrong hopefully someone can help.
Thermostat is working now in my end. Others have issues? Try Re-link your integration to the Google Assistant or restart your test in actions on google / deploy / account linking click on 'Test'
I tried both re-linking the integration and clicking on test in the account linking. Issues stays the same.

For what it is worth.. Here are my thermostat settings:

Code: Select all

{
   "ActTime" : 1567542938,
   "AstrTwilightEnd" : "22:29",
   "AstrTwilightStart" : "04:37",
   "CivTwilightEnd" : "20:55",
   "CivTwilightStart" : "06:11",
   "DayLength" : "13:33",
   "NautTwilightEnd" : "21:40",
   "NautTwilightStart" : "05:27",
   "ServerTime" : "2019-09-03 22:35:38",
   "SunAtSouth" : "13:33",
   "Sunrise" : "06:47",
   "Sunset" : "20:20",
   "app_version" : "4.11214",
   "result" : [
      {
         "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "BatteryLevel" : 255,
         "CustomImage" : 0,
         "Data" : "20.5",
         "Description" : "",
         "Favorite" : 1,
         "HardwareID" : 22,
         "HardwareName" : "Toon thermostaat",
         "HardwareType" : "Dummy (Does nothing, use for virtual switches only)",
         "HardwareTypeVal" : 15,
         "HaveTimeout" : false,
         "ID" : "00140C2",
         "LastUpdate" : "2019-09-03 22:30:29",
         "Name" : "Toon_Thermostaat",
         "Notifications" : "false",
         "PlanID" : "8",
         "PlanIDs" : [ 8 ],
         "Protected" : false,
         "SetPoint" : "20.5",
         "ShowNotifications" : true,
         "SignalLevel" : "-",
         "SubType" : "SetPoint",
         "Timers" : "false",
         "Type" : "Thermostat",
         "TypeImg" : "override_mini",
         "Unit" : 1,
         "Used" : 1,
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "114"
      }
   ],
   "status" : "OK",
   "title" : "Devices"
}

Re: Domoticz to Google Assistant integration

Posted: Wednesday 04 September 2019 17:09
by DewGew
freakyman88 wrote: Tuesday 03 September 2019 22:39
DewGew wrote: Tuesday 03 September 2019 17:51
DewGew wrote: Tuesday 03 September 2019 9:31
It should work..
I made an issue https://github.com/DewGew/Domoticz-Goog ... /issues/32
I can't find whats wrong hopefully someone can help.
Thermostat is working now in my end. Others have issues? Try Re-link your integration to the Google Assistant or restart your test in actions on google / deploy / account linking click on 'Test'
I tried both re-linking the integration and clicking on test in the account linking. Issues stays the same.

For what it is worth.. Here are my thermostat settings:

Code: Select all

{
   "ActTime" : 1567542938,
   "AstrTwilightEnd" : "22:29",
   "AstrTwilightStart" : "04:37",
   "CivTwilightEnd" : "20:55",
   "CivTwilightStart" : "06:11",
   "DayLength" : "13:33",
   "NautTwilightEnd" : "21:40",
   "NautTwilightStart" : "05:27",
   "ServerTime" : "2019-09-03 22:35:38",
   "SunAtSouth" : "13:33",
   "Sunrise" : "06:47",
   "Sunset" : "20:20",
   "app_version" : "4.11214",
   "result" : [
      {
         "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "BatteryLevel" : 255,
         "CustomImage" : 0,
         "Data" : "20.5",
         "Description" : "",
         "Favorite" : 1,
         "HardwareID" : 22,
         "HardwareName" : "Toon thermostaat",
         "HardwareType" : "Dummy (Does nothing, use for virtual switches only)",
         "HardwareTypeVal" : 15,
         "HaveTimeout" : false,
         "ID" : "00140C2",
         "LastUpdate" : "2019-09-03 22:30:29",
         "Name" : "Toon_Thermostaat",
         "Notifications" : "false",
         "PlanID" : "8",
         "PlanIDs" : [ 8 ],
         "Protected" : false,
         "SetPoint" : "20.5",
         "ShowNotifications" : true,
         "SignalLevel" : "-",
         "SubType" : "SetPoint",
         "Timers" : "false",
         "Type" : "Thermostat",
         "TypeImg" : "override_mini",
         "Unit" : 1,
         "Used" : 1,
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "114"
      }
   ],
   "status" : "OK",
   "title" : "Devices"
}
I think I found the issue. Make a git pull and try latest.

Re: Domoticz to Google Assistant integration

Posted: Wednesday 04 September 2019 17:12
by DewGew
New functions thanks to github user d-EScape

Simply put the device configuration in the Domoticz description for the device, in a section between 'voicecontrol' tags like:

Code: Select all

<voicecontrol>
nicknames = Kitchen Blind One, Left Blind, Blue Blind
room = Kitchen
ack = True
</voicecontrol>
Other parts of the description are ignored. So you can still leave other useful descriptions.
Every variable should be on a separate line.
If there is no such configuration in the Domoticz device it will still try the config.py to be backward compatible with existing configurations.

Re: Domoticz to Google Assistant integration

Posted: Wednesday 04 September 2019 17:48
by EscApe
I can confirm the thermostat issue has been fixed. Thanks DewGew!

Re: Domoticz to Google Assistant integration

Posted: Wednesday 04 September 2019 21:50
by freakyman88
DewGew wrote: Wednesday 04 September 2019 17:09
freakyman88 wrote: Tuesday 03 September 2019 22:39
DewGew wrote: Tuesday 03 September 2019 17:51
Thermostat is working now in my end. Others have issues? Try Re-link your integration to the Google Assistant or restart your test in actions on google / deploy / account linking click on 'Test'
I tried both re-linking the integration and clicking on test in the account linking. Issues stays the same.

For what it is worth.. Here are my thermostat settings:

Code: Select all

{
   "ActTime" : 1567542938,
   "AstrTwilightEnd" : "22:29",
   "AstrTwilightStart" : "04:37",
   "CivTwilightEnd" : "20:55",
   "CivTwilightStart" : "06:11",
   "DayLength" : "13:33",
   "NautTwilightEnd" : "21:40",
   "NautTwilightStart" : "05:27",
   "ServerTime" : "2019-09-03 22:35:38",
   "SunAtSouth" : "13:33",
   "Sunrise" : "06:47",
   "Sunset" : "20:20",
   "app_version" : "4.11214",
   "result" : [
      {
         "AddjMulti" : 1.0,
         "AddjMulti2" : 1.0,
         "AddjValue" : 0.0,
         "AddjValue2" : 0.0,
         "BatteryLevel" : 255,
         "CustomImage" : 0,
         "Data" : "20.5",
         "Description" : "",
         "Favorite" : 1,
         "HardwareID" : 22,
         "HardwareName" : "Toon thermostaat",
         "HardwareType" : "Dummy (Does nothing, use for virtual switches only)",
         "HardwareTypeVal" : 15,
         "HaveTimeout" : false,
         "ID" : "00140C2",
         "LastUpdate" : "2019-09-03 22:30:29",
         "Name" : "Toon_Thermostaat",
         "Notifications" : "false",
         "PlanID" : "8",
         "PlanIDs" : [ 8 ],
         "Protected" : false,
         "SetPoint" : "20.5",
         "ShowNotifications" : true,
         "SignalLevel" : "-",
         "SubType" : "SetPoint",
         "Timers" : "false",
         "Type" : "Thermostat",
         "TypeImg" : "override_mini",
         "Unit" : 1,
         "Used" : 1,
         "XOffset" : "0",
         "YOffset" : "0",
         "idx" : "114"
      }
   ],
   "status" : "OK",
   "title" : "Devices"
}
I think I found the issue. Make a git pull and try latest.
Works like a charm. You sir, are awesome. :)

Re: Domoticz to Google Assistant integration

Posted: Monday 09 September 2019 10:38
by DewGew
EscApe wrote: Monday 02 September 2019 20:01 B.t.w. I also tried to add a door contact domain but could not get it to work. In your master branch it shows as a light, but it is alway on. It will update correctly after replacing line 125 of traits.py with:

Code: Select all

response['on'] = self.state.state not in ['Off', 'Closed']

I wanted it to show as a door, but was unsuccessful. Added all the bits in smarthome.py, const.py and trait.py (but reverted the code, so I cannot share it :? ) The trait it should use was 'OpenCloseTrait', but it only ran the sync_attribute. Never the query_attributes. I tested this (again) with a print statement in the code and running from command line. The device would show up in the google home app as a unusable (unknown?) thing with a cogwheel. After revering the code I tried some other (PIR) sensor and it will show with same cogwheel icon. Seems not every type of device is working, even in the current master branch...
IMG_6873.jpeg

I will do some more digging around until I really understand how this code actually works, but if you can give some pointers that will be great.
I added doorsensor. But the icon is still same. But now you can check status correct e.g You: "Is my back door open?" - Google Assistant: "Yes, Backdoor is open".

Re: Domoticz to Google Assistant integration

Posted: Wednesday 11 September 2019 17:09
by EscApe
@DewGew,

Good stuff!
I'm getting the same weird icon as mentioned in my post from 02 Sep 2019, 20:01. Clicking it in the Google Home app does not show the status either, but it actually works with google assistant :D I'm pretty sure I made the same addition back then, but I stopped after seeing this icon. I never tried to use google assistant to query it :oops:

Great that it does works as a door sensor. If anyone has any insights on how to get the correct icon and make it more useful in the google app, then please share!

Re: Domoticz to Google Assistant integration

Posted: Wednesday 11 September 2019 18:27
by DewGew
Google add the icons. What icon you get depends what device type you send to Google app. For door its .action.devices.types.DOOR

Re: Domoticz to Google Assistant integration

Posted: Wednesday 11 September 2019 20:34
by EscApe
Does it show something resembling a door in your setup? On my google home app it shows up like this:
62B0420D-FE67-4016-8830-10C42030304D.jpeg
62B0420D-FE67-4016-8830-10C42030304D.jpeg (15.96 KiB) Viewed 1280 times

Re: Domoticz to Google Assistant integration

Posted: Thursday 12 September 2019 7:33
by DewGew
EscApe wrote: Wednesday 11 September 2019 20:34 Does it show something resembling a door in your setup? On my google home app it shows up like this: 62B0420D-FE67-4016-8830-10C42030304D.jpeg
It is correct. Google Home App don't have any Door icon yet.

Re: Domoticz to Google Assistant integration

Posted: Saturday 14 September 2019 11:29
by frankdep
Thanks a lot for providing this great possibility, it is working!
Had some troubles starting up the reverse proxy (nginx).
Had to define proxy_pass locations /smarthome /oauth /login /token /sync (without following "/") to make it work.
I'm using Domoticz as a front end to a PLC automation system and have about 100 virtual devices.
The automatic conversion to a domain type is already working quit good but perhaps adding a domain type "override" in the <voicecontrol> settings might be usefull to cover wrong/new conversions when using customs icons.
Also having a command line textbox (Tasker / Autovoice) but this device type is not supported by google.

Re: Domoticz to Google Assistant integration

Posted: Monday 16 September 2019 14:16
by DewGew
frankdep wrote: Saturday 14 September 2019 11:29 Thanks a lot for providing this great possibility, it is working!
Had some troubles starting up the reverse proxy (nginx).
Had to define proxy_pass locations /smarthome /oauth /login /token /sync (without following "/") to make it work.
I'm using Domoticz as a front end to a PLC automation system and have about 100 virtual devices.
The automatic conversion to a domain type is already working quit good but perhaps adding a domain type "override" in the <voicecontrol> settings might be usefull to cover wrong/new conversions when using customs icons.
Also having a command line textbox (Tasker / Autovoice) but this device type is not supported by google.
How do you mean "override". Simpleist way to "override" is to change device type in domtoicz or change icon and add the device icon image name to one the IMAGE.XXXX in config.py.

Re: Domoticz to Google Assistant integration

Posted: Wednesday 18 September 2019 16:15
by gomsoo
On the top menu click Develop, then on the left navigation menu click on Actions. Enter the URL for fulfillment, e.g. https://[YOUR REVERSE PROXY URL]/smarthome, click Done.

Which Proxy is mean?

Re: Domoticz to Google Assistant integration

Posted: Thursday 19 September 2019 10:38
by DewGew
gomsoo wrote: Wednesday 18 September 2019 16:15 On the top menu click Develop, then on the left navigation menu click on Actions. Enter the URL for fulfillment, e.g. https://[YOUR REVERSE PROXY URL]/smarthome, click Done.

Which Proxy is mean?
Your adress (via reverse proxy server) you run this server.

Re: Domoticz to Google Assistant integration

Posted: Thursday 19 September 2019 12:28
by GreenSmart01
Hi guys,

when im trying to sync 'ok google sync my devices' there is an error with my project.

insertId: "17auvixg1oisyvp"
logName: "projects/<projectname>/logs/actions.googleapis.com%2Factions"
receiveTimestamp: "2019-09-16T19:47:29.041189046Z"
resource: {…}
severity: "ERROR"
textPayload: "requestId 18128897936786155607: Found json master errorCode unknownError"
timestamp: "2019-09-16T19:47:29.034344095Z"
}

Re: Domoticz to Google Assistant integration

Posted: Thursday 19 September 2019 14:00
by DewGew
GreenSmart01 wrote: Thursday 19 September 2019 12:28 Hi guys,

when im trying to sync 'ok google sync my devices' there is an error with my project.

insertId: "17auvixg1oisyvp"
logName: "projects/<projectname>/logs/actions.googleapis.com%2Factions"
receiveTimestamp: "2019-09-16T19:47:29.041189046Z"
resource: {…}
severity: "ERROR"
textPayload: "requestId 18128897936786155607: Found json master errorCode unknownError"
timestamp: "2019-09-16T19:47:29.034344095Z"
}
Any error in python console when you run the script?

Re: Domoticz to Google Assistant integration

Posted: Thursday 19 September 2019 14:13
by GreenSmart01
how can i do that?

Re: Domoticz to Google Assistant integration

Posted: Friday 20 September 2019 12:18
by DewGew
When you start Python script with ’python3 Domoticz-Google-Assistant’