Testing copies of Homeassitant

I wanted to make a copy of home assistant to do some testing. But since starting up some HA clones, my thread network has been having problems.

My main setup
Home Assistant Yellow ~ 120 ZHA devices
Apple TV w/ Thread - 5 Matter devices including 3 Thread ( sets it self to the standby home hub)
Apple TV w/o Thread - Home Hub.

I took a full backup of the HA and tried to restore it on a RPi 3B, but this crashed on startup - probably not enough ram. I then built a HAOS VM to run on my Synology NAS and restored HA there ( there is no attached Zigbee antenna).

Matter devices are already showing up and seem to work, but after a few hours start to see issues. I have seen new instances appear and the old entities marked with a red !

More recently the blinds stopped responding - both in HA and Apple Home they are not responding. In the original HA blinds device I disabled the old entities:

Some time later the blinds started to respond again - both in Apple Home and HA.

Are there any concerns when cloning an HA instance that can cause thread issues?

By cloning all the Matter credentials get copied too. If both systems are running, the two Matter Server will setup a CASE session using the same storage. Essentially, they appear to have the same “identity”. In a quick test, this seems to be mainly problematic for the subscriptions: I can control the devices from both controller, but only one of the two controller receives subscription updates (state changes). There are definitely more issues if advanced features come into play where the device needs to communicate to the node, e.g. persistent CASE session (which helps to build up communication faster when a device restarts). Since both controller nodes have the same controller node id, this will cause issues for sure.

That said, I did not see any interference on a third controller: State changes kept coming just fine. So maybe your case where Apple Home also shows the device offline is different. :thinking:

In any case, operating two Matter controllers with the cloned storage is really not recommended! Best is to delete the Matter integration and uninstall the Matter Server
on one of the two installation. Then readd them and use the multi-admin feature: On the first instance go to each device page and use the “Share device” feature to add it to the other controller. That way the two controllers have separate identities.

2 Likes

Thank you @agners.

Is there a way to clone a system and leave out the Matter config?

Ideally:
Full backup of live version x
Partial restore of version x on a test system
Upgrade test system to version y
If successful upgrade live system to version y

Ultimately I want to see something like this:
System A (active) live
System B (synchronised copy of A) listening
Suspend the sync process
Upgrade system B
Test
If successful Swap A and B roles
After suitable acceptance time, re-enable the sync.

I feel that Homeassistant as good as it is, is a single point of failure and could use some degree of higher availability. most of my automated equipment can be operated without HA but that is not ideal.

Make sure to change the mDNS hostname in the network settings.
And if possible, do it before it gains wide network access.

:wink:

hmm.

With the partial restore option you can leave out the Matter Server add-on. But there is no way to leave out the integration, so that one you’ll have to remove manually.

Yeah nothing built in, but with Matter you definitely can safely run two controllers, and that way implement a “failover” of some sort :sweat_smile:

But I kinda doubt that your high availability approach works well for all integrations.

Using backups (and storing them remotely) helps for a lot of cases, but a manual restore is still required in case of failures. Others use virtualization and snapshots to quickly roll back. The ova Home Assistant OS image is quite well optimized to run on Proxmox, and it makes sure that the database is in a synchronized state when the virtual machine is taking a snapshot (via the KVM freeze feature).