The official “Zigbee Home Automation” (ZHA) integration is the Zigbee gateway solution that is natively built into Home Assistant and is what is official supported by the Home Assistant founders + Nabu Casa (and really the Zigbee gateway solution that this specific forum is about other than Zigbee devices/hardware products that can possibly be used with this official ZHA integration).
Zigbee2MQTT (a.k.a. Z2M) is an alternative third-party Zigbee gateway that is available as a stand-alone application well as an add-on for Home Assistant. Zigbee2MQTT communicates via the MQTT protocol which makes it more flexible, however, you can not control everything from within Home Assistant’s own user interface and you need to go to Zigbee2MQTT GiHub repository for discussions and reporting issues.
Those two Zigbee gateway solutions have many different pros and cons. Since that official ZHA integration is embedded into Home Assistant’s core it is easy to get started with and feels more like it is a native part of the Home Assistant platform out-of-the-box, and the statistics in Home Assistant Analytics does today show quite a high percentage of installations of the “Zigbee Home Automation” (ZHA) integration, which is not surprising since this is the integration that is recommended for the official Home Assistant Skyconnect dongle/adapter and Home Assistant Yellow appliance’s Zigbee radios. And with Zigbee2MQTT using MQTT which is a widely adopted standard, it makes that compatible with most other home automation ecosystems but Zigbee device management needs to at least partially be handled outside of Home Assistant’s UI, still, together with the fact that it uses MQTT and can be said to be more mature as a complete gateway solution due to it being around for a longer time makes Zigbee2MQTT quite popular among many open-source developers from other projects too and thus it usually gets full support for newer Zigbee devices and unusual features quicker than what ZHA does (though because of how the zigpy library that ZHA’s depends on is designed it will the other hand get initial support even quicker if a device is only using standard Zigbee features and functions since they will in theory then just work without any code being modified).
ZHA docs explain most need to know about how Zigbee works (like how it depends on mesh network):
Especially read and try to understand all in these sections from the ZHA integrations documentation:
- introduction
- using-router-devices-to-add-more-devices
- knowing-which-devices-are-supported
- best-practices-to-avoid-pairingconnection-difficulties
- zigbee-interference-avoidance-and-network-rangecoverage-optimization
Regardless of solution used I highly recommend following the tips in my original post in this thread here:
If nothing else then avoiding interference remember network mesh is the key and simply adding more and more Zigbee Router devices to your network will make it more and more robust.
Maybe not quite…
FYI, the upcoming 2022.9 version of Home Assistant will feature a new UI and backend/core functions for backup and restore/recover in Home Assistant’s native ZHA integration to export/save or import/restore Zigbee network ZHA backup images from within Home Assistant’s UI (in the GUI for the ZHA integration) to make migration to a new adapter easy in ZHA.
It should even make migrations to or from ZHA and Zigbee2MQTT or vice versa between them relatively easy compared to how it has been in the past since both ZHA and Z2M now use support the same “Open ZigBee Coordinator Backup Format” standard that was developed in collaboration between ZHA/zigpy and Zigbee2MQTT developers.
I am however now sure if and how well Zigbee2MQTT itself handle migrations (backup and restore) between different radio adapters such as zstack/znp and ezsp when they are not of the same type to “upgrade” adapter in Z2M without migrating to ZHA.
Note that I do not mean to imply that the application level data would be migrated between the different applications (like Home Assistant and Zigbee2MQTT application layers and their databases) or that the Zigbee network backups contain data about what you named your devices in the application layers of Home Assistant or Zigbee2MQTT. This type of Zigbee network backup will only backups and restores the “Zigbee network” (Zigbee network layer), meaning the Zigbee devices already joined/paired to your Zigbee Coordinator, so you should at least not need to go around your house in order to re-join/re-pair all your Zigbee devices with the Zigbee Coordinator, but the ZHA backup files using this “Open Zigbee Coordinator Backup Format” so it does not contain any data about application layers which technically have nothing to do with the Zigbee networking parts.
Read primary use case / purose here → https://github.com/zigpy/open-coordinator-backup#rationale
Zigbee2MQTT and vice versa will only be able to restore the backup of the Zigbee level, not a backup at the application level. To clarify; this new backup feature in Home Assistant’s ZHA integration will obviously never be specifically made to be a “ZHA to Zigbee2MQTT migration tool” nor a “Zigbee2MQTT or ZHA migration tool”. It is only that ZHA and Zigbee2MQTT both support saving the Zigbee network part of their backups using the same “Open ZigBee Coordinator Backup Format” standard which makes their “Zigbee network backups” compatible with each other for restoring/recovering the “Zigbee network” without having to re-join/re-pair all Zigbee devices.
The fact remains that this will still make migration between ZHA to Zigbee2MQTT or vice versa much easier than before since you do not need to re-join/re-pair all your Zigbee devices, which is not something that would usually take a very long time if have many devices and you have to first reset them all to factory default and then re-join/re-pair them one by one.