OpenCode for Home Assistant
Hey everyone!
If anyone is interested… I am playing with creating an addon to integrate OpenCode as a tool in Home Assistant.
What is OpenCode?
OpenCode is an open source AI coding agent that helps with software engineering tasks. Think of it as having a capable developer assistant that can understand and explain code, add new features, fix bugs, and interact with your development environment. It supports 75+ LLM providers including Anthropic (Claude), OpenAI, Google, xAI, DeepSeek, local models via Ollama/LM Studio, and aggregators like OpenRouter and Together AI.
The Addon
I have gotten as far as getting the OpenCode application itself to run and it stores sessions and tokens persistently across restarts and reboots. I have also created purpose-built LSP and MCP integrations to make OpenCode more tightly integrated and well-versed in the language of Home Assistant. This gives you possibilities like:
MCP Integration
- Natural language questions about your automations and entity landscape
- Context-aware troubleshooting with live entity states, history, and logs
- OpenCode can take actions in Home Assistant directly, like turning on/off lights
LSP Integration
- Real-time YAML syntax validation and assistance
- Entity-aware code completion based on your Home Assistant setup
EDIT: As provided feedback and authority on the subject has stated (see further down), this is likely a very bad idea!!!
I have removed the link to the addon. I will use this myself, but recommend everyone else to stay away! ![]()
EDIT 2:
While I will leave the above warning in place, underlining that you as the user is the one responsible for creating a valid and working config, based on the input from @balloob, I am adding back the link to the porject. I would still tag this as experimental.
Any contributions to making this tool better, more solid and safer to use inside Home Assistant are very welcome.
Use the tool, don’t use the tool, test the tool… I’ll leave it up to you guys…
