Steps to Configure Google Assistant through the Google Home Developer Console

Manual Google Assistant needs new setup instructions · Issue #35867 · home-assistant/home-assistant.io · GitHub

Aquí tienes el texto formateado con el código y configuraciones adecuadamente marcados como código para publicarlo en el foro:

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

• Go to the Google Home Developer Console at console.home.google.com.

• Click on Create Project.

• Enter a name for the project and click Create Project.

• Save your Project ID for later use.

  1. 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.

  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.

  1. 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.

  1. 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.

  1. 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.

  1. Configure Specific Entities (Optional)

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

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”

  1. Final Check

• Go to Configuration > Server Controls and click on Check Configuration to ensure everything is correct.

• If everything is fine, restart Home Assistant.

  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.

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.

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

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

  3. Enable the Support for Local Queries option.

  4. 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.

  1. Save the changes.

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

  3. Test by saying “OK Google, sync my devices”.

References:

• Google Assistant & Home Assistant Integration: Official Documentation.

Con este formato, los bloques de código estarán bien distinguidos para una mejor legibilidad en el foro.

4 Likes

Thanks a lot for this thread. I think i manage to follow everything. In the Developer Console the project is in Draft state. Is that OK ?

I’m not sure everything is set up, for now as i can’t see any new device or still can’t manage anything on my Google Home.

Yes, it’s completely normal for your project to be in Draft state. To make it public, you’d need to submit it for review, but that’s not necessary since you’re only using it for personal purposes. The Draft state won’t affect your ability to integrate with Google Home for your own setup.

As for the devices not appearing in Google Home, they will only show up after you’ve completed steps 6 and 7. Specifically:
• Ensure you’ve configured the exposed devices in the configuration.yaml file. Without specifying which devices to expose, they won’t show up in Google Home.

Also, don’t forget to do the following in the Google Home app:
1. Go to the Devices section.
2. Tap on + Add, then scroll down to Works with Google.
3. In the list of services, look for [test] your_project_name (it should appear with the name you gave your project).

Remenber “Ok Google, sync my devices”

Let me know how it goes!

Thanks for your answer. I found it ! But it says it can’t reach my home assistant instance. I think it is proxy issue. I will come back once it’s solved

• Click on Analytics in the left menu and go to APIs & Services.

  1. Enable Device Synchronization

i cant see this?
4. Enable Device Synchronization

==> 4. Enable Device Synchronization ==> It’s the name of the chapter with the instructions are under this lines ^^

it tooks me 15 minutes to understand ^^

Just follow the next step

I’m back and i still get the same issue. I removed the proxy and get the same message so it’s not a proxy issue as i tought

Enregistreur: homeassistant.components.http.ban
Source: components/http/ban.py:136
intégration: HTTP (documentation, problèmes)
S'est produit pour la première fois: 18:32:55 (1 occurrences)
Dernier enregistrement: 18:32:55

Login attempt or request with invalid authentication from rate-limited-proxy-108-177-64-3.google.com (108.177.64.3). Requested URL: '/auth/token'. (OpenAuth)

But no ip ban.yaml.

May be i made a mistake in the the integration of the service account


google_assistant:
    service_account: !include /config/SERVICE_ACCOUNT.json
    project_id: "ha-on-ga"
    report_state: true # This allows syncing the state with Google Home
    expose_by_default: false # Do not expose all entities automatically
    exposed_domains: shutter

Other error found in logs

Enregistreur: homeassistant.components.google_cloud.tts
Source: components/google_cloud/tts.py:100
intégration: Google Cloud (documentation, problèmes)
S'est produit pour la première fois: 18:44:20 (1 occurrences)
Dernier enregistrement: 18:44:20

Error from calling list_voices: 403 Cloud Text-to-Speech API has not been used in project 371351860596 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=371351860596 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry. [links { description: "Google developers console API activation" url: "https://console.developers.google.com/apis/api/texttospeech.googleapis.com/overview?project=371351860596" } , reason: "SERVICE_DISABLED" domain: "googleapis.com" metadata { key: "service" value: "texttospeech.googleapis.com" } metadata { key: "consumer" value: "projects/371351860596" } ]

Can i active it without been charged thousands dollars / month ? :sweat_smile: