LLM

The LLM integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides the AI toolsA function that conversation agents and AI apps can use to read information, control entities, or manage Home Assistant. AI tools are grouped into sets. Each set provides different functionality. Some sets only work for administrators. [Learn more] in Home Assistant. An AI tool is a function that conversation agentsSoftware that Home Assistant uses to understand a request and decide what to do. Home Assistant has a built-in conversation agent. Integrations can add others, including ones that use AI. Conversation agents that use AI can also use AI tools. Each assistant uses a conversation agent. [Learn more] and AI appsThird-party software that connects to Home Assistant through the Model Context Protocol integration. An AI app can use the AI tools that you allow. [Learn more] can use to read information, control entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more], or manage Home Assistant. For example, with AI tools, a conversation agent can tell you the temperature in the living room, turn on your lights, or reload an integration that failed to set up.

The AI tools are grouped into sets. You choose which sets each conversation agent can use, in its AI tools option. AI apps outside Home Assistant can use the same sets through the Model Context Protocol integration.

The LLM integration is an internal system integration. It loads as part of the default configuration. Every AI integration that adds a conversation agent loads it too. You can’t add or remove it, and it has no options.

Sets of AI tools

Each set contains related AI toolsA function that conversation agents and AI apps can use to read information, control entities, or manage Home Assistant. AI tools are grouped into sets. Each set provides different functionality. Some sets only work for administrators. [Learn more]. Home Assistant has two built-in sets:

  • Device control: Reads and controls the entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] you expose to voice assistants. For example, it can check the bedroom temperature or turn off the kitchen light. Any user can use it.
  • Home Assistant: Looks into and manages Home Assistant itself. For example, it can read the logs, look up past sensor values, or reload an integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] that failed to set up. It can reach all of Home Assistant, not only exposed entities. Only administrators can use it.

On this page, the tools in the Home Assistant set are called the Home Assistant AI tools.

Integrations can add more sets. For example, KNX adds a KNX set, and the Model Context Protocol Client adds a set for each server that you connect.

You choose the sets in the AI tools option of each conversation agentSoftware that Home Assistant uses to understand a request and decide what to do. Home Assistant has a built-in conversation agent. Integrations can add others, including ones that use AI. Conversation agents that use AI can also use AI tools. Each assistant uses a conversation agent. [Learn more]. For example, Anthropic, Google Gemini, Ollama, and OpenAI have this option. A new conversation agent starts with Device control only. In Ollama, it starts with no sets.

Important

Risk of unintended device actions

The Home Assistant set of AI tools can control every entity and change Home Assistant itself. It doesn’t ask you before it acts. It also isn’t limited to the entities that you expose to voice assistants. If the conversation agent misunderstands a request, it can turn off devicesA device is a model representing a physical or logical unit that contains entities. or change settings that you didn’t intend to change.

To avoid this:

  • Only select the Home Assistant set for a conversation agent that you use to manage Home Assistant.

  • For everyday voice control, use a separate assistantA configuration of Assist with its own name, language, and conversation agent. An assistant can also use speech-to-text to understand spoken commands and text-to-speech to reply out loud. whose conversation agent only uses Device control. For the steps, refer to Setting up a separate assistant for the Home Assistant AI tools.

What the Home Assistant AI tools can reach

The Home Assistant AI toolsA function that conversation agents and AI apps can use to read information, control entities, or manage Home Assistant. AI tools are grouped into sets. Each set provides different functionality. Some sets only work for administrators. [Learn more] can read the state of every entity, the status of your integrationsIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more], your logs, and the history of your sensors. For the full list, refer to List of Home Assistant AI tools.

Most of the Home Assistant AI tools only read. Two tools can change things:

  • Call action can perform any actionAn action makes Home Assistant do something, for example, turn on a light, send a notification, or activate a scene. Automations and scripts run a list of actions. [Learn more] in Home Assistant, on any entity, device, or area. This includes entities that you didn’t expose. For example, it can turn off a light, run a script, or restart Home Assistant.
  • Reload config entry can reload an integration.

Who can use the Home Assistant AI tools

