Google assistant integration: Remove duplicated sections and improve steps (#31514)

* Removed duplicated section, more detailed steps

* fix numbering in markdown

* better cross linking
This commit is contained in:
l3d00m 2024-02-20 15:28:47 +01:00 committed by GitHub
parent dc282f1f30
commit d66d7c0f42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -66,26 +66,27 @@ To use Google Assistant, your Home Assistant configuration has to be [externally
3. Select the **Develop** tab at the top of the page, then, in the upper right hand corner, select the **Test** button to generate the draft version Test App. If you don't see this option, go to the **Test** tab instead, select the **Settings** button in the top right below the header, and ensure **On device testing** is enabled (if it isn't, enable it).
4. Go to [Google Cloud Platform](https://console.cloud.google.com/).
1. Go to **Select a project**.
2. In the window that popped up, select your newly created project from step 1.
3. Go to the menu and select **APIs and Services** and next **Credentials**.
4. In the **Credentials** view, select **Create credentials** and next **Service account**.
4. Enable device sync ([see below for more information](#enable-device-sync)).
1. Go to [Google Cloud Platform](https://console.cloud.google.com/).
2. Go to **Select a project**.
3. In the window that popped up, select your newly created project from step 1.
4. Go to the menu and select **APIs and Services** and next **Credentials**.
5. In the **Credentials** view, select **Create credentials** and next **Service account**.
1. **Service account name**: Give your account a self-selected name.
2. Select **Create and Continue**.
3. Under **Select a role**, select **Service Accounts** > **Service Account Token Creator**.
4. Select **Continue** and then **Done**.
5. Under **Service Accounts**, there should now be an account called [name from 4.1]@[projectname].iam.gserviceaccount.com.
6. Select the pencil button of that service account.
7. Go to **Keys** and **Add key**.
8. Create a private key, make sure it is in JSON format.
9. This will start a download of a JSON file.
6. Under **Service Accounts**, there should now be an account called [name from 4.1]@[projectname].iam.gserviceaccount.com.
7. Select the pencil button of that service account.
8. Go to **Keys** and **Add key**.
9. Create a private key in JSON format.
10. This will start a download of a JSON file.
1. Rename the file to `SERVICE_ACCOUNT.JSON`.
2. Add this file to your config-folder. This will be the same folder as your `configuration.yaml`.
10. Go back to [Google Cloud Platform](https://console.cloud.google.com/) and select **Close**.
11. Then select **Save**.
12. Go to the **Search products and resources** and search for **Homegraph API** and select it.
13. Enable the HomeGraph API.
11. Go back to [Google Cloud Platform](https://console.cloud.google.com/) and select **Close**.
12. Then select **Save**.
13. Go to the **Search products and resources** and search for **Homegraph API** and select it.
14. Enable the HomeGraph API.
5. Add the `google_assistant` integration configuration to your `configuration.yaml` file and restart Home Assistant following the [configuration guide](#yaml-configuration) below.
6. Add services in the Google Home App (note that app versions may be slightly different).
@ -117,23 +118,9 @@ If you want to allow other household users to control the devices:
If you want to support active reporting of state to Google's server (configuration option `report_state`) and synchronize Home Assistant devices with the Google Home app (`google_assistant.request_sync` service), you will need to create a service account. It is recommended to set up this configuration key as it also allows the usage of the following command, "Ok Google, sync my devices". Once you have set up this component, you will need to call this service (or command) each time you add a new device in Home Assistant that you wish to control via the Google Assistant integration. This allows you to update devices without unlinking and relinking an account (see [below](#troubleshooting)).
1. Service Account
1. In the Google Cloud Platform Console, go to the [Create Service account key](https://console.cloud.google.com/iam-admin/serviceaccounts/create) page.
2. At the top left of the page next to "Google Cloud Platform" logo, select your project created in the Actions on Google console. Confirm this by reviewing the project ID and it ensure it matches.
3. From the Service account list, select **Create service account**.
4. In the **Service account name** field, enter a name.
5. In the **Service account ID** field, enter an ID.
6. Under **Select a role**, select **Service Accounts** > **Service Account Token Creator**.
7. Select **Continue** and then **Done**. You are returned to the service account list, and your new account is shown.
8. Select the three dots menu under **Actions** next to your new account, and select **Manage keys**. You are taken to a **Keys** page.
9. Select **Add key** then **Create new key**. Leave the **key type** as **JSON** and select **Create**. A JSON file that contains your key downloads to your computer.
10. Use the information in this file or the file directly to add to the `service_account` key in the configuration.
11. Select **Close**.
2. HomeGraph API
1. Go to the [Google API Console](https://console.cloud.google.com/apis/api/homegraph.googleapis.com/overview).
2. At the top left of the page next to "Google Cloud Platform" logo, select your project created in the Actions on Google console. Confirm this by reviewing the project ID and it ensure it matches.
3. Select **Enable HomeGraph API**.
3. Try "OK Google, sync my devices" - the Google Home app should import your exposed Home Assistant devices and prompt you to assign them to rooms.
The service account is created by following Step 4 (Enable device sync) in the previous section [Google Cloud Platform configuration](#google-cloud-platform-configuration).
Try it with "OK Google, sync my devices" - the Google Home app should import your exposed Home Assistant devices and prompt you to assign them to rooms.
### Enable local fulfillment
@ -159,14 +146,18 @@ For secure remote access, use a reverse proxy such as the {% my supervisor_addon
1. Open the project you created in the [Actions on Google console](https://console.actions.google.com/).
2. Select **Develop** on the top of the page, then select **Actions** located in the hamburger menu on the top left.
3. Upload `app.js` from [here](https://github.com/NabuCasa/home-assistant-google-assistant-local-sdk/releases/latest) for both Node and Chrome by selecting the **Upload JavaScript files** button.
4. Add device scan configuration:
3. Upload Javascript files
1. Download `app.js` from [here](https://github.com/NabuCasa/home-assistant-google-assistant-local-sdk/releases/latest)
2. Select the **Upload JavaScript files** button.
3. Select **Upload your JavaScript targeting Node** and upload the `app.js` from step 3.1.
4. Select **Upload your JavaScript targeting Chrome (browser)** and upload the `app.js` from step 3.1.
4. Check the box **Support local query** under **Add capabilities**.
5. Add device scan configuration:
1. Select **+ New scan config** if no configuration exists.
2. Select **MDNS**.
3. Set **MDNS service name** to `_home-assistant._tcp.local`
4. Select **Add field**, then under **Select a field**, choose **Name**.
5. Enter a new **Value** field set to `.*\._home-assistant\._tcp\.local`
5. Check the box **Support local query** under **Add capabilities**.
6. Save your changes.
7. Either wait for 30 minutes, or restart all your Google Assistant devices.
8. Restart Home Assistant Core.
@ -373,13 +364,13 @@ This error may occur if the service key is invalid. Try deleting and creating a
#### NGINX
When using NGINX, ensure that your `proxy_pass` line *does not* have a trailing `/`, as this will result in errors. Your line should look like:
When using NGINX, ensure that your `proxy_pass` line _does not_ have a trailing `/`, as this will result in errors. Your line should look like:
proxy_pass http://localhost:8123;
### Unlink and relink
If you're having trouble with *Account linking failed* after you unlinked your service, try clearing the browser history and cache.
If you're having trouble with _Account linking failed_ after you unlinked your service, try clearing the browser history and cache.
### Failed linking - Could not update the setting. Please check your connection