Update manual setup to reflect current Google Developer Console (#37085)

This commit is contained in:
c0ffeeca7 2025-01-24 10:20:32 +01:00 committed by GitHub
parent f60e27ceab
commit 26c530f7c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,65 +29,62 @@ For Home Assistant Cloud users, documentation can be found [here](https://www.na
The Google Assistant integration (without Home Assistant Cloud) requires a bit more setup than most due to the way Google requires Assistant Apps to be set up. The Google Assistant integration (without Home Assistant Cloud) requires a bit more setup than most due to the way Google requires Assistant Apps to be set up.
{% important %} ### Prerequisites
To use Google Assistant, your Home Assistant configuration has to be [externally accessible with a hostname and SSL certificate](/docs/configuration/remote/). If you haven't already configured that, you should do so before continuing. If you make DNS changes to accomplish this, please ensure you have allowed up to the full 48 hours for DNS changes to propagate, otherwise, Google may not be able to reach your server. Once you have confirmed you can reach your Home Assistant from outside your home network, you can set up the Google integration:
{% endimportant %} To use Google Assistant, your Home Assistant configuration has to be [externally accessible with a hostname and SSL certificate](/docs/configuration/remote/).
- If you haven't already configured that, you should do so before continuing.
- If you make DNS changes to accomplish this, ensure you have allowed up to the full 48 hours for DNS changes to propagate, otherwise, Google may not be able to reach your server.
- Once you have confirmed you can reach your Home Assistant from outside your home network, you can set up the Google integration:
### Google Cloud Platform configuration ### Google Cloud Platform configuration
1. Create a new project in the [Actions on Google console](https://console.actions.google.com/). 1. Create a new project in the [Google Developer Console](https://console.home.google.com/projects).
1. Select **New Project** and give your project a name. 1. Select **Create a Project**
2. Select the **Smart Home** card, then select the **Start Building** button. 2. On the **Get started** page, select **Create project**.
3. Under **Quick Setup**, select **Name your Smart Home action**. Give your Action a name - Home Assistant will appear in the Google Home app as `[test] <Action Name>` - Give your project a name and select **Create project**.
4. Select the **Overview** tab at the top of the page to go back. 3. Save your Project ID (it's under the main project name) for use below.
5. Select **Build your Action**, then select **Add Action(s)**. 4. Select **Add a Cloud-to-Cloud integration**.
6. Add your Home Assistant URL: `https://[YOUR HOME ASSISTANT URL:PORT]/api/google_assistant` in the **Fulfillment URL** textbox, replace the `[YOUR HOME ASSISTANT URL:PORT]` with the domain / IP address and the port under which your Home Assistant is reachable. 5. In the bottom right corner, select **Next: Develop**, then select **Next: Setup**.
7. Select **Save**. 6. Select all applicable device types (you can select them all).
8. Select the three little dots (more) icon in the upper right corner, select **Project settings**. 7. Create an app icon 144 x 144 pixels and upload it.
9. Make note of the **Project ID** that are listed on the **General** tab of the **Settings** page. 8. Under **Account Linking**, in the **OAuth Client ID** field, enter `https://oauth-redirect.googleusercontent.com/r/[YOUR_PROJECT_ID]`.
2. **Account linking** is required for your app to interact with Home Assistant. 9. Replace `[YOUR_PROJECT_ID]` with your project ID from above.
1. Start by going back to the **Overview** tab. 10. Fill in the details:
2. Select on **Setup account linking** under the **Quick Setup** section of the **Overview** page. - In the **Client Secret** field, add any string (without special characters).Home Assistant doesn't need this field.
3. If asked, leave options as they default **No, I only want to allow account creation on my website** and select **Next**. - In the **Authorization URL** field, enter `https://[yourdomain:port]/auth/authorize`.
4. Then if asked, for the **Linking type** select **OAuth** and **Authorization Code**. Select **Next**. - In the **Token URL** field, enter `https://[yourdomain:port]/auth/token`.
5. Enter the following: - In the **Cloud fulfillment URL** field, enter `https://[yourdomain:port]/api/google_assistant`.
1. Client ID: `https://oauth-redirect.googleusercontent.com/r/[YOUR_PROJECT_ID]`. (Replace `[YOUR_PROJECT_ID]` with your project ID from above) - For now, skip **Local fulfillment** and **App Flip**.
2. Client Secret: Anything you like, Home Assistant doesn't need this field. - Under **Scope(s)**, enter `email`. Select **Add scope** and enter `name`.
3. Authorization URL: `https://[YOUR HOME ASSISTANT URL:PORT]/auth/authorize`. (Replace `[YOUR HOME ASSISTANT URL:PORT]` with your values.) - Leave the checkbox **Have Google transmit Client ID and secret via HTTP basic auth header** unchecked/cleared.
4. Token URL (replace with your actual URL): `https://[YOUR HOME ASSISTANT URL:PORT]/auth/token`. (Replace `[YOUR HOME ASSISTANT URL:PORT]` with your values.) - Select **Save**.
Select **Next**, then **Next** again. - **Result**: You will see your project saved with the status **Draft**.
6. In the **Configure your client** **Scopes** textbox, type `email` and select **Add scope**, then type `name` and select **Add scope** again. - You do not need to test.
7. Do **NOT** check **Google to transmit clientID and secret via HTTP basic auth header**.
8. Select **Next**, then select **Save**.
<img src='/images/integrations/google_assistant/accountlinking.png' alt='Screenshot: Account linking'> 2. In the left hand menu of your project, select the **Analytics** link.
- Select the hamburger {% icon "mdi:hamburger-menu" %} menu and select **APIs and Services**.
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). 3. Enable device sync ([see below for more information](#enable-device-sync)).
1. In the left hand menu, select **Credentials**.
4. Enable device sync ([see below for more information](#enable-device-sync)). 2. In the **Credentials** view, select **Create credentials** and next **Service account**.
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. 1. **Service account name**: Give your account a self-selected name.
2. Select **Create and Continue**. 2. Select **Create and Continue**.
3. Under **Select a role**, select **Service Accounts** > **Service Account Token Creator**. 3. Under **Select a role**, select **Service Accounts** > **Service Account Token Creator**.
4. Select **Continue** and then **Done**. 4. Select **Continue** and then **Done**.
6. Under **Service Accounts**, there should now be an account called [name from 5.1]@[projectname].iam.gserviceaccount.com. 3. Under **Service Accounts**, there should now be an account called [name from 3.2.1]@[projectname].iam.gserviceaccount.com.
7. Select the pencil button of that service account. 4. Select the pencil button of that service account.
8. Go to **Keys** and **Add key**. 5. Go to **Keys** and **Add key**.
9. Create a private key in JSON format. 6. Create a private key in JSON format.
10. This will start a download of a JSON file. 7. This will start a download of a JSON file.
1. Rename the file to `SERVICE_ACCOUNT.JSON`. 1. Rename the file to `SERVICE_ACCOUNT.JSON`.
2. Add this file to your config-folder. This will be the same folder as your{% term "`configuration.yaml`" %}. 2. In Home Assistant, add this file to your config-folder. This will be the same folder as your {% term "`configuration.yaml`" %}.
11. Go back to [Google Cloud Platform](https://console.cloud.google.com/) and select **Close**. 8. Go back to [Google Cloud Platform](https://console.cloud.google.com/) and select **Close**.
12. Then select **Save**. 9. Then select **Save**.
13. Go to the **Search products and resources** and search for **Homegraph API** and select it. 10. Go to the **Search products and resources** and search for **Homegraph API** and select it.
14. Enable the HomeGraph API. 11. Enable the HomeGraph API.
5. Add the `google_assistant` integration configuration to your{% term "`configuration.yaml`" %} file and restart Home Assistant following the [configuration guide](#yaml-configuration) below. 4. Add the `google_assistant` integration configuration to your {% term "`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). 5. Add services in the Google Home App (note that app versions may be slightly different).
1. Open the Google Home app. 1. Open the Google Home app.
2. Select the `+` button on the top left corner, select **Set up device**. In the **Set up a device** screen, select **Works with Google**. You should have `[test] <Action Name>` listed under **Add new**. Selecting that should lead you to a browser to login your Home Assistant instance, then redirect back to a screen where you can set rooms and nicknames for your devices if you wish. 2. Select the `+` button on the top left corner, select **Set up device**. In the **Set up a device** screen, select **Works with Google**. You should have `[test] <Action Name>` listed under **Add new**. Selecting that should lead you to a browser to login your Home Assistant instance, then redirect back to a screen where you can set rooms and nicknames for your devices if you wish.