Only administrators can use the Home Assistant AI toolsA function that conversation agents and AI apps can use to read information, control entities, or manage Home Assistant. AI tools are grouped into sets. Each set provides different functionality. Some sets only work for administrators. [Learn more]. Home Assistant checks the user account that each request comes from. When you talk to a conversation agentSoftware that Home Assistant uses to understand a request and decide what to do. Home Assistant has a built-in conversation agent. Integrations can add others, including ones that use AI. Conversation agents that use AI can also use AI tools. Each assistant uses a conversation agent. [Learn more] in AssistThe voice assistant built into Home Assistant. You can use Assist by talking or typing in the Home Assistant web interface and in the Home Assistant Companion app. You can also use it by talking through a voice satellite. You can set up several assistants, each with its own language and conversation agent. [Learn more] in Home Assistant or in the Home Assistant Companion appThe official Home Assistant app for Android and Apple devices. On phones, tablets, and Macs, it shows your Home Assistant interface, like a browser does. It can also share data from your device’s sensors with Home Assistant and receive notifications. The Home Assistant Companion app also works on smartwatches and in cars, with Android Auto, Android Automotive OS, or Apple CarPlay. [Learn more], the request comes from the user account that is signed in.

A voice satelliteA standalone device with a microphone that you use to talk to Assist. Some voice satellites also have a speaker to play Assist’s replies. Unlike a browser or the Home Assistant Companion app, a voice satellite isn’t signed in to a user account. This means Home Assistant can’t tell who is speaking. Each voice satellite uses at least one assistant. isn’t signed in to a user account. For example, Home Assistant Voice Preview Edition is a voice satellite. Its requests don’t belong to any user. If its conversation agent has the Home Assistant set selected, every request from the voice satellite fails. This also stops Device control on that conversation agent. This means the voice satellite can’t turn on a light either. Requests from users who aren’t administrators fail the same way.

Adding the Home Assistant AI tools to your conversation agent

Use this procedure if only administrators use your conversation agentSoftware that Home Assistant uses to understand a request and decide what to do. Home Assistant has a built-in conversation agent. Integrations can add others, including ones that use AI. Conversation agents that use AI can also use AI tools. Each assistant uses a conversation agent. [Learn more]. Afterwards, you can ask it why an integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] isn’t working, or which errors are in the logs. The conversation agent then no longer works for voice satellitesA standalone device with a microphone that you use to talk to Assist. Some voice satellites also have a speaker to play Assist’s replies. Unlike a browser or the Home Assistant Companion app, a voice satellite isn’t signed in to a user account. This means Home Assistant can’t tell who is speaking. Each voice satellite uses at least one assistant. or for users who aren’t administrators. For details, refer to Who can use the Home Assistant AI tools.

Prerequisites:

  • An administrator account in Home Assistant.
  • A conversation agent from an AI integration. For example, OpenAI adds conversation agents.

To add the Home Assistant AI toolsA function that conversation agents and AI apps can use to read information, control entities, or manage Home Assistant. AI tools are grouped into sets. Each set provides different functionality. Some sets only work for administrators. [Learn more] to your conversation agent:

  1. Go to Settings > Devices & services, and select your AI integration.
    • For example, select OpenAI.
  2. In the row of the conversation agent, select Reconfigure conversation agent .
    • The right row shows Conversation agent under the name. For example, OpenAI calls it OpenAI Conversation.
    • Don’t use the rows below it. They show its devices.
    • Some integrations call this button Configure.
  3. Under AI tools, select Home Assistant.
    • To keep controlling your devices, leave Device control selected.
  4. Select Submit. If the dialog shows more options, select Submit again.
    • Result: The conversation agent can use the Home Assistant AI tools the next time you talk to it.

Setting up a separate assistant for the Home Assistant AI tools

