Two Home Assistants in your house
Keep a second Home Assistant ready in your house. When the first one stops — a dead box, a crashed install, a pulled plug — the second takes over within a couple of minutes, even with the internet down. When the first comes back, your home goes back to it by itself, with everything that changed in between.
- Free, no time limit
- No Vome account needed
- Works with the internet down
- Open code you can read
A normal day: the main install runs your home
What you need
- Two machines running Home Assistant OS in the same house — your current one, and a second: a mini PC, a Raspberry Pi or a virtual machine. The second can be smaller (you choose what it runs when it stands in).
- Fixed addresses for both on your network: a reservation on your router, so they always find each other.
- Radios on the network, not on USB, for devices you want to keep working after a takeover: an Ethernet Zigbee coordinator, a Thread border router. A USB stick cannot move between machines.
- Ten minutes.
1 Install Vome CHAP on both
If you use Vome, you already have the Vome repository in Home
Assistant: skip to installing. If not, add it once on each machine —
this button
does it, or add https://github.com/Vortitron/VomeSync
under Settings → Apps → App store → ⋮ → Repositories.
Then install Vome CHAP from the store on both machines and start it.
2 On the main install: choose main
On the Home Assistant that runs your home now, open Settings → Apps → Vome CHAP → Configuration, pick main and press Save. Home Assistant asks to restart the app: press Restart.
Options
Pair this Home Assistant with another one in your house, so one takes over when the other stops -- no Vome account needed. "main" on the one running your home (it then shows a pairing code), "standby" on the other. Leave "off" if you use CHAP through Vome.
On the standby only: the code the main install shows (it starts with vcp1.). Keep it private.
Restart Vome CHAP?
The app needs to be restarted for the changes to take effect.
The Home Assistant screens on this page are redrawn from the real ones, word for word.
3 Copy the pairing code
A moment later the main install shows a notification with the pairing code. The same code is on the app's own page: Open Web UI on the app, or turn on Show in sidebar to keep it there.
Vome CHAP: pair a standby
To make another Home Assistant in your house this one's standby, open its Vome CHAP add-on settings, set local_pair to standby and paste this code into pair_code:
vcp1.eyJhIjoiMTkyLjE2OC4xLjIwIiwicCI6ODE3NywiayI6IkxRNlZVelplUGRwd28xWEhkZnBNb2Y2aEhZMGhicUszd3RDWFZ1SmRYeEE9IiwiaSI6IjMzZmZiMTQxOTE3ZSIsIm4iOiJIb21lIEFzc2lzdGFudCBhdCAxOTIuMTY4LjEuMjAifQ
Keep it private: it lets an install take a copy of this one's configuration.
Keep the code private: anything that has it can take a copy of your home's configuration.
4 On the second machine: choose standby and paste the code
On the other Home Assistant, open Settings → Apps → Vome CHAP → Configuration, pick standby, paste the code into Pairing code, Save and Restart.
Options
Within seconds the two meet over your house network. The standby then stops its own Home Assistant and the home's apps, and takes a copy of the main install's configuration. That is expected: from now on it waits, stopped, with an exact copy. SSH, File editor, Studio Code Server and Samba keep running so you can still reach it.
Made the standby from a backup of the main install? Pair it straight away: until it is paired, both run as the same home.
5 Check it is in step
Back on the main install, the Vome CHAP page now shows the standby, in step, ready to take over. Below, tick what the standby runs when it stands in: a smaller machine can run just what matters.
That's it. Nothing to set up on your router, no Vome account, and it keeps working with the internet down.
When the main install dies
The standby asks two questions every ten seconds: can I reach the main install? and can I reach the router? Only when the router answers and the main install does not — for two minutes together — does it take over. A standby that cannot reach the router either is the one cut off, and does nothing.
On a real pair, timed
Our test pair, with the main install's power pulled (times in UTC):
- The main install loses power.
- The standby is running your home: two minutes to be sure, then Home Assistant starts.
- Your Vome address follows it, if you use Vome.
- The main install is switched back on. It sees the home has moved and stops itself before its Home Assistant ever starts: the two never run together.
- Back and in step for three minutes: the standby stops, sending its last changes.
- Your home is back on the main install, about 40 seconds later.
Each install says so in a Home Assistant notification when it takes your home — “This Home Assistant is running your home” on the standby, “Back on …” on the main install — so you always know which one you are looking at.
Moving it yourself
To work on the main install — an update, new hardware — open the Vome CHAP page on it and press Move the home to …. Home Assistant stops there for a minute or two while its last changes go across, then starts on the standby: nothing is lost. The home stays there until you move it back the same way, from the Vome CHAP page on the standby.
Good to know
- If your router dies, your home keeps running on the main install: it never stops itself for losing sight of the others. Stopping would leave the house with no Home Assistant at all.
- If only the main install's cable comes out, the standby takes over too. When the cable is back, the main install sees the home has moved and stops; anything changed on it in between is lost.
- Private by design. The two talk only to each other, on port 8177 of your house network, encrypted with the key in the pairing code. Nothing goes to Vome or anywhere else.
- Not copied yet: your apps' own data (a Zigbee2MQTT database, say). Set those apps up on both machines. History and graphs stay on each machine.
- With Vome it all works the same, and your Vome address follows whichever install runs your home. If you already use CHAP through Vome, leave local_pair off: Vome's pair decides.
- Open code. Read exactly what it does in the Vome CHAP app's source. It is free to use at home, with or without Vome.