Cluster State Sync — active/passive failover between two Home Assistant instances

I’ve been running two Home Assistant boxes in active/passive for a while and got fed up with the standby coming up empty every time I tested it. So I wrote something to fix that. It’s now at the point where other people might get some use out of it and i wanted to give back to a community that has helped me in the past.

What it does: mirrors entity state and config to a shared Valkey, and restores it on the standby at startup, before the automation engine starts. So when a node gets promoted it isn’t acting on empty or stale state. Lose the machine and the standby is up and initialised in about 100 seconds.

What it doesn’t do, which matters more:

  • No leader election for automations. During the overlap both instances fire. If you’ve got automations that aren’t safe to run twice, sort those first.
  • Radios don’t move unless you’ve arranged it. Anything plugged into the dead box is gone until it’s back.
  • Anything in its own container on the dead box — Zigbee coordinator, MQTT, database — doesn’t move either.
  • Home Assistant dying on its own, with the machine still up, takes about ten minutes to fail over. That’s deliberate. A short grace just means a slow restart hands your house to the other box for no reason.

It’s alpha. It’s been running on my own house for months and it’s had plenty of bugs. Nearly all of them were silent ones I only found by actually pulling the plug, not by running the tests.

There’s a KNOWN-LIMITATIONS page and I’d rather you read it before installing than after.
It works entirely through public HA APIs. No forked core, no monkey-patching, because I didn’t want it breaking every time HA ships a release.

AGPL-3.0. Install through HACS as a custom repository — it’s not in the default store.
HA Cluster State Sync

Happy to answer anything. If you try it and it breaks something, tell me. That’s more use to me than a star.