Use this procedure if voice satellitesA standalone device with a microphone that you use to talk to Assist. Some voice satellites also have a speaker to play Assist’s replies. Unlike a browser or the Home Assistant Companion app, a voice satellite isn’t signed in to a user account. This means Home Assistant can’t tell who is speaking. Each voice satellite uses at least one assistant. or users who aren’t administrators use your assistantA configuration of Assist with its own name, language, and conversation agent. An assistant can also use speech-to-text to understand spoken commands and text-to-speech to reply out loud.. Your current assistant stays as it is for them. You get a second assistant that you can ask why an integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] isn’t working. For details, refer to Who can use the Home Assistant AI tools.

Prerequisites:

  • An administrator account in Home Assistant.
  • An AI integration that adds conversation agents. For example, OpenAI adds them.

To set up a separate assistant for the Home Assistant AI tools:

  1. Go to Settings > Devices & services, and select your AI integration.
    • For example, select OpenAI.
  2. Select Add conversation agent.
  3. Under Name, enter a name for the new conversation agent.
    • For example, enter Home Assistant helper.
  4. Under AI tools, select Home Assistant.
    • To also control your devices with it, leave Device control selected.
  5. Select Submit. If the dialog shows more options, select Submit again.
  6. Go to Settings > Voice assistants, and select Add assistant.
  7. Enter a name for the assistant. Under Conversation agent, select the conversation agent that you just added.
  8. Select Create.
  9. To use the new assistant, open the Assist dialog. At the top, select the name of the current assistant, and then select the new assistant.
    • Result: The new assistant can use the Home Assistant AI tools in the Assist dialog of Home Assistant and of the Home Assistant Companion appThe official Home Assistant app for Android and Apple devices. On phones, tablets, and Macs, it shows your Home Assistant interface, like a browser does. It can also share data from your device’s sensors with Home Assistant and receive notifications. The Home Assistant Companion app also works on smartwatches and in cars, with Android Auto, Android Automotive OS, or Apple CarPlay. [Learn more]. This works when you’re signed in with an administrator account.

Supported functionality

List of Home Assistant AI tools

You don’t call these tools yourself. When you ask the conversation agentSoftware that Home Assistant uses to understand a request and decide what to do. Home Assistant has a built-in conversation agent. Integrations can add others, including ones that use AI. Conversation agents that use AI can also use AI tools. Each assistant uses a conversation agent. [Learn more] something, it decides which tools to call. You can’t select single tools. You give the conversation agent the entire set, as described in Adding the Home Assistant AI tools to your conversation agent.

