Hi Everyone,
I just want to share a way where you can register the same Zigbee Devices to multiple hubs. Before we start, I apologize if the information becomes too long.
The motivation for doing this is that I make an Arrival Sensor for cars usable with hubs in different locations. (note: This configuration may also work with other ZigBee devices. This is why I make this separate thread. However, I tested this configuration with my own Arrival Sensor). When we have multiple locations with home automation systems, wouldn’t it be nice for the Arrival Sensor to be able to hop on from one hub to another? Perhaps, we have an office and home with a home automation system. This capability will allow us to use the same Arrival Sensor on those 2 locations. You can read all about my Arrival Sensor here.
Requirement for doing this is as follow:
- I only know how to do this with Zigbee2MQTT. But the basics may be applicable with ZHA. So for now Zigbee2MQTT is required.
- We must use the same ZigBee stick (perhaps only compatible with z-stack/TI stacks only). I use Sonoff USB 3.0 plus dongle on my hubs. I would say that the stick must be from the same model. CC2652X stick is probably not going to be compatible with CC253X.
- Each hub must not be within reception of each other.
- Each hub is its own independent hub. There is no sharing resources between hub. You will need to configure the automation independently from each other. It is only the sensor can joint on of the hub.
The theory behind it is simple. I create a duplicate ZigBee coordinator for each hubs so that the Arrival Senor can rejoin and send information to one of the registered hubs seamlessly. In Zigbee2MQTT, we can create a duplicate ZigBee coordinator because Zigbee2MQTT can replace ZigBee sticks when they are broken with the same stick. There is no need to re-pair the devices connected to it. Based on the above, here is what I did.
- I set up two Zigbee2MQTT instances.
- I pick one one them as the source instance. I copied the following information from the source to the destination instance.
Please make the following changes while your Zigbee2MQTT instance shutdown.
In configuration.yaml, I make sure the values that are pointed with the red arrow are the same between 2 hubs. I know that there is some private information below. These are my test hubs with my test devices. I do not have anything critical running in it.
In coordinator_backup.json, I make sure that the values pointed with the red arrow are the same between 2 hubs. Please make sure the values pointed by green are the same between 2 hubs. The green one should be derived from configuration.yaml. I believe what we are doing here is to make one of the sticks a duplicate of the other by copying its address and some internal information.
Depending on how you install your Zigbee2MQTT, the locations of those files may be different. I am not going to put the file location information here. Please make sure that you are familiar with how the Zigbee2MQTT instance is installed on your machine and make changes in those files.
WARNING: I would not do this on hubs with existing devices paired to it. The zigbee network where you duplicate the coordinator will need to re-pair its existing devices. I am giving this warning for convenience. I want to make sure that you don’t get to position where your have a lot of device paired and need pairing again
The above steps do not create a duplicate ZigBee environment. Each hub can have different devices paired to it. However, each hub will have the same ZigBee coordinator.
After restarting both hubs, you can pair the Arrival Sensor to one of the hubs. Then, you can factory reset the Arrival Sensor. You can follow with pairing the Arrival Sensor to the other HUB. That is all you need to do. The Arrival Sensor can hop from one to another hub.
Here is a demo of my test environment.
DISCLAIMER: This is not fully tested. With the short amount of time that I use it, I am not seeing any issue. But, it does not mean that there is no issue with this technique.
Thanks
Iman