Skip to content

Repository files navigation

Home Assistant Configuration Editor

GitHub Release Builder CodeQL Dependabot Last commit License Python Home Assistant Ingress Supports amd64 Supports aarch64

ha-edit-conf

A lightweight Home Assistant add-on that provides a simple text editor for configuration files with YAML and JSON syntax highlighting, entity autocomplete, and Home Assistant config validation after saving.

Features

  • Lightweight CodeMirror 6 editor (~1MB, 10x smaller than Monaco)
  • Real-time client validation: Blocks saving if there are YAML or JSON syntax errors
  • One-click "Restore Valid State" to quickly undo broken configuration edits
  • Home Assistant config validation after save using the same config check API as Developer Tools
  • Entity autocomplete (substring matching from live HA API)
  • VS Code-style file tree with expand/collapse and indentation guides
  • Rainbow indentation for YAML structure visualization
  • Configurable indentation guides with colored spaces or vertical lines and adjustable opacity
  • Dark/light theme with automatic system preference detection
  • Optional Prettier formatting for YAML and JSON when saving
  • State persistence - remembers last opened file
  • Tree browser with folder navigation
  • Auto-backup on every save (creates .backup files)
  • Multi-architecture support (amd64, aarch64, armv7, armhf, i386)
  • Ingress support - runs securely within Home Assistant

Installation

Quick Install

Click the button below to add this repository to your Home Assistant:

Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.

Manual Installation

  1. In Home Assistant, go to Settings → Add-ons → Add-on Store
  2. Click the three dots menu (top right) → Repositories
  3. Add this repository URL: https://github.com/roman-pinchuk/conf-edit-ha
  4. Find "Configuration Editor" in the add-on store and click Install
  5. Start the add-on
  6. Access via the sidebar panel "Config Editor"

Configuration

Visual settings are available immediately from the gear button in the editor. Use it to change the theme, indentation guides, guide opacity, font size, line wrapping, and rainbow brackets.

Enable Format YAML and JSON on save in the appearance settings to apply Prettier formatting before saving. It is disabled by default.

Usage

  1. Open the add-on from the Home Assistant sidebar
  2. Select a YAML, JSON, Python, or shell file from the file browser
  3. Edit the file with syntax highlighting
  4. Type to get entity autocomplete suggestions
  5. Real-time validation will instantly detect YAML or JSON syntax errors and block saving. YAML files also provide entity suggestions. You can click Restore Valid State to easily undo invalid edits.
  6. Click "Save" to save changes (creates automatic backup)
  7. Review the Home Assistant validation result in the status bar
  8. If backend validation fails, click or tap the status bar to expand the full error details

Tech Stack

  • Backend: Python + Flask
  • Frontend: TypeScript + CodeMirror 6 + Vite
  • Container: ~50MB total size image

Security

  • All file operations are restricted to /config directory
  • Automatic backups created before each save
  • No external dependencies or internet access required

Development

Quick Start

# Build everything and run
make build run

# Or step by step:
make build-frontend  # Build frontend
make build-docker    # Build Docker image
make run            # Start container

# View logs
make logs

# Restart after changes
make restart

Building for Multiple Architectures

The add-on automatically builds for all supported architectures when published to Home Assistant. For local multi-arch testing:

make build-multiarch

See BUILD.md for detailed build instructions.

Project Structure

conf-edit-ha/
├── app.py              # Flask backend
├── frontend/           # TypeScript + Vite frontend
│   ├── src/
│   │   ├── main.ts     # App entry point
│   │   ├── editor.ts   # CodeMirror setup
│   │   ├── api.ts      # API client
│   │   └── theme.ts    # Theme management
│   └── styles.css      # VS Code-style CSS
├── static/             # Built frontend (generated)
├── config.yaml         # Add-on configuration
├── build.yaml          # Multi-arch build config
└── Dockerfile          # Container definition

Support

For issues and feature requests, visit: GitHub Issues

License

This project is licensed under the MIT License.

About

Lightweight YAML configuration editor for Home Assistant

Topics

Resources

Stars

31 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages