← Tutte le guide
Zigbee2MQTT
A free, open-source bridge that connects a USB Zigbee adapter to an MQTT broker -- lets Home Assistant/Node-RED control Zigbee smart-home devices without needing each vendor's own proprietary hub.
Sistema: Any Docker host with a USB Zigbee adapter attachedHome AutomationIoTSito ufficiale ↗Documentazione ufficiale ↗
Questa guida è redatta a partire dalla documentazione ufficiale di Zigbee2MQTT, linkata sopra — verifica sempre lì i nomi esatti di pacchetti/versioni prima di eseguire questi comandi su un server di produzione, poiché le versioni della distribuzione e del progetto cambiano nel tempo.
1Identify your Zigbee USB adapter's device path
Use the stable /dev/serial/by-id/... path rather than /dev/ttyUSB0 -- the latter can shift to a different number after a reboot if you have more than one USB serial device.
ls /dev/serial/by-id/2Create a configuration.yaml
mkdir -p zigbee2mqtt-datacat > zigbee2mqtt-data/configuration.yaml <<'EOF' mqtt: base_topic: zigbee2mqtt server: mqtt://<your-mosquitto-server-ip>:1883 serial: port: /dev/serial/by-id/your-adapter-path-here frontend: port: 8080 EOFRequires an MQTT broker (see the Mosquitto guide in this section) already running and reachable.
3Run the container
docker run -d \ --name zigbee2mqtt \ --restart unless-stopped \ -v "$(pwd)/zigbee2mqtt-data:/app/data" \ -v /run/udev:/run/udev:ro \ --device=/dev/serial/by-id/your-adapter-path-here \ -p 8080:8080 \ koenkk/zigbee2mqtt4Open the frontend and pair a device
Click "Permit join" and put your Zigbee device into pairing mode (varies by device/brand) -- it should appear in the device list within a few seconds.
http://<the-server's-ip>:8080