Google Gemini
The Google Gemini integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] adds a conversation agent, speech-to-text, and text-to-speech entities powered by Google Gemini to Home Assistant. The conversation agent can optionally be allowed to control Home Assistant.
Controlling Home Assistant is done by providing the AI access to the Device control set of tools. You can control what devices and entities it can access from the exposed entities page. The AI can provide you information about your devices and control them.
This integration does not integrate with sentence triggers.
This integration requires an API key to use, which you can generate here, and to be in one of the available regions.
Configuration
To add the Google Gemini service to your Home Assistant instance, use this My button:
Manual configuration steps
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your Home Assistant instance.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select Google Gemini.
-
Follow the instructions on screen to complete the setup.
Generate an API Key
The API key is used to authenticate requests to the Google Gemini API. To generate an API key take the following steps:
- Visit the API Keys page to retrieve the API key you’ll use to configure the integration.
On the same page, you can see your plan: free of charge if the associated Google Cloud project doesn’t have billing, or pay-as-you-go if the associated Google Cloud project has billing enabled. Comparison of the plans is available at this pricing page. The major differences include: the free of charge plan is rate limited, and free prompts/responses are used for product improvement.
Options
To define options for Google Gemini, follow these steps:
-
In Home Assistant, go to Settings > Devices & services.
-
If multiple instances of Google Gemini are configured, choose the instance you want to configure.
-
On the card, select the cogwheel
. - If the card does not have a cogwheel, the integration does not support options for this service.

