2 instances of zigbee2mqtt in hass os

Thanks for this, I would like to try this out myself, so have a few questions:

  • In the second instance, you need a separate configuration directory correct? So I think one would have the second instance configured in the AddOn’s UI “Configuration” tab to use a different directory, for example: data_path: /config/zigbee2mqtt-2
  • Hostname: Do the two different instances have different hostnames? (You can see the Hostname on the AddOn’s UI “Info” tab page).
  • AddOn Webpage: On the AddOn’s UI “Info” tab page is a button “Open Web UI”. When you click on it, it takes you to the AddOn’s webserver. For the second instance, do you change the configuration’s web port number somehow?
  • what is “zigbee id”? Do you mean pan-id and ext-pan-id?

Best Regards :slight_smile:
[EDIT] I went ahead and got this working (I think), and made some notes along the way:

  • UI->Setttings->Add-Ons->+Add On Store->3-dots->Repository.
    I "ADD"ed a respository with the additonal “/” at the end of the URL as tom78 said to do (making it https://github.com/zigbee2mqtt/hassio-zigbee2mqtt/) , and indeed another entry was made (and it looks identical to the first instance’s entry). However after closing this pop-up I did not see the additional instance in the AddOn list. Anyway I did reboot the machine and the additional instance did appear this time (along with additonal instances of Edge and Proxy) in the AddOn Store. Note: there is not any way really to distinguish which one is which.
  • Host/Docker Name - It turns out that the Hostname and Dockernames for the two instances are different, one will be xxxxxxxx_zigbee2mqtt, the other will be yyyyyyyy_zigbee2mqtt.
    • When you click on the 2nd instance of zigbee2mqtt, the regular Add-On “Info” page shows up and there is nothing to distinguish it from the 1st instance except for one thing: the URL in the browser is slightly different. The URL will contain the hostname in the string. Once the instance is running, the “info” page will actually show the hostname.
    • Logs sent to the HassOS journal will be prefixed with hostname. However if you use the UI->Settings->System->Log->PullDown you will see two instances to choose from but they have the same name (the last one is the 2nd instance)
    • Zigbee2MQTT Web UI: Because the hostnames are different, the same webserver port can be used, so no need to have the front-end use a different port. Note: That the Zigbee2MQTT docs also say “you cannot change the port. The addon will force the frontend to run on port 8099 as Home Assistant Ingress requires this”.
  • Configuration (Zigbee2MQTT Add-On “Info” page):
    • The SoCat port has to change. When the AddOn starts up it stops and tells you there is something else listening on 8485. I simply incremented it by 1 to 8486
    • I did change the configuration directory to /config/zigbee2mqtt-2
    • I did change the MQTT parameters to include the base_topic as I changed it to zigbee2mqtt2
    • Then next configure which serial port to use, and other things like channel-id, pan-id, ext-pan-id etc.
    • There may be other things from an administrative/management standpoint to configure in order to distinguish the two instances, but this is all I have done so far.

If one is curious why I was interested in setting up two instances, its because I have a “sandbox” HA system that I use to play around with so that my “production” HA system won’t be affected. On my sandbox I have HA running on a VM, and I have one instance of Zigbee2MQTT using the SiLabs multiprotocol Add-on (that’s been running for several months now), and now on my second instance I wanted to play around with some VM related mappings of the Physical Zigbee USB Stick to my HA-VM serial port.

1 Like