Integration for OpencodeZen API — adds an AI conversation agent and AI task agent to Home Assistant. Powered by opencode.ai.
Build custom LLM-powered automations, voice assistants, and data generation tasks using models served through the OpencodeZen API. Supports tool/function calling, structured JSON output, web search, and image/PDF attachments.
- Conversation Agent — AI assistant for Home Assistant's conversation/assist pipeline. Can control devices, query state, and run automations via tool calling.
- AI Task Agent — Generate structured data from AI prompts (JSON schema output). Useful for automations that need AI-generated data.
- Multiple agents — Add multiple conversation or task agents, each with its own model and configuration.
- Web search — UI toggle exists, backend not yet implemented. See Future features.
- File attachments — Images and PDFs supported.
- Custom prompt — Configure system prompt per agent.
You need an OpencodeZen API key from opencode.ai.
- Add this repository to HACS as a custom repository.
- Install OpencodeZen via HACS.
- Restart Home Assistant.
- Go to Settings → Devices & services → Add integration → Search for "OpencodeZen".
- Enter your API key.
After setup, use the configure button on the integration entry to add a conversation agent subentry. Select model, optionally configure prompt, enable tool access and web search.
Use the configure button and select "AI Task" subentry type. Choose a model that supports structured outputs.
- Go to Settings → Devices & services → OpencodeZen.
- Click the entry, then click Delete to remove the integration and all its agents.
- Remove the custom repository from HACS if desired.
- Restart Home Assistant.
| Option | Description |
|---|---|
| Model | AI model to use |
| Prompt | Custom system prompt |
| Tool access | Allow agent to call Home Assistant APIs |
| Web search | Enable web search for this agent (backend TODO) |
All models available through the OpencodeZen API that support chat completions. See opencode.ai/models for available models.
Requires uv.
./run_tests.shOr manually:
uv venv
uv sync --group test --no-install-project
uv run pytest tests/ -v| Feature | Status |
|---|---|
| Web search | TODO |
GPL-3.0