-
Notifications
You must be signed in to change notification settings - Fork 5
ZIGBEE2MQTT
Info lxc:
-
Debian 11
-
Non privilegiato
-
1 gb ram
Features da attivare:
-
keyctl
-
nesting
Configurare chiavetta cc25xx/26xx senza supporto usb dentro lxc:
da shell proxmox:
-
lsusb
esempio di risposta: ID 0451:16c8 Texas Instruments, Inc.
-
nano /etc/udev/rules.d/99-zigbee-serial.rules
Inserire nel file:
-
SUBSYSTEM=="tty", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16c8", MODE="0666", OWNER="root", GROUP="dialout", SYMLINK+="z2m"
-
ctrl+x
-
shift+y
-
invio
-
riavviare proxmox
Verificare il corretto riconoscimento via shell proxmox:
-
ls -la /dev/z2m
esempio di risposta: root root ...... /dev/z2m -> ttyACM0
-
ls -la /dev/ttyACM0
esempio di risposta: root dialout 166, ..... /dev/ttyACM0
-
nano /etc/pve/lxc/<id-lxc>.conf
Copiare le seguenti righe in fondo al file:
-
lxc.cgroup2.devices.allow: c 166:* rwm
-
lxc.mount.entry: /dev/z2m dev/ttyACM0 none bind,optional,create=file
Configurare chiavetta sonoff usb3 zigbee serie-P:
da shell proxmox:
-
lsusb
esempio di risposta: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
-
udevadm info -a -n /dev/ttyUSB0 | grep '{serial}'
esempio di risposta: `ATTRS{serial}=="ad456fr67t8f8yhg9fd"
-
nano /etc/udev/rules.d/99-zigbee-serial.rules
Inserire nel file:
-
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", ATTRS{serial}=="ad456fr67t8f8yhg9fd", MODE="0666", OWNER="root", GROUP="dialout", SYMLINK+="sonoff"
-
ctrl+x
-
shift+y
-
invio
-
riavviare proxmox
Verificare il corretto riconoscimento via shell proxmox:
-
ls -la /dev/sonoff
esempio di risposta: root root ..... /dev/sonoff -> ttyUSB0
-
ls -la /dev/ttyUSB0
esempio di risposta: root dialout 188, ..... /dev/ttyUSB0
-
nano /etc/pve/lxc/<id-lxc>.conf
Copiare le seguenti righe in fondo al file:
-
lxc.cgroup2.devices.allow: c 188:* rwm
-
lxc.mount.entry: /dev/sonoff dev/ttyACM0 none bind,optional,create=file
Conbee2
installazione di zigbee2mqtt:
-
apt install -y curl git
-
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
-
apt install -y nodejs
-
git clone https://github.com/Koenkk/zigbee2mqtt.git /opt/zigbee2mqtt
-
cd /opt/zigbee2mqtt
-
npm ci
-
nano data/configuration.yaml
copiate come configurazione minima questo
-
npm start
-
nano /etc/systemd/system/zigbee2mqtt.service
[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=root [Install] WantedBy=multi-user.target
-
systemctl start zigbee2mqtt
-
systemctl status zigbee2mqtt.service
-
systemctl enable zigbee2mqtt.service
AGGIORNAMENTO
-
systemctl stop zigbee2mqtt
-
cd /opt/zigbee2mqtt
-
cp -R data data-backup
-
git pull
-
npm ci
in caso di errore
error: Your local changes to the following files would be overwritten by merge:
package.json
-
git checkout HEAD -- package.json
-
cp -R data-backup/* data
-
rm -rf data-backup
-
systemctl start zigbee2mqtt
Touchlink
-
rm -rf node_modules && npm install
-
journalctl -u zigbee2mqtt.service -f