Multiple zigbee2mqtt instances against the same MQTT broker
Is your feature request related to a problem? Please describe
There is a lack of documentation for the use case of having multiple isolated zigbee2mqtt networks managed by the same MQTT broker, so I have written it the way I would have needed.
Integrating multiple Zigbee networks into one MQTT broker
You can integrate multiple zigbee networks into one MQTT Broker. Then you can integrate this single MQTT Broker with other software components such as a single Home-Assistant instance that would be able to interact with all zigbee networks. To implement this use case, each zigbee network must be managed by a single zigbee2mqtt instance and a single concentrator device. In case those networks overlaps phisically, be sure to use a different channel and a different pan_id for each one. This is an example snippet configuration where we want to integrate three Zigbee networks into one MQTT Broker (192.168.1.9:1883) to use with HomeAssistant (only the relevant configuration options for this use case are shown):
# NETWORK 1 configuration.yaml
homeassistant: true # in case you want devices from this network to be discovered by ha
mqtt:
server: mqtt://192.168.1.9:1883
base_topic: zigbee1
user: <<mqttuser>>
password: <<mqttpassword>>
advanced:
pan_id: 6755
channel: 11
network_key:
- ...
# NETWORK 2 configuration.yaml
homeassistant: true # in case you want devices from this network to be discovered by ha
mqtt:
server: mqtt://192.168.1.9:1883
base_topic: zigbee2
user: <<mqttuser>>
password: <<mqttpassword>>
advanced:
pan_id: 6756
channel: 15
network_key:
- ...
# NETWORK 3 configuration.yaml
homeassistant: true # in case you want devices from this network to be discovered by ha
mqtt:
server: mqtt://192.168.1.9:1883
base_topic: zigbee3
user: <<mqttuser>>
password: <<mqttpassword>>
advanced:
pan_id: 6757
channel: 20
network_key:
- ...
Thanks, this has been covered in the FAQ already: https://www.zigbee2mqtt.io/information/FAQ.html#how-do-i-run-multiple-instances-of-zigbee2mqtt . If you want to add more info click the pencil icon here to make a pull request: https://github.com/Koenkk/zigbee2mqtt.io/blob/master/docs/information/FAQ.md