Integrating Home Assistant with Google Assistant: Seamless Voice Control for Your Smart Home

NGC 224
DIY Smart Home Creator
Introduction: Why Integrate Google Assistant with Home Assistant?
Integrating Home Assistant with Google Assistant brings the power of voice control to your entire smart home ecosystem. Home Assistant acts as a central hub, connecting devices from various manufacturers that might not natively support Google Assistant. By linking Home Assistant to Google Assistant, you can use voice commands via Google Home speakers, Nest Hubs, or the Google Assistant app on your phone to control lights, switches, thermostats, locks, and more, regardless of their original brand. This integration simplifies control and allows you to build complex voice-activated automations.
Prerequisites
Before you begin, ensure you have:
- A running Home Assistant instance (either Home Assistant OS, Supervised, Container, or Core).
- A Google Account.
- A stable network connection for both your Home Assistant device and Google Assistant devices.
Depending on your chosen integration method, you may also need a Nabu Casa subscription or a publicly accessible Home Assistant instance with SSL encryption.
Method 1: Home Assistant Cloud (Recommended)
The easiest and most reliable way to integrate Home Assistant with Google Assistant is through the Home Assistant Cloud service (powered by Nabu Casa). This service simplifies the process by handling the complex networking and security requirements for you, providing secure remote access and seamless voice assistant integration.
Setup Steps (Home Assistant Cloud):
- Subscribe to Home Assistant Cloud: If you haven't already, subscribe to Home Assistant Cloud. This directly supports the development of Home Assistant.
- Enable Google Assistant Integration: In Home Assistant, go to Settings -> Home Assistant Cloud. Ensure the Google Assistant toggle is enabled under the "Integrations" section.
- Configure Exposed Entities: Click "Manage Assistant" next to the Google Assistant toggle. Here, you can select which domains (like lights, switches, sensors) or specific entities you want to expose to Google Assistant. By default, some domains might be exposed. It's best practice to expose only the devices you actually want to control or query via voice. You can use the "Expose by default" setting and then override it with specific includes/excludes.
- Sync Devices: On the same Cloud configuration page, click the "Sync entities" button. This pushes the list of exposed devices from Home Assistant to Google Assistant.
- Link Accounts in Google Home App: Open the Google Home app on your smartphone or tablet. Tap the '+' icon -> "Set up device" -> "Works with Google Home". Search for "Home Assistant". Select it and log in using your Home Assistant Cloud account credentials.
Once linked, Google Assistant will discover the entities you exposed. You can assign them to rooms within the Google Home app.
Pros of Home Assistant Cloud:
- Extremely simple setup.
- No need for dynamic DNS, port forwarding, or SSL certificates.
- Automatic real-time device state updates in Google Assistant.
- Supports advanced features like Trait and Type reporting.
- Reliable and maintained by the Home Assistant developers.
Cons of Home Assistant Cloud:
- Requires a paid subscription.
Method 2: Manual Setup (Actions on Google)
For users who prefer not to use Home Assistant Cloud, it's possible to integrate directly using Google's Actions on Google platform. This method requires more technical expertise and setup, including making your Home Assistant instance securely accessible from the internet.
Prerequisites for Manual Setup:
- A domain name and Dynamic DNS (DDNS) or static public IP address pointing to your network.
- SSL certificate for secure HTTPS access to your Home Assistant instance (e.g., using DuckDNS and Let's Encrypt add-ons).
- Port forwarding configured on your router to direct external traffic on port 443 (or chosen HTTPS port) to your Home Assistant internal IP address.
- A Google Cloud Platform account.
Setup Steps (Manual):
- Secure Public Access: Ensure your Home Assistant is accessible from the internet via HTTPS with a valid SSL certificate (e.g.,
https://your_domain.duckdns.org
). This is a critical security step. - Create Google Cloud Project: Go to the Google Cloud Console and create a new project.
- Create Actions Project: Go to the Actions on Google Console, select your new project, and create a new project of type "Smart Home".
- Configure Fulfillment: In the Actions console, under "Develop" -> "Actions", set the Fulfillment URL to your Home Assistant's external URL followed by
/api/google_assistant
(e.g.,https://your_domain.duckdns.org/api/google_assistant
). - Configure Account Linking: Still in the Actions console, under "Develop" -> "Account linking", configure OAuth 2.0 Implicit flow. The Client ID is
https://oauth-redirect.googleusercontent.com/r/YOUR_PROJECT_ID
(replaceYOUR_PROJECT_ID
with the ID from your Google Cloud project). The Authorization URL ishttps://your_home_assistant_url/auth/authorize
and the Token URL ishttps://your_home_assistant_url/auth/token
. - Configure Home Assistant: Add the
google_assistant:
integration to yourconfiguration.yaml
file. Specify the project ID from the Google Cloud project. Define which entities to expose (similar to the Cloud method usingexpose_by_default
andentity_config
).
google_assistant:
project_id: YOUR_PROJECT_ID
service_account: !include google_service_account.json # See Google documentation for this
expose_by_default: false
entity_config:
light.living_room_lamp:
name: Living Room Lamp
expose: true
room: Living Room
switch.bedroom_fan:
expose: true
- Sync Devices: Use the Home Assistant service
google_assistant.request_sync
(you can call this from Developer Tools -> Services) after making configuration changes. - Test Draft Project: In the Actions console, go to "Test" and enable testing on device.
- Link Accounts in Google Home App: Similar to the Cloud method, use "Works with Google Home" in the Google Home app, search for your Action project name (it will appear as `[test] Your Project Name`), and link your Home Assistant account.
Pros of Manual Setup:
- No recurring subscription cost (beyond domain/DDNS if applicable).
- Full control over the integration configuration.
Cons of Manual Setup:
- Complex initial setup requiring networking and cloud platform knowledge.
- Requires maintaining external access and SSL certificates.
- State updates in Google Assistant may not be as instantaneous as with Home Assistant Cloud (relies on Google polling).
- Troubleshooting can be more challenging.
Exposing Entities and Naming Conventions
Whether using Cloud or Manual setup, carefully managing which entities are exposed is crucial. Exposing too many can clutter your Google Home app and confuse voice commands. Use the expose_by_default
setting and granular entity_config
to control visibility.
Naming is key! Google Assistant relies heavily on entity names. Use clear, simple, and descriptive names for your devices in Home Assistant that are easy to say and for Google to understand (e.g., "Living Room Overhead Light" instead of "light.lvr_oh_lgt"). You can define friendly names and assign devices to rooms in Home Assistant or the Google Home app.
Device Types and Traits
Home Assistant automatically maps many common entity types (like light
, switch
, media_player
, thermostat
) to corresponding Google Assistant device types and traits (like action.devices.types.LIGHT
, action.devices.traits.OnOff
, action.devices.traits.Brightness
). Ensure your entities in Home Assistant have the correct device_class
set where applicable (e.g., switch
entities configured with device_class: outlet
will appear as outlets in Google Home). For more complex entities, you might need to manually configure the type
and traits
in the entity_config
section of your Google Assistant integration settings.
Best Practices for a Reliable Integration
- Stable Home Assistant: Ensure your Home Assistant instance is running on reliable hardware with a stable power supply and network connection.
- Stable Network: A robust Wi-Fi network is essential for communication between Google Assistant devices and Home Assistant.
- Descriptive Naming: Use clear, natural language names for entities you expose. Assign them to rooms.
- Limit Exposure: Only expose entities you intend to control or query via voice. Avoid exposing sensitive devices or internal helpers that don't map well to Google Assistant traits.
- Regular Syncing: After adding new devices or changing entity names/configurations that affect the Google Assistant integration, remember to trigger a sync (automatic with Cloud, manual service call for manual setup).
- Monitor Logs: Check the Home Assistant logs for any errors related to the Google Assistant integration. The Google Home app also has an Activity section that shows recognized commands and successful/failed actions.
- Keep Updated: Ensure your Home Assistant installation and the Google Assistant integration are kept up-to-date.
Troubleshooting Common Issues
- Devices Not Appearing: Check if the entities are correctly exposed in Home Assistant's Google Assistant settings. Ensure you have triggered a device sync and linked the correct account in the Google Home app.
- Commands Not Working: Verify the entity name and room name you are using in the voice command match the configured device in Home Assistant/Google Home. Check Home Assistant logs and Google Home activity for errors. Ensure the entity is controllable (e.g., trying to 'turn on' a sensor won't work).
- Sync Errors: For manual setup, verify your external URL is correct and accessible, and your SSL certificate is valid. Check Home Assistant logs for API errors communicating with Google. With Cloud, sync errors are less common but can sometimes be resolved by relinking the account.
Conclusion
Integrating Home Assistant with Google Assistant is a powerful step towards a truly voice-controlled smart home. While the manual setup offers flexibility for advanced users, Home Assistant Cloud provides a significantly simpler and more reliable experience for most. By carefully selecting which devices to expose, using clear naming conventions, and following best practices, you can create a seamless and responsive voice interface for your entire smart home ecosystem, making interaction effortless and intuitive.

NGC 224
Author bio: DIY Smart Home Creator