Hello. So today I created two instances of zigbee2mqtt.
I did it because Aqara e1 curtain drivers were leaving network every few days.
There is written somewhere on the internet that aqara devices have problems with coexisting with different brand zigbee routers on the same network.
So how I did it?
My HomeAssistant runs under Proxmox on device like Intel NUC.
The simplest way how to do it is to install another instance of Z2M as LXC container. To do that just follow this guideline Proxmox VE Helper Scripts | Scripts for Streamlining Your Homelab with Proxmox VE (you can find zigbee2mqtt in the website menu).
This is something like virtualized linux running under Proxmox (but sharing most of the stuff so not using much RAM). I have gone with the alpine linux version and it consumes 70MB of RAM.
Additionally setup a static ip to the running LXC instance so you can reach it back from the HA.
Just follow the steps for alpine.
To edit Z2M config open a shell console of a running LXC instance and run this command:
nano /etc/zigbee2mqtt/configuration.yaml
In the configuration of Z2M set MQTT server running in your HA as a MQTT server (basically just copy credentials from your original Z2M instance and add correct IP address).
I changed the MQTT topic to zigbee2mqtt2 but I am not sure if that is necessary.
Enable homeassistant in the config so Z2M can create devices in HA.
Set the correct Zigbee device (devices are shared with the Proxmox). Of course you need to have two zigbee dongles for this.
My final config looks like this:
mqtt:
base_topic: zigbee2mqtt2
server: mqtt://YOUR_HA_IP:1883
user: YOUR_MQTT_USERNAME
password: YOUR_MQTT_PASSWORD
serial:
port: /dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B001CDDF676-if00
frontend:
port: 8080
homeassistant: true
advanced:
log_level: info
log_output:
- console
- syslog
log_directory: /var/log/zigbee2mqtt
log_syslog:
facility: daemon
path: /dev/log
protocol: unix
app_name: Zigbee2MQTT
eol: /n
host: localhost
localhost: localhost
pid: process.pid
port: 514
type: '5424'
network_key: '!secret.yaml network_key'
pan_id: '!secret.yaml pan_id'
channel: 15
last_seen: ISO_8601
devices: devices.yaml
groups: groups.yaml
availability:
active:
timeout: 10
passive:
timeout: 1000
Now to restart Z2M run:
rc-service zigbee2mqtt restart
You can check logs by running:
cat /var/log/messages
Since we enabled frondend in the config we can reach the Z2M gui from the HA.
For this install Zigbee2MQTT Proxy addon in your HA from the same repository as Zigbee2MQTT.
In the config set the server:
http://YOUR_LXC_INSTANCE_IP:8080
After this setup you can have both Z2M visible and manageable from HA.