From 263cda43cb15d290c327235f6545cd7ec612ff2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Fernando=20S=C3=A1nchez?= Date: Tue, 12 Aug 2025 23:13:15 +0200 Subject: [PATCH] Trying out the new version of zigbee2mqtt --- README.md | 24 +++++------------------- docker-compose.yml | 45 +++++++++++++++++++++++++-------------------- mosquitto.conf | 2 ++ 3 files changed, 32 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 52c201a..2b57fc8 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,12 @@ This is just a simple environment with: * zigbee2mqtt: a bridge from zigbee (through a zigbee USB stick) to MQTT * mosquitto: an MQTT server -* home assistant: a home automation platform, with MQTT support. -zigbee2mqtt also supports auto discovery for home assistant. +* ~~home assistant: a home automation platform, with MQTT support.~~ +~~zigbee2mqtt also supports auto discovery for home assistant.~~ (disabled for now) - -You'll need to configure zigbee2mqtt with a `z2m-data/configuration.yaml` file like this: +You'll need to configure zigbee2mqtt with a `z2m-data/configuration.yaml` file. +There is an onboarding web interface that is quite convenient, but I have disabled it . +Just comment out the appropriate line (`Z2M_ONBOARD_NO_SERVER=1`) or create your own file like so: ``` homeassistant: true @@ -18,19 +19,4 @@ mqtt: port: /dev/ttyACM0 # The serial device. It should be the same as the device entry in docker-compose.yml. ``` - -After running home assistant the first time, you will have to add the mqtt configuration to the config file: - -``` -mqtt: - broker: mqtt - discovery: true - birth_message: - topic: 'hass/status' - payload: 'online' - will_message: - topic: 'hass/status' - payload: 'offline' -``` - More info here: http://balkian.com/controlling-zigbee-devices-with-mqtt.html diff --git a/docker-compose.yml b/docker-compose.yml index 31ae6e2..1c3115d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,34 +1,39 @@ -version: '2.1' services: zigbee2mqtt: - image: koenkk/zigbee2mqtt + image: koenkk/zigbee2mqtt:2.6.0 container_name: zigbee2mqtt restart: always volumes: - ./z2m-data/:/app/data/ + - /etc/localtime:/etc/localtime:ro + - /run/udev:/run/udev:ro devices: - - "/dev/ttyACM0" - networks: - - hass + - /dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B00039D6A85-if00:/dev/ttyACM0 + #networks: + # - hass + environment: + - TZ=Europe/Madrid + - Z2M_ONBOARD_NO_SERVER=1 + ports: + - 8080:8080 mqtt: image: eclipse-mosquitto + restart: always ports: - 1883:1883 - 9001:9001 - networks: - - hass + #networks: + # - hass volumes: - ./mosquitto.conf:/mosquitto/config/mosquitto.conf - hass: - image: homeassistant/home-assistant - ports: - - "8123:8123" - networks: - - hass - volumes: - - ./hass-config:/config - - "/etc/localtime:/etc/localtime:ro" -networks: - hass: - driver: overlay - +# hass: +# image: homeassistant/home-assistant +# ports: +# - "8123:8123" +# networks: +# - hass +# volumes: +# - ./hass-config:/config +# - "/etc/localtime:/etc/localtime:ro" +#networks: +# hass: diff --git a/mosquitto.conf b/mosquitto.conf index e69de29..76c1e95 100644 --- a/mosquitto.conf +++ b/mosquitto.conf @@ -0,0 +1,2 @@ +allow_anonymous true +listener 1883