-
Edit the options, then select Submit to save the changes.
Instructions for the AI on how it should respond to your requests. It is written using Home Assistant Templating.
Device control only accesses the entities you expose to voice assistants. Home Assistant accesses everything and only works for administrators, not voice assistant devices.
If you choose to not use the recommended settings, you can configure the following options:
Creativity allowed in the responses for models that support custom sampling. Higher values produce a more random and varied response.
Probability threshold for top-p sampling. This setting applies only to models that support custom sampling.
Number of top-scored tokens to consider during generation. This setting applies only to models that support custom sampling.
The maximum number of words or “tokens” that the AI model should generate.
The token budget for internal reasoning before the model generates a response (Gemini 2.5 models only). Set this to -1 to let the model decide automatically, 0 to disable reasoning (not available for Gemini 2.5 Pro), or a positive number for a custom budget.
The level of internal reasoning for Gemini 3 and later text models, including the latest text aliases. You can select Minimal, Auto, Low, Medium, or High. Minimal is unavailable on Pro models, the latest text aliases, and Gemini 3.6 and later models, except Gemini 3.6 Flash (not Flash-Lite). If your selected level is unsupported, the integration uses the model default and keeps your saved choice. For example, Gemini 3.8 uses the model default when you select Minimal. Gemini 2.5 models use the thinking budget instead.
Thresholds for different harmful categories.
Enables the model to query Google Search. This can only be enabled when nothing is selected in AI tools. See below for a workaround to use it with Device control.
Temperature, top-p, and top-k apply to Gemini models with numeric versions before 3.6, except Gemini 3.5 Flash-Lite and Gemini 3.5 Transcribe. They also apply to Gemini Robotics-ER 1.6 and non-Gemini models. For other Gemini models, including the latest text aliases, the integration omits these settings from requests and uses the model defaults. Your saved values remain available when you switch back to a model that supports custom sampling. An unrecognized older Gemini model may use its defaults instead of your saved values.
For text-to-speech, the same model-specific behavior applies to temperature. Thinking settings apply to supported text models. Switching models keeps your saved settings, while selecting the recommended settings resets the configurable options.
Google Search
Due to an API limitation we cannot have the Google Search tool together with other tools. Request fails with 400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'Tool use with function calling is unsupported', 'status': 'INVALID_ARGUMENT'}}.
But you can do the following workaround that exposes a script to voice assistants. The script calls a Google Gemini Conversation that only has the Google Search tool enabled.
Workaround for Google Search tool
-
Add a second Google Gemini conversation agent.
-
Select Configure
-
In AI tools, uncheck Device control and any other options.
-
Uncheck Recommended model settings
-
Select Submit
-
Check Enable Google Search tool
-
Increase Maximum tokens to return in response
-
Select Submit
-
Create a script (Settings > Automations & scenes > Scripts > Create script)
-
Select 3 dots > Edit in YAML and enter the following (edit the
conversation.google_generative_ai_2to match the entity created from the 1st step):sequence: - action: conversation.process metadata: {} data: agent_id: conversation.google_generative_ai_2 text: "{{ query }}" response_variable: result - variables: result: response: "{{ result.response.speech.plain.speech }}" - stop: "" response_variable: result alias: "Assist: Search Google" description: >- Uses Google Search to answer questions that are completely unrelated to the smart home, and focus on current events or information in real time, such as the current president, last night's game results, or release dates. fields: query: selector: text: null name: Query description: The query to search Google for required: true -
Select Save script
-
Select 3 dots > Settings > Voice assistants
-
Check Expose Assist
Using Google Gemini text-to-speech in automations
The Google Gemini integration adds a text-to-speech entity. To play a spoken message from an automation or script, use the Speak action and select your Google Gemini text-to-speech entity as the target.
To speak a message from an automation or a script:
- Go to Settings > Automations & scenes.
- Open an existing automation or script, or select Create automation > Create new automation.
- If you are setting up a new automation, add a trigger in the When section. Scripts do not need a trigger. They run when something else calls them.
- In the Then do section, select Add action.
- Select what you want to control. Under By target, select your Google Gemini text-to-speech entity.
- From the actions shown for that target, select Speak. To choose a Gemini voice, set
voicein Options. For supported options, see Google Gemini text-to-speech action options. - Select the Media player entity to play the message on, set the Message, and set any other options you want to use.
- Select Save.
Example YAML configuration
action: tts.speak
target:
entity_id: tts.google_ai_tts
data:
media_player_entity_id: media_player.living_room
message: "Say cheerfully: Have a wonderful day!"
options:
voice: achernar
Google Gemini text-to-speech action options
Configuration Variables
The voice name to use for the generated speech. The default is zephyr. For available voices, see the Google AI speech generation documentation.
Google Gemini detects the input language automatically. For supported languages, see the Google AI speech generation documentation.
Talking to Super Mario
You can use Google Gemini to follow the Super Mario voice assistant tutorial and let him control devices in your home.
The tutorial uses OpenAI, but you can follow the same approach with the Google Gemini integration.
Video tutorial
This video tutorial explains how Google Gemini can be set up, how you can send an AI-generated message to your smart speaker when you arrive home, and how you can analyze an image taken from your doorbell camera as soon as someone rings the doorbell.
Troubleshooting
- To aid in diagnosing issues it may help to turn up verbose logging by adding these to your
configuration.yamlThe configuration.yaml file is the main configuration file for Home Assistant. It lists the integrations to be loaded and their specific configurations. In some cases, the configuration needs to be edited manually directly in the configuration.yaml file. Most integrations can be configured in the UI. [Learn more]:
logger:
logs:
homeassistant.components.conversation: debug
homeassistant.components.conversation.chat_log: debug
homeassistant.components.google_generative_ai_conversation: debug
Removing the integration
To remove an integration instance from Home Assistant
- Go to Settings > Devices & services and select the integration card.
- Next to the entry you want to remove, select the three dots
menu. Then, select Delete. - Depending on the integration, the entries are listed under one of the following headings:
- Devices
- Hubs
- Services
- Integration entries
- Depending on the integration, the entries are listed under one of the following headings:
- To confirm, select Delete.
- Home Assistant also deletes the devices and entities of the entry.
- If Home Assistant asks you to restart, restart Home Assistant.
- If Home Assistant asks whether to also delete the application credentials, select Remove or Keep.
- If you keep them, Home Assistant uses them automatically when you add the integration again.
- To delete them later, refer to Deleting application credentials.