Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

324 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ OpenCode

AI-Powered Configuration Assistant for Home Assistant

Version Project Stage License Maintenance

Stable Build Beta Build

Transform your Home Assistant configuration with the power of AI

Installation โ€ข Features โ€ข Documentation โ€ข Support


โœจ About

OpenCode brings the revolutionary OpenCode AI coding agent directly into your Home Assistant instance. Experience intelligent configuration editing through natural language, advanced YAML assistance, and deep integration via the Model Context Protocol (MCP).

Upstream attribution: This is an independent Home Assistant add-on that redistributes and integrates OpenCode, ยฉ 2025 opencode, under the MIT License. It is not made by, affiliated with, or endorsed by the OpenCode team or Anomaly. See the third-party notices.

๐ŸŽฏ Key Features

๐Ÿค– AI-Powered Editing

Use natural language to modify your Home Assistant configuration. No more searching documentation - just ask!

๐ŸŽจ Two Interface Modes

Choose your experience from the sidebar: a beautiful web terminal with 10 themes, or the graphical OpenChamber web UI โ€” both served through Home Assistant Ingress.

๐Ÿ”Œ Provider Agnostic

Works with 75+ AI providers: Anthropic, OpenAI, Google, Groq, Ollama, and many more.

๐Ÿ”ง Deep MCP Integration

41 tools, 14 resources, and 6 guided prompts for comprehensive Home Assistant interaction.

๐Ÿง  Home Context

Sessions start knowing your installation instead of rediscovering it. A generated briefing describes your setup, AGENTS.local.md holds your own standing instructions, and approved decision notes carry the reasoning behind your configuration between sessions.

๐Ÿ’ก Intelligent LSP Support

Smart YAML editing with entity autocomplete, live hover information, deprecation warnings, and go-to-definition support.

๐Ÿ›ก๏ธ Safe Config Writing

Validated config pipeline with automatic backup/restore. Multi-layered checks are designed to prevent AI-written config from breaking your HA instance.

๐Ÿ—๏ธ hab CLI Integration

Includes the Home Assistant Builder CLI by @balloob โ€” a CLI purpose-built for AI agents to manage Home Assistant via REST and WebSocket APIs. Enables dashboard CRUD, area/floor management, helper creation, backup/restore, and bulk admin operations that would otherwise require direct API calls or UI interaction.

๐Ÿงญ HA Native LLM Ready

Tracks Home Assistant's emerging native llm integration and native MCP endpoints such as /api/mcp/<API ID>, reports readiness through MCP, and targets beta-channel bridge testing first.


๐ŸŒŸ What is OpenCode?

OpenCode is an open-source AI coding agent that transforms how you interact with your codebase. It understands your files, executes commands, and helps you build and maintain software using natural language.

Think of it as your personal expert developer who:

  • ๐Ÿ“– Reads and understands your entire configuration
  • โœ๏ธ Suggests and implements improvements
  • ๐Ÿ› Finds and fixes bugs automatically
  • ๐Ÿš€ Implements new features on request
  • ๐Ÿ’ฌ Explains complex configurations in plain English

๐ŸŽญ Supported AI Providers

OpenCode works with 75+ AI providers. Choose the one that fits your needs:

๐Ÿ”ฅ Popular Providers (Click to expand)
Provider Available Models
๐Ÿง  Anthropic Claude 4 Opus, Claude 4 Sonnet, Claude 3.5 Sonnet, Claude 3.5 Haiku
๐Ÿ’Ž OpenAI GPT-4o, GPT-4 Turbo, o1, o1-mini, o3-mini
๐ŸŒˆ Google Gemini 2.0 Flash, Gemini 1.5 Pro, Gemini 1.5 Flash
โ˜๏ธ AWS Bedrock Claude, Llama, Mistral (via AWS)
๐Ÿ”ท Azure OpenAI GPT-4, GPT-4 Turbo (Azure hosted)
โšก Groq Llama 3, Mixtral (ultra-fast inference)
๐ŸŽฏ Mistral Mistral Large, Mistral Medium, Codestral
๐Ÿฆ™ Ollama Local models โ€” see the local model notes before choosing hardware
๐ŸŒ OpenRouter 100+ models through single API
๐Ÿค Together AI Llama, Mixtral, and open models
๐Ÿ”ฅ Fireworks AI Fast inference for open models
๐Ÿš€ xAI Grok models
๐Ÿ’ซ Deepseek Deepseek Coder, Deepseek Chat

Running models locally? The add-on sends a large tools-and-instructions prompt on every request. Read the local model notes first โ€” a small model on modest hardware can take minutes per reply.

๐ŸŽ Free Tier - OpenCode Zen

Start immediately with OpenCode Zen - no API keys or subscriptions required! Get access to curated models optimized for coding tasks, perfect for trying OpenCode or for users who prefer not to manage their own API keys.

Simply run /connect and select OpenCode Zen to get started for free.


๐Ÿ“ฆ Installation

โš™๏ธ Hardware requirement: on x86-64, OpenCode needs a CPU with SSE4.2 (Intel Nehalem/2008 or newer, AMD Bulldozer/2011 or Jaguar/2013 or newer). Older processors cannot run it at all โ€” it exits with Illegal instruction (core dumped). ARM64 is unaffected. See CPU requirements for details.

