Ollama Conversation
Documents a Home Assistant custom integration that adds an Ollama-powered conversation agent for querying house state, not for controlling devices.
What this file does
Documents a Home Assistant custom integration that adds an Ollama-powered conversation agent for querying house state, not for controlling devices.
When to use it
- You want a local LLM to answer questions about your Home Assistant devices and areas
- You already run Ollama and want to connect it to Home Assistant
- You need a conversation agent that works in automations but not as a sentence trigger
- You are configuring model parameters like temperature, context size, or mirostat settings
Assumes this stack
Ollama Conversation
The Ollama integration adds a conversation agent powered by Ollama in Home Assistant.
This conversation agent is unable to control your house. The Ollama conversation agent can be used in automations, but not as a sentence trigger. It can only query information that has been provided by Home Assistant. To be able to answer questions about your house, Home Assistant will need to provide Ollama with the details of your house, which include areas, devices and their states.
Note:
HACS does not "configure" the integration for you, You must add Ollama Conversation after installing via HACS.
- Browse to your Home Assistant instance.
- Go to Settings > Devices & Services.
- In the bottom right corner, select the Add Integration button.
- From the list, select Ollama Conversation.
- Follow the instructions on screen to complete the setup.
Options
Options for Ollama Conversation can be set via the user interface, by taking the following steps:
- Browse to your Home Assistant instance.
- Go to Settings > Devices & Services.
- If multiple instances of Ollama Conversation are configured, choose the instance you want to configure.
- Select the integration, then select Configure.
General Settings
Settings relating to the integration itself.
| Option | Description |
|---|---|
| API Timeout | The maximum amount of time to wait for a response from the API in seconds |
System Prompt
The starting text for the AI language model to generate new text from. This text can include information about your Home Assistant instance, devices, and areas and is written using Home Assistant Templating.
Model Configuration
The language model and additional parameters to fine tune the responses.
| Option | Description |
|---|---|
| Model | The model used to generate response. |
| Context Size | Sets the size of the context window used to generate the next token. |
| Maximum Tokens | The maximum number of words or “tokens” that the AI model should generate in its completion of the prompt. |
| Mirostat Mode | Enable Mirostat sampling for controlling perplexity. |
| Mirostat ETA | Influences how quickly the algorithm responds to feedback from the generated text. A lower learning rate will result in slower adjustments, while a higher learning rate will make the algorithm more responsive. |
| Mirostat TAU | Controls the balance between coherence and diversity of the output. A lower value will result in more focused and coherent text. |
| Temperature | The temperature of the model. A higher value (e.g., 0.95) will lead to more unexpected results, while a lower value (e.g. 0.5) will be more deterministic results. |
| Repeat Penalty | Sets how strongly to penalize repetitions. A higher value (e.g., 1.5) will penalize repetitions more strongly, while a lower value (e.g., 0.9) will be more lenient. |
| Top K | Reduces the probability of generating nonsense. A higher value (e.g. 100) will give more diverse answers, while a lower value (e.g. 10) will be more conservative. |
| Top P | Works together with top-k. A higher value (e.g., 0.95) will lead to more diverse text, while a lower value (e.g., 0.5) will generate more focused and conservative text. |
Discussions
Discussions for this integration over on Home Assistant Community
What's inside
1 setup guide, 1 options section with 3 subsections, 1 table of 10 model parameters, 1 discussion link
Change this for your project
- Replace
ej52/hass-ollama-conversationwith your own repository name if forking - Replace the discussion URL
https://community.home-assistant.io/t/custom-integration-ollama-conversation/636103with your own community thread
Where it goes
Use as the system prompt for your model call, or as the base instructions in your agent framework.
Worth borrowing
- Separating general settings, system prompt, and model configuration into distinct UI sections
- Using a table to document every model parameter with its effect and example values
Related Documents
Character Persona
Defines a Fallout 2 roleplay persona for an LLM agent: charming rogue with social-first combat and moral code.
Claude Tool Use (Function Calling) Documentation
Teaches how to define and use Claude tool use (function calling) with Python, including schema rules, execution patterns, and best practices.
coding: utf-8
Collates GPT-4.1 prompting tips from internal testing, covering agentic workflows, long context, chain of thought, and instruction following.
DiffusionDB
Documents a 14-million-image prompt dataset scraped from the Stable Diffusion Discord server, with metadata and download instructions.