Photo by claire jones on Unsplash
IslandBridge Dock(er)s and (z)Waves
Adding docker to a bare Pi3 and running zwavejs2mqtt in a container
In the previous article in the series, I briefly went over what I wanted to set up: a Z-Wave and Zigbee to Home Assistant bridge. That was two years ago. As often happens, I just dove in and didn't take many notes along the way. However, I can say with certainty that this has worked very well for the last two years! Below are the configs that I have been using.
Zigbee2mqtt docker-compose.yaml
version: '3.8'
services:
zigbee2mqtt:
restart: unless-stopped
image: koenkk/zigbee2mqtt
volumes:
- ./data:/app/data
- /run/udev:/run/udev:ro
environment:
- TZ=America/New_York
devices:
- '/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2400118-if00:/dev/ttyACM0'
labels:
- "traefik.http.routers.zigbee2mqtt.rule=Host(`zigbee2mqtt.internal.murawsky.net`)"
- "traefik.http.services.zigbee2mqtt.loadbalancer.server.port=8080"
networks:
- web
networks:
web:
external: true
zwavejs2mqtt docker-compose.yaml
version: "3.7"
services:
zwavejs2mqtt:
container_name: zwavejsui
image: zwavejs/zwave-js-ui:latest
restart: unless-stopped
tty: true
stop_signal: SIGINT
environment:
- ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db
- TZ=America/New_York
env_file:
- ./secrets.env
devices:
# Do not use /dev/ttyUSBX serial devices, as those mappings can change over time.
# Instead, use the /dev/serial/by-id/X serial device for your Z-Wave stick.
- '/dev/serial/by-id/usb-Silicon_Labs_Zooz_ZST10_700_Z-Wave_Stick_0001-if00-port0:/dev/zwave'
volumes:
- zwave-config:/usr/src/app/store
ports:
- "3000:3000" # port for Z-Wave JS websocket server
labels:
- "traefik.http.routers.zwavejs2mqtt.rule=Host(`zwavejs2mqtt.internal.murawsky.net`)"
- "traefik.http.services.zwavejs2mqtt.loadbalancer.server.port=8091"
networks:
- web
networks:
web:
external: true
volumes:
zwave-config:
name: zwave-config
Traefik docker-compose.yaml
Both services exist behind the traefik reverse proxy, also running via docker.
version: '3'
services:
reverse-proxy:
# The official v2 Traefik docker image
image: traefik:v2.8
restart: unless-stopped
# Enables the web UI and tells Traefik to listen to docker
# --serverstransport.insecureskipverify=true
command: --api.insecure=true --providers.docker --metrics.prometheus=true
ports:
# The HTTP port
- "80:80"
# The Web UI (enabled by --api.insecure=true)
- "8080:8080"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
networks:
- web
networks:
web:
external: true
Closing Thoughts
Better late than never! ๐ This system has worked very well with almost no hiccups at all. It integrated easily with Home Assistant as well.
ย