-- work in progress --
Google smart home lets users control your connected devices through the Google Home app and the Google Assistant, which is available on more than 1 billion devices, like smart speakers, phones, cars, TVs, headphones, watches, and more. To connect your device with the Google Assistant, you need to build a smart home Action. Assistant handles how users trigger your Action (in multiple languages) and provides you with relevant metadata through Home Graph (such as a specific device based on user’s room); all you need to do is respond to the requests in your service.
This libary helps you to create a backend service for your Google Smart Home Action.
This libary is ported from actionssdk-smart-home-nodejs
-- TODO: Explain how this libary is structured.. e.g duck-typing and interfaces usage--
- https://developers.google.com/actions/smarthome/
- https://github.com/actions-on-google/actionssdk-smart-home-nodejs
- https://console.actions.google.com/
- Create an action.json file
{
"actions": [{
"name": "actions.devices",
"deviceControl": {
},
"fulfillment": {
"conversationName": "automation"
}
}],
"conversations": {
"automation" :
{
"name": "automation",
"url": "https://<YOUR URL>/smarthome"
}
}
}
-
Create a project on https://console.actions.google.com/
-
Click Use Actions SDK
-
Use the gActions CLI to run the command given with the 'action.json' file as your Action Package.
-
Click Okay.
-
Click ADD under App information.
-
Give your App some information like an invocation name, some description, and some policy and contact info.
-
Click Save.
-
Click Add under Account Linking.
-
Select Authorization Code for Grant Type.
-
Under Client Information, enter the client ID and secret from earlier.
-
The Authorization URL is the hosted URL of your app with '/oauth' as the path, e.g. https://<YOUR URL>/oauth
-
The Token URL is the hosted URL of your app with '/token' as the path, e.g. https://<YOUR URL>/token
-
Click TEST DRAFT
-
Open the Google Home App on your phone and navigate to the Home Control section
-
Click the 3 dots and go to Manage Accounts
-
Select your project from the Add New section
Please see /examples/gbridge/
for examples on how to use this libary.
-
If you push an update to actions.json, you might have to unlink your account in google home and re-link it for testing to work from your phone
-
Place this service behind caddy or some other reverse proxy that does LetsEncrypt SSL, or do your own SSL encryption. Google needs your service to be reachable via HTTPs and a valid SSL certificate.