Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual Google Assistant needs new setup instructions #35867

Closed
y8s opened this issue Nov 21, 2024 · 43 comments
Closed

Manual Google Assistant needs new setup instructions #35867

y8s opened this issue Nov 21, 2024 · 43 comments

Comments

@y8s
Copy link

y8s commented Nov 21, 2024

Feedback

Was trying to add the Google Assistant functionality for non nabu casa people and ran into the depreciation of Google actions.

The actions page pushed you to use the developer console instead (actions is now view only and you can't add new ones).

The good news is that after some playing around, doing it through the new Google Home Developer Console seems to work. And other than a few changes to the process, has basically the same elements. I think you just leave it at the point before testing and add your service account, update hass configuration, then you can add it to Google home on your phone.

So the steps just need to be reworked to match the new console.

URL

https://www.home-assistant.io/integrations/google_assistant/

Version

2024.11.2

Additional information

No response

@home-assistant
Copy link

Hey there @home-assistant/cloud, mind taking a look at this feedback as it has been labeled with an integration (google_assistant) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of google_assistant can trigger bot actions by commenting:

  • @home-assistant close Closes the feedback.
  • @home-assistant rename Awesome new title Renames the feedback.
  • @home-assistant reopen Reopen the feedback.
  • @home-assistant unassign google_assistant Removes the current integration label and assignees on the feedback, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information) to the feedback.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information) on the feedback.

@balloob
Copy link
Member

balloob commented Nov 21, 2024

Would you be able to update the guide with the steps that you took?

@y8s
Copy link
Author

y8s commented Nov 21, 2024

I'll look at it if I get some time this week, sure.

@y8s
Copy link
Author

y8s commented Nov 22, 2024

I think the migration is causing some inconsistencies but I just wrote up the part of the process that's different with the Google Home Developer Console (as compared to the Actions Console).

