Update google_assistant.markdown (#11600)

This commit is contained in:
mannte 2020-01-03 11:13:02 +01:00 committed by Franck Nijhof
parent 650b674c01
commit 1993bd4f03

View File

@ -4,12 +4,6 @@ description: "Enhance your Hass.io installation with Google Assistant."
featured: true
---
<div class='note warning'>
These instructions are outdated - the add-on has been updated and these are no longer accurate or complete.
</div>
<div class='note'>
If you want to integrate your Google Home or mobile phone running Google Assistant, with Home Assistant, then you want the [Google Assistant component](/integrations/google_assistant/).
@ -23,36 +17,11 @@ To enable access to the Google Assistant API, do the following:
1. In the [Cloud Platform Console][project], go to the Projects page. Select an existing project or create a new project
1. Open the project. In the top of the page search for Google Assistant API or use [this link][API] and enable it.
1. Create an [OAuth Client ID][oauthclient], pick type "Other", click "Create" and download the JSON file by clicking the Download JSON button on the right side.
1. Upload your "google_assistant.json" file to the "hassio/share" folder, for example by using the [Samba] add-on.
1. In the config window, fill in your "project-id", which can be found in your "google_assistant.json" file or in on the [Cloud Platform Resource Manager][cloudConsole]. Also choose a "model_id".
1. Below the "Config" window select the microphone and speaker that you want to use. On a Raspberry Pi 3, card 0 - device 0 is the built-in headset port, card 0 - device 1 is the HDMI port.
Now install and activate the [Samba] 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`.
Now it's time to start Google Assistant for the first time. When the Google Assistant add-on starts, it will output your audio devices in the "Logs" card. You might have to hit "refresh" to get the latest logs:
```text
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Microphone [Yeti Stereo Microphone], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
```
You need to use this information to point the add-on at the right speakers and microphone. The information describes different cards and devices. On a Raspberry Pi 3, card 0 - device 0 is the built-in headset port, card 0 - device 1 is the HDMI port. In the example above, the USB microphone showed up as card 1 - device 0.
Find the microphone and speakers that you want to use and note down their device and card number. We will need that to configure the add-on options `mic` (microphone to use) and `speaker` (speaker to use). The format for these options is `<card #>,<device #>`. Change the configuration options and click save.
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.
You are now ready to start the add-on. The next step is to authenticate your Google account with Google Assistant. After starting the add-on and click on the "OPEN WEB UI" button to start authentication.
### Add-on configuration
@ -60,19 +29,23 @@ Configuration example that uses the USB microphone and the built-in headset audi
```json
{
"mic": "1,0",
"speaker": "0,0",
"client_secrets": "google_assistant.json"
"client_secrets": "google_assistant.json",
"project_id": null,
"model_id": null
}
```
{% configuration %}
mic:
description: This is the hardware address of your microphone. Look at the add-on output.
client_secrets:
description: The file downloaded from the Google Cloud Platform Console - Google Assistant API page. By default the add-on look in the "hassio/share" folder.
required: true
type: float
speaker:
description: This is the hardware address of your speakers. Look at the add-on output.
type: string
project_id:
description: The project id can be found in your "google_assistant.json" file.
required: true
type: string
model_id:
description: A chosen model_id.
required: true
type: string
{% endconfiguration %}
@ -88,3 +61,4 @@ Use the Home Assistant [DialogFlow component][comp] to integrate the add-on into
[project]: https://console.cloud.google.com/project
[API]: https://console.developers.google.com/apis/api/embeddedassistant.googleapis.com/overview
[oauthclient]: https://console.developers.google.com/apis/credentials/oauthclient
[cloudConsole]: https://console.cloud.google.com/cloud-resource-manager