The Home Assistant set of AI toolsA function that conversation agents and AI apps can use to read information, control entities, or manage Home Assistant. AI tools are grouped into sets. Each set provides different functionality. Some sets only work for administrators. [Learn more] contains the following tools. Each entry starts with the title of the tool, followed by its ID. The AssistThe voice assistant built into Home Assistant. You can use Assist by talking or typing in the Home Assistant web interface and in the Home Assistant Companion app. You can also use it by talking through a voice satellite. You can set up several assistants, each with its own language and conversation agent. [Learn more] dialog shows the ID under Show details. Many tools do something that you can also do yourself in the UI, without a conversation agent. Where you can, the entry says how. For example, you can check what the conversation agent tells you.

  • Render template (homeassistant__render_template): Renders a template and returns the result. Templates can read the state and attributes of all entitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more]. Only reads.
  • Search actions (homeassistant__search_actions): Finds the actionsAn action makes Home Assistant do something, for example, turn on a light, send a notification, or activate a scene. Automations and scripts run a list of actions. [Learn more] that Home Assistant can perform, with their targets and fields. Only reads.
  • Call action (homeassistant__call_action): Performs an action, and returns its response if it has one. Changes things.
    • To do this yourself: Use the Actions tab, under Settings > Tools > Actions.
    • To see which actions the conversation agent performed: Go to Settings > Tools > Action history.
  • Get config entries (config__get_config_entries): Lists the integrationsIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] and helpers that are set up, with their status, such as loaded or failed to set up, and the reason for an error. It can filter by integration and by status. Only reads.
  • Reload config entry (config__reload_config_entry): Reloads an integration that is set up. For example, it helps after a temporary connection error. Changes things.
  • Search available integrations (config__search_integrations): Searches the integrations and helpers that you can set up from the UI, including ones that you haven’t added yet. Only reads.
  • Search Home Assistant (search__search): Finds entities, devices, areas, labels, automations, scripts, and scenes by name. Only reads.
  • Get system info (system_health__get_system_info): Returns the installation type, the CPU architecture, the time zone, and the versions of Home Assistant Core, the frontend, Python, the operating system, and the Supervisor. For example, you can use it to fill in a bug report. Only reads.
  • Get history (history__get_history): Returns statistics of entities, not their individual state changes. For example, it can return the mean, minimum, and maximum temperature per 5 minutes or per hour. It only works for entities with statistics, such as sensors with a state class. Only reads.
    • To do this yourself: Use the History panel.
  • Get system log entries (system_log__get_entries): Returns recent errors and warnings from the system log. It doesn’t include info or debug messages. It can filter by level and by integration. Only reads.
  • Get logs (system_log__get_logs or hassio__get_logs): Reads the full logs in a time window. This includes info and debug messages, if Home Assistant logs them. Values that look like credentials are masked. Only reads.
    • On Home Assistant Operating SystemHome Assistant OS, the Home Assistant Operating System, is an embedded, minimalistic, operating system designed to run the Home Assistant ecosystem on single board computers (like the Raspberry Pi) or Virtual Machines. It includes Home Assistant Core, the Home Assistant Supervisor, and supports apps. Home Assistant Supervisor keeps it up to date, removing the need for you to manage an operating system. Home Assistant Operating System is the recommended installation type for most users. and Home Assistant SupervisedThe Home Assistant Supervised installation type is a full UI managed home automation ecosystem that runs the Home Assistant Core program, the Home Assistant Supervisor and apps. It comes pre-installed on Home Assistant OS, but can be installed standalone on Debian Linux systems. It leverages Docker, which is managed by the Home Assistant Supervisor. The Home Assistant Supervised installation type is deprecated. installations, the ID is hassio__get_logs. It also reads the logs of the Supervisor, the operating system, the DNS, audio, and multicast plugins, and your apps.
    • On Home Assistant ContainerHome Assistant Container is a standalone container-based installation of Home Assistant Core. Any OCI compatible runtime can be used, but the documentation focus is on Docker. [Learn more] installations, and on other installations without the Supervisor, the ID is system_log__get_logs. It only reads the Home Assistant log, and it needs the log file.
    • To do this yourself: Under Settings > System > Logs, select Menu > Show raw logs.
  • Get date and time (llm__GetDateTime): Returns the current date and time. Both built-in sets of AI tools, Device control and Home Assistant, have this tool. Only reads.

Known limitations

Access to AI tools

  • Only administrators can use the Home Assistant AI toolsA function that conversation agents and AI apps can use to read information, control entities, or manage Home Assistant. AI tools are grouped into sets. Each set provides different functionality. Some sets only work for administrators. [Learn more]. Requests without an administrator account fail. For example, requests from a voice satelliteA standalone device with a microphone that you use to talk to Assist. Some voice satellites also have a speaker to play Assist’s replies. Unlike a browser or the Home Assistant Companion app, a voice satellite isn’t signed in to a user account. This means Home Assistant can’t tell who is speaking. Each voice satellite uses at least one assistant. fail, and so do requests from users who aren’t administrators. This also stops Device control on that conversation agentSoftware that Home Assistant uses to understand a request and decide what to do. Home Assistant has a built-in conversation agent. Integrations can add others, including ones that use AI. Conversation agents that use AI can also use AI tools. Each assistant uses a conversation agent. [Learn more], because the agent can’t prepare any of its sets of AI tools.
  • The Home Assistant Cloud conversation agent of Home Assistant Cloud can’t use the Home Assistant AI tools. It always uses Device control.

Entity history

  • Get history returns statistics, not individual state changes. EntitiesAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more] without statistics have no history for this tool. For example, a switch has no statistics, and neither does a sensor without a state class. For how statistics work, refer to Long-term statistics.