Create Project in Google Home Developer Console

  1. Go to the Google Home Developer Console
  2. Click on Create a Project
    Screenshot 2024-11-22 141432
  3. On the Get Started page, click Create a Project
    Screenshot 2024-11-22 141824
  4. Enter a project name and click Create Project
    9cf67b392989a51075faa1b52f312cf8
  5. Save your Project ID (it's under the main project name) for use below.
  6. On the Project Home page, add a Cloud-to-Cloud integration.
    Screenshot 2024-11-22 142124
  7. Click the Next: Develop button at the bottom.
  8. Click the Next: Setup button at the bottom.
  9. Enter a name for the integration.
  10. Select all applicable device types (you can select them all).
  11. Create an app icon 144 x 144 pixels and upload it by selecting the Upload image button.
  12. under Account Linking, in the OAuth Client ID field, Enter https://oauth-redirect.googleusercontent.com/r/[YOUR_PROJECT_ID]. (Replace [YOUR_PROJECT_ID] with your project ID from above).
  13. Add any string (without special characters) to the Client Secret field. Home Assistant doesn't need this field.
  14. Enter https://[yourdomain:port]/auth/authorize in the Authorization URL field.
  15. Enter https://[yourdomain:port]/auth/token in the Token URL field.
  16. Enter https://[yourdomain:port]/api/google_assistant in the Cloud fulfillment URL field.
  17. Skip Local fulfillment and App Flip for now and
  18. Under Scope(s), add email and click + Add scope and add name.
  19. Leave the "Have Google transmit Client ID and secret via HTTP basic auth header" UNchecked.
  20. Click Save
  21. You will see your project saved with the status "Draft".
  22. You do not need to test.

Finish Setup.

  1. Click on the Analytics link in the left hand menu for your project.
  2. Click on the Hamburger (sandwich?) menu and select APIs and Services.
  3. Continue from Home Assistant Google Assistant Integration Page Step 4 (You're already in the Cloud Console).

I think the rest is essentially the same.

@SalutLesNoobs
Copy link

I think the migration is causing some inconsistencies but I just wrote up the part of the process that's different with the Google Home Developer Console (as compared to the Actions Console).

Create Project in Google Home Developer Console

1. Go to the [Google Home Developer Console](https://console.home.google.com/projects)

2. Click on _Create a Project_
   ![Screenshot 2024-11-22 141432](https://private-user-images.githubusercontent.com/23405764/389099349-2ca8f36c-a1f6-478b-ac45-40ee10ba1938.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzI0ODEyMzksIm5iZiI6MTczMjQ4MDkzOSwicGF0aCI6Ii8yMzQwNTc2NC8zODkwOTkzNDktMmNhOGYzNmMtYTFmNi00NzhiLWFjNDUtNDBlZTEwYmExOTM4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDExMjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMTI0VDIwNDIxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJlYjQ5NGU0YjA0NTllODcxZDQ2ZmJlZWJiOGJiMWYzNWNjNzIwNzczMTI4MzI3YzVkMzg5MzhlYmM0MGRkYmImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.N94CgMcChWTRhR8-X_wf6UKFYoCwLeImfWVJF8LUKKg)

3. On the Get Started page, click _Create a Project_
   ![Screenshot 2024-11-22 141824](https://private-user-images.githubusercontent.com/23405764/389099481-9ffc0368-a6b8-443d-bfd5-5d6047ee2b25.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzI0ODEyMzksIm5iZiI6MTczMjQ4MDkzOSwicGF0aCI6Ii8yMzQwNTc2NC8zODkwOTk0ODEtOWZmYzAzNjgtYTZiOC00NDNkLWJmZDUtNWQ2MDQ3ZWUyYjI1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDExMjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMTI0VDIwNDIxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM3MGNiYWMxNThkNzhmNGUzMWUxNzkzMmNkMGE3MmRkYWEwZGUyMWRhNWVkYjcyYjJmNTY1OGNkOGM5NDJiYTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.eDMZAOX-lB7AmGeAMimnGN4QH2qatEmXbf8DHSm1-mg)

4. Enter a project name and click _Create Project_
   ![9cf67b392989a51075faa1b52f312cf8](https://private-user-images.githubusercontent.com/23405764/389099526-b411efbb-583b-4583-bbfb-b17f523e77be.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzI0ODEyMzksIm5iZiI6MTczMjQ4MDkzOSwicGF0aCI6Ii8yMzQwNTc2NC8zODkwOTk1MjYtYjQxMWVmYmItNTgzYi00NTgzLWJiZmItYjE3ZjUyM2U3N2JlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDExMjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMTI0VDIwNDIxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM2NzIwYjI5ZDU0ZmFlZThlYjQ4M2NkYzhhMWFlYzUwZTkwYTU1OTg3N2EyMjFkNjI2Y2YyMzAzOWE5NjNiNTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0._1WCLiD7Ex4HM6M0IkgCVDFJZFSoSjkHQhvXZyoBPXU)

5. Save your **Project ID** (it's under the main project name) for use below.

6. On the _Project Home_ page, add a Cloud-to-Cloud integration.
   ![Screenshot 2024-11-22 142124](https://private-user-images.githubusercontent.com/23405764/389099568-2ee3f675-97f9-4aba-8ea1-a852c2464dcc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzI0ODEyMzksIm5iZiI6MTczMjQ4MDkzOSwicGF0aCI6Ii8yMzQwNTc2NC8zODkwOTk1NjgtMmVlM2Y2NzUtOTdmOS00YWJhLThlYTEtYTg1MmMyNDY0ZGNjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDExMjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMTI0VDIwNDIxOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNlZTY3OTU4YjM5OTAxZDE0MzI4NTkwNGUxMmE2YmQyOTYyNTc0YjM2ODM5ZmU0YmQwMDdmYjEwMDQ5MGIwZjImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.BhBtAjpOsUlRZoeUh6bZL1n8sRTRq_Q07xPcpJdUVAc)

7. Click the _Next: Develop_ button at the bottom.

8. Click the _Next: Setup_ button at the bottom.

9. Enter a name for the integration.

10. Select all applicable device types (you can select them all).

11. Create an app icon 144 x 144 pixels and upload it by selecting the _Upload image_ button.

12. under _Account Linking_, in the _OAuth Client ID_ field, Enter `https://oauth-redirect.googleusercontent.com/r/[YOUR_PROJECT_ID]`. (Replace [YOUR_PROJECT_ID] with your project ID from above).

13. Add any string (without special characters) to the _Client Secret_ field. Home Assistant doesn't need this field.

14. Enter `https://[yourdomain:port]/auth/authorize` in the _Authorization URL_ field.

15. Enter `https://[yourdomain:port]/auth/token` in the _Token URL_ field.

16. Enter `https://[yourdomain:port]/api/google_assistant` in the _Cloud fulfillment URL_ field.

17. Skip _Local fulfillment_ and _App Flip_ for now and

18. Under _Scope(s)_, add `email` and click _+ Add scope_ and add `name`.

19. Leave the "Have Google transmit Client ID and secret via HTTP basic auth header" **UN**checked.

20. Click _Save_

21. You will see your project saved with the status "Draft".

22. You do not need to test.

Finish Setup.

1. Click on the _Analytics_ link in the left hand menu for your project.

2. Click on the Hamburger (sandwich?) menu and select _APIs and Services_.

3. Continue from Home Assistant [Google Assistant Integration Page ](https://www.home-assistant.io/integrations/google_assistant/#google-cloud-platform-configuration) Step 4 (You're already in the Cloud Console).

I think the rest is essentially the same.

Yes, But :
image

@y8s
Copy link
Author

y8s commented Nov 24, 2024

I think the migration is causing some inconsistencies
Yes, But : image

that's the inconsistent part. try again later? I got that a couple of times too.

@SalutLesNoobs
Copy link

I think the migration is causing some inconsistencies
Yes, But : image

that's the inconsistent part. try again later? I got that a couple of times too.

i have deleted everythings and that OK. I have done all and on my iPhone, it says : "[test]HomeAssistant is associated" and 1 sec later : "A error ahs occured..."

@jbrandek
Copy link

16. /api/google_assistant

Wow thank you i couldnt find this anywere else... works perfect

One question on the documentation says taht it can work locally and in the step 17 yos stated taht skip local for now, do you have any idea how to make it work locally?

@y8s
Copy link
Author

y8s commented Nov 28, 2024

  1. /api/google_assistant

Wow thank you i couldnt find this anywere else... works perfect

One question on the documentation says taht it can work locally and in the step 17 yos stated taht skip local for now, do you have any idea how to make it work locally?

follow the rest of the steps in the hass instructions page. the local fulfillment stuff is all in the same page

@Onepamopa
Copy link

Why haven't the official documentation been updated yet?

@jbrandek
Copy link

  1. /api/google_assistant

Wow thank you i couldnt find this anywere else... works perfect
One question on the documentation says taht it can work locally and in the step 17 yos stated taht skip local for now, do you have any idea how to make it work locally?

follow the rest of the steps in the hass instructions page. the local fulfillment stuff is all in the same page

but in the page it sends you yo Actions google console to upload a fiile but there is no way to do that beacuse it says that is view only... Conversational Actions have been sunset. Changes can't be made to any actions. You can still view the Actions for a limited time.

@y8s
Copy link
Author

y8s commented Nov 29, 2024

go through my steps above. at 17 flip the toggle.

then try to do the steps from the original doc. you'll have to match up the old instructions to the new process.

1000013070

@jbrandek
Copy link

go through my steps above. at 17 flip the toggle.

then try to do the steps from the original doc. you'll have to match up the old instructions to the new process.

1000013070

Thanks on testing urls do i have to add somewthing?

@VK1MIC
Copy link

VK1MIC commented Dec 15, 2024

I keep getting a contains"Request contains an invalid argument"
Uploading Screenshot 2024-12-15 at 11.06.48.png…

@slaygirlz
Copy link

how could I invite a family member to add devices to their google home?

@KNGP14
Copy link

KNGP14 commented Dec 17, 2024

thank u for the updated guide, worked as expected for me!

@HoM3r17
Copy link

HoM3r17 commented Dec 17, 2024

Thanks for the guide @y8s !

Finally got it working, unfortunately I can't get "local fulfillment" to work, If I enable it following tho original documentation, then "sync my devices" command gets me an error. I guess I'll settle for the cloud version for the time being ...

@Onepamopa
Copy link

When is the official documentation going to be updated @ the website?

@sharklatan
Copy link


Steps to Configure Google Assistant through the Google Home Developer Console

Control your devices with Google Home speakers and have them appear in the Google Home app

Google Assistant, integrated with Home Assistant, allows you to control your smart devices via Google Home. To do this, you must set up an integration between both using the Google Home Developer Console, enabling device synchronization, and configuring your configuration.yaml file. Here's how to do it step by step:


Steps to Set Up Google Assistant with Home Assistant:

  1. Create a Project in the Google Home Developer Console

  2. Configure the Cloud-to-Cloud Integration

    • On the project homepage, click on Next: Develop.
    • Then click Next: Configure.
    • Enter a name for the integration.
    • Select all applicable device types (you can select all).
    • Create an application icon (144x144 px) and upload it.
    • Under Account Linking, enter the following:
      • OAuth Client ID: https://oauth-redirect.googleusercontent.com/r/[YOUR_PROJECT_ID]
      • Client Secret: Enter any string (Home Assistant doesn't need this field).
      • Authorization URL: https://[yourdomain:port]/auth/authorize
      • Token URL: https://[yourdomain:port]/auth/token
      • Cloud Fulfillment URL: https://[yourdomain:port]/api/google_assistant
    • Leave Local Fulfillment and App Flip blank for now.
    • Under Scopes, add emailname and click + Add scope.
    • Leave the option "Allow Google to transmit client ID and secret via basic HTTP authentication header" unchecked.
    • Click Save.
  3. Finalize the Setup

    • After saving, your project will appear in Draft status.
    • Click on Analytics in the left menu and go to APIs & Services.
  4. Enable Device Synchronization

    • Go to Google Cloud Platform.
    • Click Select a Project.
    • In the window that appears, select your project (from step 1).
    • Go to the menu and select APIs & Services, then Credentials.
    • In the Credentials view, click Create credentials, then Service Account.
    • Service Account Name: Choose a name for the account.
    • Under Select a Role, choose Service Accounts > Service Account Token Creator.
    • Click Continue and then Done.
    • In Service Accounts, you should now see an account named [service account name]@[project name].iam.gserviceaccount.com.
    • Click the pencil icon for that service account.
    • Go to Keys and click Add Key.
    • Create a private key in JSON format. This will download a JSON file.
    • Rename the downloaded file to SERVICE_ACCOUNT.JSON.
  5. Link the Service with Google Home

    • In Home Assistant, go to Configuration > Integrations and search for Google Cloud (it might be a similar name).
    • You will need to upload the SERVICE_ACCOUNT.JSON file you downloaded earlier. Make sure the file is in the same folder as your configuration.yaml (typically in /config/).
    • Return to Google Cloud Platform and click Close.
    • Then click Save.
    • Go to Search for products and resources, search for Homegraph API, and select it. Enable the HomeGraph API.
  6. Modify the configuration.yaml File in Home Assistant

    • After configuring everything in the Google Developer Console and enabling the HomeGraph API, you now need to modify your configuration.yaml file to allow Home Assistant to communicate with Google Assistant.

    • Make sure the SERVICE_ACCOUNT.JSON file is in the /config/ folder of your Home Assistant.

    • Modify your configuration.yaml file with the following configuration:

      google_assistant:
        service_account: !include /config/SERVICE_ACCOUNT.JSON
        report_state: true  # This allows syncing the state with Google Home
        expose_by_default: false  # Do not expose all entities automatically
        exposed_domains:
          - switch
          - light
          - camera
    • This exposes switches, lights, and cameras. If you need to expose other devices like climate or fan, simply add them to the exposed_domains list.

  7. Configure Specific Entities (Optional)

    • If you want to expose specific entities with custom names, add the entity_config section as shown earlier:

      entity_config:
        switch.living_room_light:
          name: "Living Room Light"
          room: "Living Room"
        light.kitchen_light:
          name: "Kitchen Light"
          room: "Kitchen"
        camera.front_door_camera:
          name: "Front Door Camera"
          room: "Entrance"
    • This allows more specific control over entities and their names in Google Home.

  8. Final Check

    • Go to Configuration > Server Controls and click on Check Configuration to ensure everything is correct.
    • If everything is fine, restart Home Assistant.
  9. Additional Considerations

    • CloudFlare Tunnel: If you're using a CloudFlare tunnel, make sure to disable the Bot Fight Mode in CloudFlare's security settings, as it may cause errors when integrating with Google Home.

Additional Steps to Enable Local Fulfillment:

  1. Edit your project and enable Local Fulfillment
    To reduce latency and improve reliability, allow your app to communicate directly with your devices to fulfill user commands.

    You can download the app.js file from here: [Download app.js](https://github.com/NabuCasa/home-assistant-google-assistant-local-sdk/releases/latest)

  2. In the Actions section, select Upload JavaScript files.

  3. Download app.js from the provided source and import it for both Node.js and Chrome.

  4. Enable the Support for Local Queries option.

  5. Add the device scanning configuration:

    • Select + New Scanning Configuration.
    • Set the MDNS service name to _home-assistant._tcp.local.
    • Add the Value field as .*\._home-assistant\._tcp\.local.
  6. Save the changes.

  7. Wait 30 minutes or restart all your Google Assistant devices.

  8. Test by saying "OK Google, sync my devices".


References:


@HoM3r17
Copy link

HoM3r17 commented Dec 27, 2024

  1. Additional Considerations

    • CloudFlare Tunnel: If you're using a CloudFlare tunnel, make sure to disable the Bot Fight Mode in CloudFlare's security settings, as it may cause errors when integrating with Google Home.

Thanks for the process ! The only argue I would have is with point n°9, I think it's actually safer to let the Bot Fight Mode on, and instead allow Google's ASN in the WAF section
Screenshot_20241227-133130

@LinqLover
Copy link

LinqLover commented Dec 28, 2024

Thanks @sharklatan for the clear write-up! Comments and review on the updated instructions:

  1. Finalize the Setup

    • After saving, your project will appear in Draft status.
    • Click on Analytics in the left menu and go to APIs & Services.

This step group is essentially redundant, "APIs & Services" is not available under "Analytics" and in step group 4 you describe anyway how to access this page instead. I suggest removing this step group.

  • In Home Assistant, go to Configuration > Integrations and search for Google Cloud (it might be a similar name).

In the current web interface (20241127.8), the detailed steps are:

  • In Home Assistant, go to Settings > Devices & Services > Integrations, click Add Integration, and search for Google Cloud (it might be a similar name).
  • You will need to upload the SERVICE_ACCOUNT.JSON file you downloaded earlier. Make sure the file is in the same folder as your configuration.yaml (typically in /config/).

The current web interface does not provide an option to choose the path, you can just upload it and press Submit. For the same reason, I needed to manually copy the file into /config in the next step group.

  • Return to Google Cloud Platform and click Close.
  • Then click Save.
  • Go to Search for products and resources, search for Homegraph API, and select it. Enable the HomeGraph API.

I was a bit confused that we're now back at the Google Cloud Platform. Couldn't these steps moved earlier into step group 4?

  • Final Check

    • Go to Configuration > Server Controls and click on Check Configuration to ensure everything is correct.
    • If everything is fine, restart Home Assistant.

"Check configuration" does not exist, but it seems that it is enough to press "Quick reload" in the Restart menu (under Settings > System > Power icon (in the top right corner)), any error in the YAML will be displayed when attempting this. After that, restart the home assistant entirely.

  • Rename the downloaded file to SERVICE_ACCOUNT.JSON.

As many users might come from a Windows background and it's a subtle difference, I'd suggest maybe noting explicitly that the extension must be JSON in uppercase (NOT the default json in lowercase of the downloaded file from the Google Cloud Console).

  • Modify your configuration.yaml file with the following configuration:
    google_assistant:
      service_account: !include /config/SERVICE_ACCOUNT.JSON
      report_state: true  # This allows syncing the state with Google Home
      expose_by_default: false  # Do not expose all entities automatically
      exposed_domains:
        - switch
        - light
        - camera

The project_id is missing here, which needs to be added like:

  google_assistant:
    project_id: YOUR_PROJECT_ID
    service_account: !include /config/SERVICE_ACCOUNT.JSON
    # ...

Additional Steps to Enable Local Fulfillment:

  1. Edit your project and enable Local Fulfillment
    To reduce latency and improve reliability, allow your app to communicate directly with your devices to fulfill user commands.
    You can download the app.js file from here: [Download app.js](https://github.com/NabuCasa/home-assistant-google-assistant-local-sdk/releases/latest)

  2. In the Actions section, select Upload JavaScript files.

  3. Download app.js from the provided source and import it for both Node.js and Chrome.

  4. Enable the Support for Local Queries option.

  5. Add the device scanning configuration:

    • Select + New Scanning Configuration.
    • Set the MDNS service name to _home-assistant._tcp.local.
    • Add the Value field as .*\._home-assistant\._tcp\.local.
  6. Save the changes.

  7. Wait 30 minutes or restart all your Google Assistant devices.

  8. Test by saying "OK Google, sync my devices".

These steps have apparently not yet been updated since Actions were sunset? I found them by doing:

  1. Go to https://console.home.google.com/projects.
  2. Choose your project > press Open.
  3. Under Cloud-to-cloud, press Open.
  4. Enable Local fulfillment.
  5. Skip "testing URLs" (leave the URL fields empty).
  6. Download app.js from the provided source and import it for both Node.js and Chrome.
  7. Enable the Support local queries option.
  8. Under device discovery, press Add scan configuration, select the discovery protocol MDNS, and enter the service name.
  9. Scroll down and press Save.

Finally, the last step is missing in your updated list:

Add services in the Google Home App (note that app versions may be slightly different).

  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] <Project Name> listed under Add new. Selecting that should lead you to a browser to log into your Home Assistant instance, then redirect back to a screen where you can set rooms and nicknames for your devices if you wish.

Unfortunately, after logging into my Home Assistant instance, I get a popup in the Google Home app that says "Could not reach [test] <Project Name>. Please try again". And I have waited for more than 30 minutes. I can't find anything in the logs (not sure what I'd be searching for) and Cloudflare bot fighting is turned off. Did anybody see the same issue and was able to resolve it, or has an idea what I'm doing wrong?

Edit: Resolved that by adding the project_id to the yml above (see change history of this comment) and restarting the home assistant completely. Now I am seeing no exposed devices ...

Edit 2: I'm also confused that this description says we should be able to expose single entities to a "Google Assistant" voice assistant, but I can't see this voice assistant in my home assistant ...

Edit 3: I set expose_by_default to true (and restarted HA again) and in the same minute Google Home automatically found all my devices. Now I'm seeing too many devices that I don't want to expose, though...

Edit 4: Edit 3 is exactly what the docs suggest: "exposed_domains: List of entity domains to expose to Google Assistant if expose_by_default is set to true. This has no effect if expose_by_default is set to false.". So I will have to exclude certain entities via entity_config instead ... I wish we could configure this instead through the voice assistant settings in the UI, but this is no longer an issue with the docs. Could anybody confirm/explain why this works with Nabu Casa but not the self-hosted integration? If this is by design, I'd be happy to open a feature request for this.

@marksteward
Copy link

Under Scopes, add emailname and click + Add scope.

should read:

In the Scope(s) (optional) textbox, type email. Then click Add scope, and type name into the new textbox.

@zeljkopopovic
Copy link

Thank you soooo much
Does anyone try to do this using tailscale?

@athanassis
Copy link
Contributor

athanassis commented Jan 7, 2025

3 days ago I followed the above guide with HA 2024.12.5. It succeeded initially, but then after 1-2 days it has been failing with google assistant replying "cannot reach [project name]", whenever I turn on some light or I request to "sync my devices".

I've tried unlinking and relinking, it worked for few minutes and then same problem again.

While browsing console.home.google.com to identify any problematic places on my project configuration, I noticed that company profile was missing, although I had added some as indicated in this guide.

One change - easy to notice - is that it now requires 192pixel logo, while few days back it was requiring 144 pixels, as this guide describes. I filled in the necessary fields in the company profile as required by google, and now the profile is 'In review' state and the integration works again.

But it looks like there are some ongoing changes, which are causing problems. Perhaps this guide needs to be revisited once these changes are finalized.

Has anyone noticed similar problems?

@marksteward
Copy link

I set mine up on Sunday, and it didn't need a company profile, and testing now it still only wants a 144px icon. Your error sounds like a connectivity issue, have you checked the logs for your external access?

@athanassis
Copy link
Contributor

athanassis commented Jan 8, 2025

I have again same problem. Devices went to 'offline' state. The Company Profile is still In Review, so it seems this was not the problem, you are right.

Now, I unlinked and when trying to re-link I get a message
"could not reach [test] , please try again" from the google home App on the Android.

I see error logs on the home assistant, "Request for https://homegraph.googleapis.com/v1/devices:reportStateAndNotification failed: 404" appears 17 times.
I've seen also other types of errors, too, in the previous attempts

I did change the service account and refreshed the SERVICE_ACCOUNT.JSON as one of the troubleshooting steps suggests. I've been also clearing the chrome cache on the Android and also changing username/password for the login (from google home app to HA when adding devices). At some point it is working for few minutes or hours, but then devices go to OFFLINE and stay there.

I use DuckDNS and NGINX for connectivity.

@KentuckyMC
Copy link

I've the same scenario as mentioned by @athanassis . Using DuckDNS and NGINX and tried to pair the [test]homeassistant app again in Google Home, but without success.. I get the same error with: can't reach [test]homeassistant, try again.

The weird part is, that it prompts me to login with my Home Assistant login, that's al working fine. When that's done, it starts spinning, and then give me a snackbar notify with the can't reach. On my cloud console I see the following error:

SYNC: Request ID 14294252617453170120 failed with code: BACKEND_FAILURE_URL_TIMEOUT

It looks like some stuff is changing at Googles end, breaking some of this stuff. I've successfully followed all steps above, but seems like after re-pairing it breaks.

Anyone with some suggestions?

@danigati
Copy link

danigati commented Jan 8, 2025

I also have the same problem, I unlinked and when I linked again I got the error "can't reach [test]homeassistant, try again." after entering my HA credentials. I also use duckdns and nginx.

@marksteward
Copy link

That might be related but it feels more likely that it isn't, could someone open a new issue and link it here so we don't fill this one with troubleshooting? Could you also include screenshots and an example of an affected domain? It's important to know where the error's actually appearing, and my suspicion is DNS (DuckDNS has had downtime in the recent past).

@KentuckyMC
Copy link

I've created a new issue in the core project: home-assistant/core#135163

I can't directly mention this issue, because of the different project seems like. Hopefully there are some answers :)

@ruoccop
Copy link

ruoccop commented Jan 10, 2025

Apologies for asking what is likely a simple question.
What precisely do I enter for https://[yourdomain:port]/auth/authorize in the Authorization URL field?

The IP Address and port of my home assistant instance? (Which didn't work for me)
Or something else?

@lasdem
Copy link

lasdem commented Jan 13, 2025

Thank you everyone here, I have run through the steps outlined by @y8s , @sharklatan and @LinqLover and finished the setup and it works as expected.

@ikerinagy
Copy link

Hi Guys,

I followed the isntructions, but for some reason the Google Home app won't show my [test]HAFulep
No errors, it's just isn't there. HomeGraph API is enabled, Credentials are right, and Service_Account.json is inclued in the configuration.yaml file.

It looks like this at the moment:

default_config:

frontend:
themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

google_assistant:
project_id: hafulep-00954f
service_account: !include SERVICE_ACCOUNT.JSON
report_state: true

Any idea why it won't show up in Google Home app?

@KentuckyMC
Copy link

Hi Guys,

I followed the isntructions, but for some reason the Google Home app won't show my [test]HAFulep No errors, it's just isn't there. HomeGraph API is enabled, Credentials are right, and Service_Account.json is inclued in the configuration.yaml file.

It looks like this at the moment:

default_config:

frontend: themes: !include_dir_merge_named themes

automation: !include automations.yaml script: !include scripts.yaml scene: !include scenes.yaml

google_assistant: project_id: hafulep-00954f service_account: !include SERVICE_ACCOUNT.JSON report_state: true

Any idea why it won't show up in Google Home app?

I see a mismatch here with the Service_Account.json you mention, and the !include statement with all capitals. I think those must be the same.

@sharklatan
Copy link

Apologies for asking what is likely a simple question. What precisely do I enter for https://[yourdomain:port]/auth/authorize in the Authorization URL field?

The IP Address and port of my home assistant instance? (Which didn't work for me) Or something else?

You need to enter your DDNS domain name in the Authorization URL field, not just the IP address and port of your Home Assistant (HA) instance. For Google to access your HA instance, you must ensure it is reachable via a public domain name and that your instance has an SSL certificate (https). This setup requires either opening the necessary ports or setting up remote access for your Home Assistant.

This step is not included in the guide because it is a prerequisite: Google must be able to access your HA installation through a domain address secured with SSL (https). Without this, the authorization process won’t work.

@HansEJC
Copy link

HansEJC commented Jan 16, 2025

Thank you soooo much Does anyone try to do this using tailscale?

Did anyone manage to get it to work with tailscale?

I keep getting a contains"Request contains an invalid argument"
Uploading Screenshot 2024-12-15 at 11.06.48.png…

I'm getting the same error when trying to set up the cloud-to-cloud integration. Is this because of the tailscale domain?

@marksteward
Copy link

marksteward commented Jan 16, 2025

If you're using Tailscale Funnel, that should work, but I'd be cautious about exposing your HA instance to the global internet. I've set mine up on a secret domain using a wildcard TLS certificate (a bit like Plex do), but I don't think that's possible with Tailscale.

Google doesn't require the URL to be anything in particular other than HTTPS, but HomeAssistant won't support URL prefixes, so there's no other reasonable way to have the URL shared only with Google.

@c0ffeeca7
Copy link
Contributor

Thank you for providing the detailed step-by-step instructions, @y8s 🙏

@frenck
Copy link
Member

frenck commented Jan 24, 2025

fixed in #37085

@frenck frenck closed this as completed Jan 24, 2025
@y8s
Copy link
Author

y8s commented Jan 24, 2025

Thank you for providing the detailed step-by-step instructions, @y8s 🙏

It wasn't much but I'm happy to help in any tiny way!

@hu800
Copy link

hu800 commented Jan 26, 2025

I keep getting a contains"Request contains an invalid argument"

I managed to fix it by trying a different app icon. I downloaded a new icon, didn't even change the name, and it worked.

@Onepamopa
Copy link

Onepamopa commented Feb 18, 2025

So... followed the steps.
Enabled local fulfillment.

Started the Google Home app -> Add device -> Works with Google Home -> the integration -> logging in HA
It says it is "linked", then starts loading the circle again and "Something went wrong".

In the google console, the log says:
{
insertId: "15xhfzofq2r1zd"
logName: "projects/ha-dobri/logs/actions.googleapis.com%2Factions"
receiveTimestamp: "2025-02-18T19:29:15.559219812Z"
resource: {
labels: {
action_id: "SMART_HOME_SYNC"
project_id: "ha-dobri"
version_id: ""
}
type: "assistant_action"
}
severity: "ERROR"
textPayload: "SYNC: Request ID 5382562719730738198 update devices failed: RESOURCE_EXHAUSTED"
timestamp: "2025-02-18T19:29:15.554023284Z"
}

I should also mention that on the project page, in "Project details" there is:

Image

@marksteward
Copy link

marksteward commented Feb 18, 2025

You don't need to certify your integration, so don't worry about that. That's Google's API "please back off" error, so maybe try giving it an hour, and check if your API usage seems high when that updates on the dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests