Update README.md [add-on: google_assistant] (#1265)

* Update README.md

- Streamline setup instructions with sub-steps and annotations
- Remove duplicated instructions
- Fix some steps
- Add simple examples on how to use it
- Add a troubleshooting section

* Fix formatting

* Offload the documentation part to DOC.md
This commit is contained in:
Eric Matte
2020-05-06 04:51:53 -04:00
committed by GitHub
parent 9e08ede0f9
commit f8a1f4d361
2 changed files with 50 additions and 28 deletions

45
google_assistant/DOC.md Normal file
View File

@@ -0,0 +1,45 @@
You first need to enable access to the Google Assistant API.
To do so, do the following:
1. Go to the [Google Actions Console][google-actions-console] and create a new project.
1. After you created the project on the bottom of the page click on "**Device registration**". Keep this tab open for later use.
1. Enable the Google Assistant API on the new project through [this][google-assistant-api] link. Make sure you have the right project selected (shown in the middle of the screen in the top bar). If you can't select the right project, it may help to open the link in an incognito window.
1. Configure the [OAuth consent screen][google-oauth-concent]. Again, check that you have the right project.
1. Choose "**External**" as the User Type.
1. Fill in a project name and your e-mail.
1. Hit "**Save**" at the bottom of the page.
1. Go back to you device registration tab and click on "**REGISTER MODEL**". If you closed the tab, you can also open you project in the [Google Actions Console][google-actions-console], start the Quick setup, and in the left bar click "**Device registration**".
1. Give you project a name and think of a nice manufacturer. Select "**speaker**" for the device type. If you want to, edit your model id, and copy it for later use.
1. Click "**REGISTER MODEL**", and download the credentials.
1. Click "**Next**" and click "**SKIP**".
1. Upload your credentials as `google_assistant.json` to the "hassio/share" folder, for example by using the [Samba][samba-addon] add-on.
1. On the add-on Configuration tab:
1. In the "Config" section, fill-in you `project_id` and your `model_id` and hit "**Save**". Your project id can be found in the Google Actions console by clicking on the top right menu button and selecting "**Project settings**". This id may differ from the project name that you choose!
1. In the "Audio" section, select the input and output audio devices to use for the Assistant and hit "**Save**". On a Raspberry Pi 3, `ALSA device 0` is the built-in headset port and `ALSA device 1` is the HDMI port.
1. The final step is to authenticate your Google account with Google Assistant.
1. Start the add-on. Check the log and click refresh till it says: `ENGINE Bus STARTED`.
1. Now click "**Open Web UI**" and follow the authentication process.
1. Once you've signed in with Google and authorized the app, copy the code back in the web UI. You will get an empty response after you have send your token.
1. After that, you can close the web UI tab.
Google Assistant should now be running on your Raspberry Pi!
To test it, say "Ok Google", following by the command of your choice.
### Troubleshooting
#### Google Assistant is not working
Google needs to be able to send data back to your Google Assistant SDK Add-on by sending webhooks to `https://yourdomain:yourport/api/google_assistant`.
To do so, you need to make sure that your Home Assistant is accessible from the internet and that it's using `https` (SSL).
#### The assistant voice volume is too low
If the voice of the assistant is really low, you can ask it to increase the volume:
- "Ok Google, set volume to maximum."
- or "Ok Google, set volume to 85%."
[google-actions-console]: https://console.actions.google.com/
[google-assistant-api]: https://console.developers.google.com/apis/api/embeddedassistant.googleapis.com/overview
[google-oauth-concent]: https://console.developers.google.com/apis/credentials/consent
[samba-addon]: https://github.com/home-assistant/hassio-addons/tree/master/samba

View File

@@ -8,6 +8,8 @@ A virtual personal assistant developed by Google.
[Google Assistant][google-assistant] is an AI-powered voice assistant that runs on the Raspberry Pi and x86 platforms and interact via the [DialogFlow][dialogflow-integration] integration with Home-Assistant. You can also use [Google Actions][google-actions] to extend its functionality.
You can simply say "Ok Google" following by your command, and Google Assistant will answer your request.
## Integration your mobile or Google/Nest Home with Home Assistant
If you want to integrate your Google Home or mobile phone running Google Assistant, with Home Assistant, then you want the [Google Assistant integration][google-assistant-integration].
@@ -22,28 +24,7 @@ Follow these steps to get the add-on installed on your system:
## How to use
Fist, select the input and output audio devices to use for the Assistant in the "Audio" section of the add-on configuration.
To enable access to the Google Assistant API, do the following:
1. Go to the [Google Actions Console][oogle-actions-console] and create a new project.
1. After you created the project on the bottom of the page click "Device registration". Keep this tab open for later use.
1. Enable the Google Assistant API on the new project through [this][google-assistant-api] link. Make sure you have the right project selected (shown in the middle of the screen in the top bar). If you can't select the right project, it may help to open the link in an incognito window.
1. Configure the [OAuth consent screen][google-oauth-concent]. Also again check that you have the right project and don't forget to hit "Save" at the bottom of the page. You only have to fill in a project name and your e-mail.
1. You back to you device registration tab and click "Device registration". Or open you project in the [Google Actions Console][google-actions-console] start the Quick setup, and in the left bar click "Device registration".
1. Give you project a name, think of a nice manufacturer and for device type select "speaker".
1. Edit you "model id", if you want to and copy it for later use.
1. Download the credentials.
1. Click "Next" and click "Skip".
1. Upload your credentials as "google_assistant.json" to the "hassio/share" folder, for example by using the [Samba][samba-addon] add-on.
1. In the Add-on configuration field fill-in you "project id" and your "model-id" and hit "Save". Your project id can be found in the Google Actions console by clicking on the top right menu button and selecting "Project settings". This id may differ from the project name that you choose!
1. Below the "Config" window select the microphone and speaker that you want to use. On a Raspberry Pi 3, ALSA device 0 is the built-in headset port and ALSA device 1 is the HDMI port. Also don't forget to click "Save".
1. Start the add-on. Check the log and click refresh till it says: "ENGINE Bus STARTED".
1. Now click "Open Web UI" and follow the authentication process. You will get an empty response after you have send your token.
Now install and activate the [Samba][samba-addon] add-on so you can upload your credential file. Connect to the "share" Samba share and copy your credentials over. Name the file `google_assistant.json`.
The next step is to authenticate your Google account with Google Assistant. Start the add-on and click on the "OPEN WEB UI" button to start authentication.
[Click here for the full documentation](DOC.md)
## Configuration
@@ -62,14 +43,13 @@ The name of the client secrets file to you've downloaded from Google and placed
### Option: `project_id` (required)
Project ID of the project you've created at Google for this add-on.
The project id can be found in your "google_assistant.json" file or under project settings in the [Google Actions Console][google-actions-console].
The project id can be found in your `google_assistant.json` file, or under project settings in the [Google Actions Console][google-actions-console].
### Option: `model_id` (required)
The ID of the model you've registered at Google for this add-on.
The model id can also be found under the "Develop - Device registration tab" in the [Google Actions Console][google-actions-console].
The model id can also be found under the "Develop - Device registration" tab in the [Google Actions Console][google-actions-console].
## Support
@@ -92,7 +72,6 @@ In case you've found a bug, please [open an issue on our GitHub][issue].
[forum]: https://community.home-assistant.io
[google-actions]: https://actions.google.com/
[google-actions-console]: https://console.actions.google.com/
[google-assistant-api]: https://console.developers.google.com/apis/api/embeddedassistant.googleapis.com/overview
[google-assistant-integration]: https://www.home-assistant.io/integrations/google_assistant/
[google-assistant]: https://assistant.google.com/
[google-oauth-client]: https://console.developers.google.com/apis/credentials/oauthclient
@@ -101,5 +80,3 @@ In case you've found a bug, please [open an issue on our GitHub][issue].
[issue]: https://github.com/home-assistant/hassio-addons/issues
[reddit]: https://reddit.com/r/homeassistant
[repository]: https://github.com/hassio-addons/repository
[samba-addon]: https://github.com/home-assistant/hassio-addons/tree/master/samba
[google-oauth-concent]: https://console.developers.google.com/apis/credentials/consent