Skip to content

Google Home Actions on Google Smart Home integration library

License

Notifications You must be signed in to change notification settings

pborges/gbridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gBridge_banner

G Bridge

GoDoc Go Report Card GitHub

-- 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

Philosopy

-- TODO: Explain how this libary is structured.. e.g duck-typing and interfaces usage--

Useful links

Instructions

(these may not be up to date, google changed their process recently)
  1. Create an action.json file
    {
      "actions": [{
        "name": "actions.devices",
        "deviceControl": {
        },
        "fulfillment": {
          "conversationName": "automation"
        }
      }],
      "conversations": {
        "automation" :
        {
          "name": "automation",
          "url": "https://<YOUR URL>/smarthome"
        }
      }
    }
  1. Create a project on https://console.actions.google.com/

  2. Click Use Actions SDK

  3. Use the gActions CLI to run the command given with the 'action.json' file as your Action Package.

  4. Click Okay.

  5. Click ADD under App information.

  6. Give your App some information like an invocation name, some description, and some policy and contact info.

  7. Click Save.

  8. Click Add under Account Linking.

  9. Select Authorization Code for Grant Type.

  10. Under Client Information, enter the client ID and secret from earlier.

  11. The Authorization URL is the hosted URL of your app with '/oauth' as the path, e.g. https://<YOUR URL>/oauth

  12. The Token URL is the hosted URL of your app with '/token' as the path, e.g. https://<YOUR URL>/token

  13. Click TEST DRAFT

  14. Open the Google Home App on your phone and navigate to the Home Control section

  15. Click the 3 dots and go to Manage Accounts

  16. Select your project from the Add New section

Example

Please see /examples/gbridge/ for examples on how to use this libary.

Notes

  • 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.

About

Google Home Actions on Google Smart Home integration library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages