I'm using a ConBee II for Zigbee.
1. Connect the ConBee II to the RPi.
2. Verify that the RPi sees the ConBee II USB device.
lsusb
ls -l /dev/serial/by-id/
1. Add the Node.js repo
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
2. Install dependencies
apt install -y nodejs git make g++ gcc
3. Check the Node.js and NPM versions
node -v
npm -v
4. Clone the Zigbee2MQTT GitHub repo
git clone https://github.com/Koenkk/zigbee2mqtt.git /opt/zigbee2mqtt
5. Change the directory's permissions
chown -R ross:ross /opt/zigbee2mqtt
6. Navigate to the zigbee2mqtt directory and install its dependencies with NPM
cd /opt/zigbee2mqtt
npm ci
1. Open /opt/zigbee2mqtt/data/configuration.yaml
vim /opt/zigbee2mqtt/data/configuration.yaml
homeassistant: true
permit_join: true
mqtt:
base_topic: zigbee2mqtt
server: mqtt://home-assistant.mydomain.local
user: zigbee2mqtt
password: *********
serial:
port: /dev/ttyACM1
advanced:
network_key: GENERATE
1. Create a new systemd file
vim /etc/systemd/system/zigbee2mqtt.service
With the following contents
[Unit]
Description=zigbee2mqtt
After=network.target
[Service]
ExecStart=/usr/bin/npm start
WorkingDirectory=/opt/zigbee2mqtt
StandardOutput=inherit
# Or use StandardOutput=null if you don't want Zigbee2MQTT messages filling syslog, for more options see systemd.exec(5)
StandardError=inherit
Restart=always
User=ross
[Install]
WantedBy=multi-user.target
2. Reload systemd, enable, and start
systemctl daemon-reload
systemctl enable zigbee2mqtt.service
systemctl start zigbee2mqtt.service
systemctl status zigbee2mqtt.service
Stop the Zigbee2MQTT
systemctl stop zigbee2mqtt
Move into the operating directory
cd /opt/zigbee2mqtt
Backup the existing config
cp -R data data-backup
Pull the specified commit
git pull
Use NPM to install
npm ci
Copy the previous config back to the new installation
cp -R data-backup/* data
Start Zigbee2MQTT
systemctl start zigbee2mqtt
Install onto the new server and copy the contents of the /data
directory to the new server.