Migrate Home Assistant VM from VMware ESXi to Proxmox while keeping HomeKit devices working in Apple Home app

I am trying to move my Home Assistant VM from VMware ESXi to Proxmox. I did a test migration which appeared to work for the most part, but I had one critical problem. HA-based HomeKit devices showed up as “Not Responding” in the Apple Home app.

I use the HomeKit Controller integration to join HomeKit devices to HA rather than to an Apple device / Home app. I use the HomeKit integration to publish the HA entities to HomeKit for use with Home app / Siri.

Is there a way to migrate an existing supervised HA VM from ESXi to Proxmox, or generally between servers, while continuing to use the HomeKit integration to make entities available to HomeKit? If so, what steps accomplish that?

Thank you for any advice/guidance/solutions you can offer!

What didn’t work

HomeKit devices that were joined to HA through the HomeKit Controller integration were listed as “Not Responding” in the Apple Home app. This affected all devices in all rooms that I examined. I could not control them via the Home app or Siri on any of my Apple devices.

What did work

HA started up on the Proxmox server. I was able to access HA in a browser. I logged into with my existing HA account (including TFA) and my entire HA configuration appeared to be intact.

I was able to control HomeKit devices joined with HA via the HomeKit Controller integration using HA’s own controls in the Lovelace UI.

When I reverted from Proxmox to ESXi, my previous VM was able to control HomeKit devices through Lovelace. Home app / Siri control worked again.

How I migrated

I kept my existing VMware ESXI server running. I shut down the Home Assistant VM.

I used instructions on how to install the VMware ovftool on the Proxmox server. With ovftool, I downloaded the supervised HA VM and imported it into Proxmox. I then started up the VM in Proxmox without making any other changes to the VM. I realized that it didn’t have a network interface, so I shut it down. I added a network interface with the default settings. I then started up the Proxmox HA VM again. I then realized that I needed to use an existing DHCP reservation. I shut the VM down again, modified the network interface to match the one used by the ESXi HA VM, and started back up.

What I’ve tried

The other inhabitants of the home were not happy about losing Home app / Siri control — they don’t use HA.

I made the changes to the HA VM in Proxmox to add a network interface and then set it to use the same MAC address as the ESXi VM. I later found the UUID for the HA ESXi VM and copied that over to the HA Proxmox VM.

I reverted back to the HA ESXi VM and everything worked as it had before.

Speculation

There appears to be something that either didn’t migrate correctly and/or changed when the Proxmox version of the VM started up. As far as I can tell, the migration copied all files / config from the ESXi VM to the Proxmox version.

Looking at the .config directory, there are a number of files apparently related to HomeKit. There is no single “.homekit.state” file that I’ve found, although I’ve seen reference to it (here and elsewhere). I do see multiple “.state” files that have “homekit” in the name. I haven’t looked into the contents of more than one of these files. I don’t know if any of these config files key off of something like the network Mac address or UUID or some other value that I might be able to make sure is the same between the ESXi and Proxmox versions of the VM.

Two thoughts that came to mind on something that could have affected my VM during the migration / startup on Proxmox:

  1. The MAC address of the network interface. Initially, I didn’t have a network interface when I started the VM. Then I think I started the VM with a Proxmox-assigned MAC address on the interface.
  2. The UUID of the VM.

It may be that if I migrate the VM again, and make sure the MAC address and/or UUID are set correctly before starting up the VM in Proxmox, all will be well. My suspicion is that starting it up before I had completely synced one/both of those values causes something to change in the config when HA started up, even though all of the original files/config had migrated over.

My configuration

I use HomeKit Controller integration YAML configuration to create multiple bridges. It’s roughly one per room or zone of the home, plus additional bridges for specific media devices. Each bridge, of course, is on a different port number. I’ve found it somewhat easier to keep track of a relatively large number of HomeKit entities that way in my YAML and I don’t end up hitting any per-bridge limitations.

I use HomeKit integration configuration to specify HA entities (some with wildcards, I think) to publish back to HomeKit. Not every HA entity is made available to HomeKit, but most are. A large number of these are HomeKit devices joined to HA with the HomeKit Controller integration.

Update: My thoughts about the MAC address and UUID of the VM have not worked out. I still do not have a solution.

I went back through the migration again. This time, I created the network interface in Proxmox, set it to the same Mac address as the ESXi VM, and set the SMBIOS UUID to match the value from the VMware uuid.bios. I set the firmware to OVMF in Proxmox, to use EFI.

I started up the VM in Proxmox. After HA appeard to be fully loaded, I could control HomeKit devices from Lovelace. On my iPhone, the Home app showed the devices as “Not Responding.”

1 Like

Update: I have tried to migrate my HA OS VM from ESXi to XCP-ng. I get the same problem:

  • I can access and control the HomeKit devices that were previously paired via HomeKit Controller integration.
  • I cannot access the devices that are “published” via the HomeKit integration in the Apple Home app on any of my devices.

Some notes:

  • I had at one point added a second Ethernet interface to the VM. I deleted the second interface and restarted HA and HA OS. This did not help.
  • I have confirmed that the .storage/homekit* files are present in the migrated VM.
  • I am not aware of any firewalling or other network restrictions that would be in place in XCP-ng (or in Proxmox, from my earlier attempt)
  • I am not finding anything terribly useful in the HA core logs. I have DEBUG logging enabled.
  • I have not tried removing and re-adding any of my HomeKit integration bridges. I’ve basically got one HA bridge per room set up in my configuration.yaml file. Each bridge filters/includes only the devices that are in that room/area. I have separate bridges for any accessories like media players and cameras.