Actually, there is an elegant way to do it. If you see my long post it may look discouraging, but just read it carefully, and try it for happy results.
For those who still have the question of “mesh over wifi with 2 zb bridges”: You can only use a second(or a third) zbBridge to extend Zb to Zb, but not over WIFI/LAN, therefore when you have an isolated area, the only solution is to use a totally separated Zb Network on a second bridge.
This is how i did it:
My setup - all on a Synology Diskstation(but it could work just the same on a Raspberry Pi):
- Home Assistant on Docker(no supervisor, therefore no Add-ons) - I assume you have it already
- MQTT Broker on docker - I assume you have it already
- 2 separate containers running an instance of Zigbee2MQTT for each individual bridge
- 2 Sonoff ZbBridges, both flashed with Tasmota
The 2 Zigbee2MQTT containers/services, are reading the data from the 2 ZB Bridges over IP(see configuration.yaml), and pushes the data into my only real MQTT Broker which is running on docker. And since everything from my MQTT Broker is available in HA, that was it… easy-peasy.
Now that the concept is clear, here is the docker-compose.yaml and the config files from the two zigbee2mqtt instances, and some instructions on how to replicate the setup:
-
Let’s create 1 folder called zigbee2mqtt, then 2 sub-folders inside of it. Each sub-folder will contain only one file - the configuration.yaml for each of the bridges. In my case I have called the two sub-folder “data_keller” and “data_home” since I have a zbBridge inside home and another one in keller(underground)
-
Inside the zigbee2mqtt folder create the following docker-compose.yaml file:
version: '3.8'
services:
zigbee2mqtt_zbBridge_keller:
container_name: zigbee2mqtt_zbBridge_keller
image: koenkk/zigbee2mqtt
restart: unless-stopped
volumes:
- ./data_keller:/app/data
- /run/udev:/run/udev:ro
ports:
# Frontend port
- 38080:8080
environment:
- TZ=Europe/Berlin # adapt if different location
zigbee2mqtt_zbBridge_home:
container_name: zigbee2mqtt_zbBridge_home
image: koenkk/zigbee2mqtt
restart: unless-stopped
volumes:
- ./data_home:/app/data
- /run/udev:/run/udev:ro
ports:
# Frontend port
- 38081:8080
environment:
- TZ=Europe/Berlin # adapt if different location
# even though permit_join: false, new devices can be added through the UI: http://<docker_host>:3880 -> Settings ->Permit Join - check box and uncheck after joining the device !!! don't let it active, otherwise your unwanted devices will be paired automatically.
- Inside the two sub-folders, create a configuration.yaml with the following content(of course, adapted for your network):
homeassistant: true
permit_join: false
frontend: true
mqtt:
base_topic: zigbee2mqtt_<room_name_where_the_bridge_is_located>
server: mqtt://<your_mqtt_broker_ip_without_port_number>
include_device_information: true
serial:
port: tcp://<your_tasmota_zb_bridge_ip>:8888
adapter: ezsp
advanced:
homeassistant_legacy_entity_attributes: false
legacy_api: false
legacy_availability_payload: false
device_options:
legacy: false
- Make sure you are in the zigbee2mqtt folder you just created at step 1, and execute
docker-compose up -d
on your docker host and it should just work
Mentions:
- Both zgbee2mqtt instances can be operated from the Web Interface. Open the browser, and type the docker_host_ip and the port number configured on your configuration.yaml. In my case, synology is the host so: http://192.168.1.5:38080. → play around and have some fun
- base_topic in configuration.yaml can be fully customizes; it does NOT have to start with
zigbee2mqtt_
. However, if you have multiple bridges, make sure each bridge have it’s own base_topic.
- permit_join: false in my configuration.yaml may be confusing, but I control that parameter from the WebUI and I don’t keep it True to avoid joining unwanted devices… Zigbee can quickly become a mess.
- configuration.yaml may / will be different when you try to open it from time to time; the reason is that if you configure something from the Web UI, it will be changed in the configuration file… so a simple docker restart will not reset the Zigbee2MQTT to the configuration you initially wrote in your config file.
- this setup works with both HA in docker container or HA with supervisor… since the ZB(devices + bridges + zigbee2mqtt) are only communicating with your MQTT Server.
- all devices will be available in HA through the MQTT integration, therefore you can get rid of your Zigbee integration.
- if there are some docker beginners reading this, watching a few youtube videos about “first steps in docker” or “docker-compose how-to” could quickly provide the necessary knowledge.
- all private details(ip addresses, etc.) have been modified or censored
If i am mistaken somewhere, or something does not work to you, let me know in a comment.