Edit and version-control your Lovelace dashboards locally

I got tired of losing dashboard history and not being able to use VS Code to edit Lovelace configs, so I built a small CLI tool. It pulls dashboard YAML from HA via the WebSocket API, lets you diff/edit/push, and plays nicely with git. Sharing here in case it's useful to others — feedback and bug reports very welcome.
Here is the link to git repo: https://github.com/gevgev/hadsync
What it does:

  • Pulls any or all Lovelace dashboards from a live HA instance to local YAML files via the HA WebSocket API — no manual export, no copy-pasting from the UI
  • Push locally edited YAML back to HA with pre-push validation and confirmation prompt
  • Diff local state vs live HA state before committing any changes — see exactly what will change before it does
  • Git-friendly by design: one directory per dashboard, plain YAML files, state and cache files auto-excluded via .gitignore
  • Two-repo setup: tool source and dashboard YAML live in separate repos — your dashboard history is independent of tool version history
  • Token security: HA long-lived access token always referenced via environment variable, never stored in config
  • --dry-run, --yes, --json-output and other global flags for scripting and CI use

Install:

bash

# from source with uv (recommended)
uv tool install /path/to/hadsync

# editable install — changes take effect immediately
uv tool install --editable /path/to/hadsync

Requires Python 3.11+.

Quick workflow:

bash

export HA_TOKEN=eyJ...
mkdir home-assistant-dashboards && cd home-assistant-dashboards
git init
hadsync init        # interactive setup, creates .hadsync.yaml
hadsync pull        # pull all dashboards to local YAML
code .              # edit in VS Code
hadsync diff        # review what changed
hadsync validate    # validate before pushing
hadsync push        # push back to HA
git commit -am "tweaked battery dashboard layout"

GitHub: GitHub - gevgev/hadsync · GitHub


:warning: Work in progress — Phase 1 complete, actively developing

Phase 1 (pull / push / diff / validate / status / state tracking) is complete and working. I'm currently moving into Phase 2: entity ID validation — the tool will validate entity IDs in your dashboard YAML against a cached registry pulled from your live HA instance, catching broken references before they reach your dashboard.

The full design document with the phased roadmap (entity validation → schema validation → watch mode → VS Code extension) is in the repo if you want to see where this is heading.

This is still early. If you try it and hit issues — especially around unusual dashboard configurations, custom components, or non-standard HA setups — bug reports and feedback are exactly what I need right now. PRs also welcome.

Tested against Home Assistant 2026.5.

1 Like

Update — all phases complete

Quick update: hadsync is now feature-complete across all originally planned phases.

What's been added since the initial post:

  • Phase 2 — entity ID validation against a live HA registry, catches broken entity references before they reach your dashboard
  • Phase 3 — Lovelace card schema validation and watch mode
  • Phase 4 — VS Code extension with palette commands and inline diagnostics

The tool has come a long way from the initial pull/push/diff release. If you tried it early and hit rough edges, worth another look.

GitHub: GitHub - gevgev/hadsync · GitHub

Another screenshot for Visual Code plugin: Combined with the Home Assistant Config Helper extension, the editor gains live entity state awareness — completions show friendly names from your real HA instance, and validation catches unknown or removed entity IDs before they ever reach your dashboard:

This looks really cool. I’ve been annoyed by my need to store my dashboard in git, while at the same time being lazy and enjoying the UI editing. If I understand this correctly this could be the sweet spot and allow both?

With a complicated dashboard this would still be one big file - correct? I guess the internal representation in ha is limiting this, but any way that would allow for “pre/post-processing” in the push/pull that would allow for multiple files to be possible and then “compiled” to one big chunk into Ha?