This commit is contained in:
2025-04-27 22:49:13 +05:00
commit 80691765cf
6 changed files with 68 additions and 0 deletions

1
README.md Normal file
View File

@ -0,0 +1 @@
### Настройка Zigbee2mqtt и Mosquitto в compose

38
compose.yaml Normal file
View File

@ -0,0 +1,38 @@
services:
# Mosquitto MQTT Broker
mosquitto:
image: eclipse-mosquitto:latest
container_name: mosquitto
restart: unless-stopped
volumes:
- ./mosquitto/config:/mosquitto/config
- ./mosquitto/data:/mosquitto/data
- ./mosquitto/log:/mosquitto/log
ports:
- "1883:1883" # MQTT
- "9001:9001" # WebSocket (optional for some clients)
networks:
- zigbee_net
stdin_open: true
tty: true
# Zigbee2MQTT
zigbee2mqtt:
image: koenkk/zigbee2mqtt:latest
container_name: zigbee2mqtt
restart: unless-stopped
volumes:
- ./zigbee2mqtt/data:/app/data
- /run/udev:/run/udev:ro # Required for USB device access
devices:
- /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_XXXXXX:/dev/ttyACM0 # Replace XXXXXX with your adapter ID
environment:
- TZ=Europe/Berlin # Set your timezone
depends_on:
- mosquitto
networks:
- zigbee_net
networks:
zigbee_net:
driver: bridge

View File

@ -0,0 +1,8 @@
persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log
log_dest stdout
# Authentication (recommended)
allow_anonymous false
password_file /mosquitto/config/passwd

1
mosquitto/config/passwd Executable file
View File

@ -0,0 +1 @@
mqtt_user:$7$101$3OCcirPmV9xIk1oB$aJOZxmlgSqqZNWc4ditzK4goWswhFozmfzCaL1SGaiUfHhKr3bSXrqvdEQgxRmInmQMnhrIIrC1F2T1cFAMmog==

BIN
mosquitto/data/mosquitto.db Executable file

Binary file not shown.

20
mosquitto/log/mosquitto.log Executable file
View File

@ -0,0 +1,20 @@
1745775739: mosquitto version 2.0.21 starting
1745775739: Config loaded from /mosquitto/config/mosquitto.conf.
1745775739: Starting in local only mode. Connections will only be possible from clients running on this machine.
1745775739: Create a configuration file which defines a listener to allow remote access.
1745775739: For more details see https://mosquitto.org/documentation/authentication-methods/
1745775739: Opening ipv4 listen socket on port 1883.
1745775739: Opening ipv6 listen socket on port 1883.
1745775739: mosquitto version 2.0.21 running
1745775761: mosquitto version 2.0.21 terminating
1745775761: Saving in-memory database to /mosquitto/data//mosquitto.db.
1745775761: mosquitto version 2.0.21 starting
1745775761: Config loaded from /mosquitto/config/mosquitto.conf.
1745775761: Starting in local only mode. Connections will only be possible from clients running on this machine.
1745775761: Create a configuration file which defines a listener to allow remote access.
1745775761: For more details see https://mosquitto.org/documentation/authentication-methods/
1745775761: Opening ipv4 listen socket on port 1883.
1745775761: Opening ipv6 listen socket on port 1883.
1745775761: mosquitto version 2.0.21 running
1745775793: mosquitto version 2.0.21 terminating
1745775793: Saving in-memory database to /mosquitto/data//mosquitto.db.