1
0
mirror of https://github.com/balkian/zigbee2mqtt synced 2025-09-01 17:32:21 +00:00

Trying out the new version of zigbee2mqtt

This commit is contained in:
J. Fernando Sánchez
2025-08-12 23:13:15 +02:00
parent edf11eb6e4
commit 263cda43cb
3 changed files with 32 additions and 39 deletions

View File

@@ -2,11 +2,12 @@ This is just a simple environment with:
* zigbee2mqtt: a bridge from zigbee (through a zigbee USB stick) to MQTT * zigbee2mqtt: a bridge from zigbee (through a zigbee USB stick) to MQTT
* mosquitto: an MQTT server * mosquitto: an MQTT server
* home assistant: a home automation platform, with MQTT support. * ~~home assistant: a home automation platform, with MQTT support.~~
zigbee2mqtt also supports auto discovery for home assistant. ~~zigbee2mqtt also supports auto discovery for home assistant.~~ (disabled for now)
You'll need to configure zigbee2mqtt with a `z2m-data/configuration.yaml` file.
You'll need to configure zigbee2mqtt with a `z2m-data/configuration.yaml` file like this: 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 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. 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 More info here: http://balkian.com/controlling-zigbee-devices-with-mqtt.html

View File

@@ -1,34 +1,39 @@
version: '2.1'
services: services:
zigbee2mqtt: zigbee2mqtt:
image: koenkk/zigbee2mqtt image: koenkk/zigbee2mqtt:2.6.0
container_name: zigbee2mqtt container_name: zigbee2mqtt
restart: always restart: always
volumes: volumes:
- ./z2m-data/:/app/data/ - ./z2m-data/:/app/data/
- /etc/localtime:/etc/localtime:ro
- /run/udev:/run/udev:ro
devices: devices:
- "/dev/ttyACM0" - /dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B00039D6A85-if00:/dev/ttyACM0
networks: #networks:
- hass # - hass
environment:
- TZ=Europe/Madrid
- Z2M_ONBOARD_NO_SERVER=1
ports:
- 8080:8080
mqtt: mqtt:
image: eclipse-mosquitto image: eclipse-mosquitto
restart: always
ports: ports:
- 1883:1883 - 1883:1883
- 9001:9001 - 9001:9001
networks: #networks:
- hass # - hass
volumes: volumes:
- ./mosquitto.conf:/mosquitto/config/mosquitto.conf - ./mosquitto.conf:/mosquitto/config/mosquitto.conf
hass: # hass:
image: homeassistant/home-assistant # image: homeassistant/home-assistant
ports: # ports:
- "8123:8123" # - "8123:8123"
networks: # networks:
- hass # - hass
volumes: # volumes:
- ./hass-config:/config # - ./hass-config:/config
- "/etc/localtime:/etc/localtime:ro" # - "/etc/localtime:/etc/localtime:ro"
networks: #networks:
hass: # hass:
driver: overlay

View File

@@ -0,0 +1,2 @@
allow_anonymous true
listener 1883