This project allow you to control your Loxone Server from your Google Home.
To use this plugin, you have to create your own SmartHome project in google : https://developers.google.com/assistant/smarthome/develop/create
We suggest to use the free oauth 2.0 server : OAuth0
- Create an account or login
- Create a new application (Eg : Google Home)
- In Allowed Callback URLs section, add https://oauth-redirect.googleusercontent.com/r/YOUR_GOOGLE_PROJECTNAME
### Create an Actions on Google developer project
- Use your Oauth0 App ClientId et ClientSecret, created before, in the Account Linking Section
- In the Fulfillment section, use the google-home-loxone url (Eg : http://YOUR_IP:3000/smarthome). It must be accessible from the cloud.
The Report State feature allows a cloud integration to proactively provide the
current state of devices to the Home Graph without a QUERY
request. This is
done securely through JWT (JSON web tokens).
- Navigate to the Google Cloud Console API Manager for your project id.
- Enable the HomeGraph API. This will be used to request a new sync and to report the state back to the HomeGraph.
- Click Credentials
- Click 'Create credentials'
- Click 'Service Account'
- Create a new service account by folling steps (without specific role)
- Edit the service account and add a new JSON key
- Download the key and save it in your home directory ~/.google-home-loxone/jwt.json
Two options are available. Use the docker image (recommanded)
docker run -p 3000:3000 -v ./jwt.json:/root/.google-home-loxone/jwt.json -v ./config.json:/root/.google-home-loxone/config.json -e GHL_VERBOSE=true --name google-home-loxone -d rtrompier/google-home-loxone:latest
or install the plugin through npm or download the files from here.
$ sudo npm install -g google-home-loxone --unsafe-perm
Or update to latest version when already installed:
$ sudo npm update -g google-home-loxone --unsafe-perm
Create a config.json file (usually in ~/.google-home-loxone) to allow the plugin to connect to your loxone server
{
"loxone": {
"protocol": "http",
"url": "LOXONE_IP", // Your loxone IP or hostname
"user": "LOXONE_USER, // Your loxone username
"password": "LOXONE_PASSWORD" // Your loxone password
},
"oAuthUrl": "https://rtrompier.eu.auth0.com", // Your oAuthUrl provided by Oauth0
"authorizedEmails": [
"[email protected]" // The emails of the users will be allowed to call your server
],
"agentUserId": "loxone-12345", // The name of your app
"log": true // Activate verbose mode
}
$ google-home-loxone
To see all options you can start with help arguments:
$ google-home-loxone --help
You can pass the following params :
- port The port used by the google-home-loxone server
- jwt The path of your jwt.json file, created in Google Cloud Console
- config The path of your config.json file, to configure the application
If you don't want pay for Loxone Meteo service, you can connect your Loxone Server to the weather information from Netatmo Weather Station near of you. You can find all station here : https://weathermap.netatmo.com/
You just have to start this server, and plug your Loxone Server on it.
- Follow the instruction to configure it, and start.
- You can retrieve weather informations by calling :
http://YOUR_SERVER:3000/weather
- You can now configure your loxone server, to parse result and get weather informations for free.