Quick Install

  1. Add this repository to Home Assistant:

    Add Repository

    Or add manually

    Go to Settings โ†’ Add-ons โ†’ Add-on Store โ†’ โ‹ฎ โ†’ Repositories

    Add: https://github.com/magnusoverli/opencode

  2. Install the add-on:

    • Find "OpenCode" in the add-on store
    • Click Install
  3. Start using it:

    • Start the add-on
    • Click Open Web UI (or use the sidebar)
    • Run opencode and use /connect to configure your AI provider

    ๐Ÿ’ก Prefer a graphical interface? Set Interface Mode to openchamber in the add-on Configuration tab and restart to swap the terminal for the OpenChamber web UI on the same sidebar entry. The default terminal mode is unchanged.


๐Ÿ›ก๏ธ Safety & Validation

This add-on has read/write access to your Home Assistant configuration directory.

It also mounts Home Assistant add-on development folders (/addons and /addon_configs) so OpenCode can help with custom add-ons. Treat /addon_configs as sensitive because it may contain configuration data for other add-ons.

OpenCode includes a multi-layered validation pipeline designed to prevent AI-written configuration from causing your Home Assistant to fail to start:

  • ๐Ÿ” Automatic config validation โ€” every config write is validated through HA Core's own check before committing
  • โ†ฉ๏ธ Automatic backup/restore โ€” if validation fails, the original file is instantly restored
  • ๐Ÿงช Jinja2 template pre-validation โ€” templates are tested through HA's engine before writing to disk
  • ๐Ÿ“‹ Deprecation scanning โ€” 20+ patterns catch outdated syntax, auto-updated from GitHub
  • ๐Ÿฅ HA Repairs integration โ€” surfaces your installation's active deprecation warnings
  • โš ๏ธ Structural checks โ€” catches missing triggers, actions, and other required fields

Additional best practices:

  • ๐Ÿ’พ Always backup your configuration before significant changes
  • ๐Ÿ‘€ Review changes suggested by the AI before accepting them
  • ๐Ÿ“ Use version control (git) when possible for easy rollback

๐Ÿงญ Home Assistant Native LLM Roadmap

Home Assistant is developing a native llm integration so Core integrations and custom integrations can expose curated tools to Assist through <integration>/llm.py and registered LLM APIs over /api/mcp/<API ID>. OpenCode will follow this work closely and aims to be a premium consumer of the agent capabilities Home Assistant makes available.

Today, the add-on keeps MCP as the complete working tool surface, adds readiness reporting through get_agent_capabilities / ha://agent/capabilities, provides compact get_home_context discovery, and includes a native LLM provider guide for custom integration authors. The beta channel can opt into a configurable native MCP bridge targeting /api/mcp/<API ID> with assist as the default. As HA-native LLM capabilities become stable and accessible to add-ons, OpenCode will prefer native HA tools where they fit while keeping MCP for safe config writing, validation, admin/dev workflows, screenshots, firmware updates, and troubleshooting.

See the full documentation for the current support status and long-term integration plan.


๐Ÿ“š Documentation

Comprehensive documentation is available covering all features:


๐ŸŽฏ Quick Start Examples

Once installed and connected to an AI provider, try these commands:

# Create a new automation
"Create an automation that turns on lights when motion is detected"

# Review your configuration
"Check my configuration.yaml for any issues"

# Add sensors
"Add a template sensor to track my total energy usage"

# Get entity information
"What's the current state of all my lights?"

# Troubleshoot
"Why isn't my bedroom motion sensor triggering automations?"

# Analyze history
"Show me temperature trends for the past 24 hours"

๐Ÿค Support

Need help? We've got you covered:

๐Ÿ’ฌ Discord

Join OpenCode Discord

Community support & discussions

๐Ÿ“– Documentation

OpenCode Docs

Comprehensive guides & tutorials

๐Ÿ› Issues

GitHub Issues

Bug reports & feature requests


๐ŸŒŸ Contributing

We love contributions! Here's how you can help:

  1. ๐Ÿด Fork the repository
  2. ๐Ÿ”ง Create your feature branch (git checkout -b feature/amazing-feature)
  3. ๐Ÿ’พ Commit your changes (git commit -m 'Add amazing feature')
  4. ๐Ÿ“ค Push to the branch (git push origin feature/amazing-feature)
  5. ๐ŸŽ‰ Open a Pull Request

Contributions of all kinds are welcome โ€” feel free to open a PR!

Release channels

Channels are folders, not branches. Both live on main:

  • ha_opencode/ โ€” the stable channel. Tagged v*, published as the OpenCode add-on.
  • ha_opencode_beta/ โ€” the beta channel, for work still soaking. Tagged beta-v*, published as the OpenCode Beta add-on.

Each folder is a complete add-on with its own Dockerfile and rootfs/, so a stable release cannot contain something that only exists in beta. Put experimental work in ha_opencode_beta/; touch ha_opencode/ only for changes that should reach stable users right away.

Both add-ons can be installed side by side โ€” they keep separate decision notes and separate storage. Full details in RELEASING.md.


๐Ÿ‘ Authors & Contributors

Magnus Overli
Magnus Overli

Creator & Maintainer
Teeflo
Teeflo

ARM64 fixes, README, icons & logo
Paulus Schoutsen
Paulus Schoutsen

hab CLI โ€” admin backbone

All Contributors

See the contributors page for the full list of amazing people who have helped make this project better!


๐Ÿ“œ License

This is free and unencumbered software released into the public domain - see the UNLICENSE file for details.

This distribution also includes third-party software, including OpenCode. Its copyright notices and license terms are retained in THIRD-PARTY-LICENSES.md and in the add-on image at /usr/share/doc/ha-opencode/NOTICE.


โญ If you find OpenCode helpful, please star this repository!

Made with โค๏ธ for the Home Assistant community

Installation โ€ข Features โ€ข Documentation โ€ข Support

About

No description, website, or topics provided.

Resources

Stars

303 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages