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:
- 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.
- 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.
- Finalize the Setup
• After saving, your project will appear in Draft status.
• Click on Analytics in the left menu and go to APIs & Services.
- 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.
- 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.
- 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.
- 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”
- Final Check
• Go to Configuration > Server Controls and click on Check Configuration to ensure everything is correct.
• If everything is fine, restart Home Assistant.
- 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:
- 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.
-
In the Actions section, select Upload JavaScript files.
-
Download app.js from the provided source and import it for both Node.js and Chrome.
-
Enable the Support for Local Queries option.
-
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.
-
Save the changes.
-
Wait 30 minutes or restart all your Google Assistant devices.
-
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.