To add Google Home support for your Nightscout site, here's what you need to do:
- Activate the
googlehome
plugin on your Nightscout site, so your site will respond correctly to Google's requests. - Create a custom DialogFlow agent that points at your site and defines certain questions you want to be able to ask.
- Your Nightscout site needs to be new enough that it supports the
googlehome
plugin. It needs to be version VERSION_NUMBER (VERSION_NAME) or later. See updating my version if you need a newer version. - Add
googlehome
to the list of plugins in yourENABLE
setting. (Environment variables are set in the configuration section for your monitor. Typically Azure, Heroku, etc.)
- Download the Google Home Nightscout agent template.
- Sign in to Google's Action Console
- Click on the "New Project" button.
- If prompted, agree to the Terms of Service.
- Give your project a name (e.g. "Nightscout") and then click "Create project".
- Click any of the "development experience" options (it really doesn't matter).
- Click on the "Develop" tab at the top of the sreen
- Click on "Invocation" in the left navigation pane.
- Set the display name (e.g. "Nightscout") and set your Google Assistant voice.
- Unfortunately, the name needs to be two words, and has to be unique across all of Google, even though you won't be publishing for everyone on Google to use. So you'll have to be creative in the name since "Night Scout" is already taken.
- Click "Save" in the upper right corner.
- Navigate to "Actions" in the left nagivation pane, then click on the "Add your first action" button.
- Make sure you're on "Cutom intent" and then click "Build" to open DialogFlow in a new tab.
- Sign in with the same Google account you used to sign in to the Actions Console.
- You'll have to go through the account setup steps if this is your first time using DialogFlow.
- Verify the name for your agent (e.g. "Nightscout") and click "CREATE".
- In the navigation pane on the left, click the gear icon next to your agent name.
- Click on the "Export and Import" tab in the main area of the page.
- Click the "IMPORT FROM ZIP" button.
- Select the template file downloaded in step 1.
- Type "IMPORT" where requested and then click the "IMPORT" button.
- After the import finishes, click the "DONE" button followed by the "SAVE" button.
- In the navigation pane on the left, click on "Fulfillment".
- Enable the toggle for "Webhook" and then fill in the URL field with your Nightscout URL:
https://YOUR-NIGHTSCOUT-SITE/api/v1/googlehome
- Scroll down to the bottom of the page and click the "SAVE" button.