Domoticz to Google Assistant integration
Posted: Wednesday 06 March 2019 12:12
Domoticz to Google Assistan integration
Based on the home assistant implementation:
https://github.com/home-assistant/home- ... _assistant
and https://github.com/actions-on-google/smart-home-nodejs
Required:
- Public IP
- python >= 3.5
- reverse proxy for establishing secure connection (aog itself provides currently only unsecure one - http only)
Aog delivers:
- the oauth authorization and smarthome endpoint for the google assistant
- OnOff, Brightness, Scene and OpenClose traits, rest to be done...
Please feel free to modify it, extend and improve
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
1. Change your Account linking setting in Actions on Google console https://console.actions.google.com/, look for the Advanced Options in the bottom left of the sidebar.
Change Linking type to OAuth and Authorization Code.
In the Client information section:
Set Client ID - SMARTHOMEPROVIDERGOOGLECLIENTID
Set Client Secret - SMARTHOMEPROVIDEGOOGLECLIENTSECRET
Change Authorization URL to https://[YOUR REVERSE PROXY URL]/oauth (replace with your actual URL).
Change Token URL to https://[YOUR REVERSE PROXY URL]/token (replace with your actual URL).
In the Configure your client section:
Do NOT check Google to transmit clientID and secret via HTTP basic auth header.
Click ‘Save’ at the top right corner, then click ‘Test’ to generate a new draft version of the Test App.
https://[YOUR REVERSE PROXY URL]/sync - force devices sync
Based on the home assistant implementation:
https://github.com/home-assistant/home- ... _assistant
and https://github.com/actions-on-google/smart-home-nodejs
Required:
- Public IP
- python >= 3.5
- reverse proxy for establishing secure connection (aog itself provides currently only unsecure one - http only)
Aog delivers:
- the oauth authorization and smarthome endpoint for the google assistant
- OnOff, Brightness, Scene and OpenClose traits, rest to be done...
Please feel free to modify it, extend and improve
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
1. Change your Account linking setting in Actions on Google console https://console.actions.google.com/, look for the Advanced Options in the bottom left of the sidebar.
Change Linking type to OAuth and Authorization Code.
In the Client information section:
Set Client ID - SMARTHOMEPROVIDERGOOGLECLIENTID
Set Client Secret - SMARTHOMEPROVIDEGOOGLECLIENTSECRET
Change Authorization URL to https://[YOUR REVERSE PROXY URL]/oauth (replace with your actual URL).
Change Token URL to https://[YOUR REVERSE PROXY URL]/token (replace with your actual URL).
In the Configure your client section:
Do NOT check Google to transmit clientID and secret via HTTP basic auth header.
Click ‘Save’ at the top right corner, then click ‘Test’ to generate a new draft version of the Test App.
https://[YOUR REVERSE PROXY URL]/sync - force devices sync