Logs and credentials

  • In Home Assistant ContainerHome Assistant Container is a standalone container-based installation of Home Assistant Core. Any OCI compatible runtime can be used, but the documentation focus is on Docker. [Learn more] installations, and in other installations without the Supervisor, Get logs needs the Home Assistant log file. If Home Assistant doesn’t write a log file, this tool isn’t available. For example, the HA_DISABLE_LOG_FILE environment variable turns off the log file.
  • Get logs masks values that look like credentials, such as tokens, passwords, and API keys. It can’t recognize every credential, so other secrets in your logs can still reach the AI provider.

Troubleshooting

The conversation agent answers “Error preparing LLM API”

Symptom: “Error preparing LLM API”

When you talk to a conversation agentSoftware that Home Assistant uses to understand a request and decide what to do. Home Assistant has a built-in conversation agent. Integrations can add others, including ones that use AI. Conversation agents that use AI can also use AI tools. Each assistant uses a conversation agent. [Learn more], it doesn’t do what you asked. Instead, it answers “Error preparing LLM API”.

Description

The conversation agent couldn’t prepare its sets of AI toolsA function that conversation agents and AI apps can use to read information, control entities, or manage Home Assistant. AI tools are grouped into sets. Each set provides different functionality. Some sets only work for administrators. [Learn more]. This happens in the following situations:

  • The conversation agent has the Home Assistant AI tools, and the request doesn’t come from an administrator. For example, it comes from a voice satelliteA standalone device with a microphone that you use to talk to Assist. Some voice satellites also have a speaker to play Assist’s replies. Unlike a browser or the Home Assistant Companion app, a voice satellite isn’t signed in to a user account. This means Home Assistant can’t tell who is speaking. Each voice satellite uses at least one assistant., or from a user who isn’t an administrator. In this case, Device control doesn’t work on this conversation agent either.
  • A set of AI tools that the conversation agent uses no longer exists. For example, you removed the integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] that added it.

Resolution

The Home Assistant AI tools only work for administrators. You can’t make them available to other users or to voice satellites. If a voice satellite or a user who isn’t an administrator uses this conversation agent, remove the Home Assistant AI tools from it:

  1. Go to Settings > Devices & services, and select your AI integration.
  2. In the row of the conversation agent, select Reconfigure conversation agent .
    • In some integrations, this button is called Configure.
  3. Under AI tools, clear Home Assistant.
    • To keep controlling your devices with this conversation agent, make sure Device control is selected.
  4. Select Submit. If the dialog shows more options, select Submit again.
    • Result: The conversation agent controls your devices again, for everyone who uses it.

To keep using the Home Assistant AI tools yourself, set up a separate assistant for them. For the steps, refer to Setting up a separate assistant for the Home Assistant AI tools.

If you removed the integration that added a set of AI tools, open the settings of the conversation agent, as described in steps 1 and 2 above. Then, select Submit. If the dialog shows more options, select Submit again. The settings only show the sets of AI tools that still exist, so saving them removes the missing set.

Get history: “No statistics are recorded for this entity”

Symptom: The conversation agent can’t tell you the past values of an entity

You ask the conversation agentSoftware that Home Assistant uses to understand a request and decide what to do. Home Assistant has a built-in conversation agent. Integrations can add others, including ones that use AI. Conversation agents that use AI can also use AI tools. Each assistant uses a conversation agent. [Learn more] about the past values of an entityAn entity represents a sensor, actor, or function in Home Assistant. Entities are used to monitor physical properties or to control other entities. An entity is usually part of a device or a service. [Learn more], and it can’t answer. Under Show details in the AssistThe voice assistant built into Home Assistant. You can use Assist by talking or typing in the Home Assistant web interface and in the Home Assistant Companion app. You can also use it by talking through a voice satellite. You can set up several assistants, each with its own language and conversation agent. [Learn more] dialog, the result of history__get_history says “No statistics are recorded for this entity.”

Description

Get history only reads statistics, not individual state changes. Home Assistant only keeps statistics for entities that measure something over time, such as a temperature sensor or an energy meter. Other entities have no statistics. For example, a switch has none. For how statistics work, refer to Long-term statistics.

Resolution