How to run ZWavejs2Mqtt

Hey guys,

right now I’m using Home Assistant & ZWavejs2Mqtt in Docker containers on my Synology NAS. Since with version 7.0 unfortunately the support of USB devices is discontinued, I am currently looking for an alternative how to run ZWavejs2Mqtt. I know there are some scripts that can be used to re-enable USB support on the Synology NAS. But don’t know if Synology will put a stop to that with an update in the future.

I still have an old Raspberry Pi 3 lying around, I read that you can run on ZWavejs2Mqtt on it. But is that stable? I used to run Open HAB on the Raspberry and it froze regularly.

Is there any way to export the configuration from ZWavejs2Mqtt and import it later after migration?

Do you know of any other ways I can integrate my Z-Wave devices back into HA?

Best regards!

I think you should be able to run zwavejs2mqtt on your Pi and use its websockets server to the HA zwavejs integration. I did that for a while in my testing. Now I have the 2 containers on the same server.

Personally, i use a shell script to run zwavejs2mqtt Docker container. The first line makes sure you have the latest image. Running in privileged mode means you do not need to worry about port and device mappings.

docker pull  zwavejs/zwavejs2mqtt:latest

docker run \
  -d \
  --restart=unless-stopped \
  --name zwavejs2mqtt \
--privileged \
--network=host \
-v /opt/zwavejs2mqtt:/usr/src/app/store \
zwavejs/zwavejs2mqtt:latest

1 Like

I’m Synology 7.0 on my DS718+ with a Z‐Stick Gen5 USB Controller plugged into it and execute the following script on start up to make it available to the docker image:

So far so good.

2 Likes

I run ZWaveJS2MQTT on one Pi in a docker container, and Zigbee2MQTT on another Pi in a docker container. Both are rock solid. Zigbee obviously communicates over the MQTT, but ZWaveJS I use the Websocket connection from Home Assistant. This has the advantage that the Pi can also be placed in the centre of your devices, which may result in a better experience for reliability, than whereever your Home Assistant machine happens to be.

2 Likes

I can only second this comment, I’ve been running the same setup with ZWaveJS2MQTT in docker as well on a Pi4 and it’s been extremely reliable.

1 Like

My ZWave one is running on an old Pi, I’m not even sure it is a 3B. It used to be run a presentation system.
With just the docker for ZWave and NodeRed (for RFXCommTRX433) it runs at about 5% CPU:

Computers-Home-Assistant

The spike was it automatically pulling a new ZWaveJS2MQTT image from Docker. (Using WatchTower)

1 Like

I’ve now installed the ZWavejs2Mqttcontainer on my raspberry pi 4. Until now it works very well. Unfortunately when I restored the backup into the ZWavejs2Mqtt cockpit, it uses a little bit other names for the entities as before. F.e. switch.computer_power_consumed_w was renamed to switch.computer_power_consumtion_w. I’ve absolutly no idea why this happened. But in result I had to adjust all my rules, automations and scripts in HomeAssistant. Took about 3 hours :frowning:
But now it works as before.

Do you have a tutorial on how to install watchtower on the Pi?

And what integration are you using for getting the system informations from the Pi to HomeAssistant?

I run a script called docker_containers_updater.sh using crontab.
it contains this single line:

docker run --rm -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --run-once --cleanup --include-stopped

I run it on the 2nd and the 9th of the month, because sometimes (frequently recently) a new Home Assistant update will require a newer ZWaveJS server API.

13 6 2,9 * * /home/pi/docker_container_updater.sh >/home/pi/docker_container_updater.txt 2>&1

As for the integration:

I run ZWAVEJS2MQTT and ZIGBEE2MQTT on a Raspberry PI 3B. Runs great. Like others this is run under Docker, but I do use Docker Compose as it makes updates easier as I don’t have to remember move than one command after I change the image version number. Here’s my Docker Compose file, hope it helps. As someone mentioned above I did this so I could place the controller in a central location in the house as the Home Assistant Server is in the basement and ZWAVE and ZIGBEE coverage was poor as it didn’t reach devices in the garage.

version: "3"
services:
  zwavejs2mqtt:
    container_name: zwavejs2mqtt
    image: zwavejs/zwavejs2mqtt:6.1.1
    restart: unless-stopped
    tty: true
    stop_signal: SIGINT
    networks:
      - zwave
    devices:
      - '/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave:rmw'
    volumes:
      - ./store:/usr/src/app/store
    ports:
      - '8091:8091'
      - '3000:3000'
  zigbee2mqtt:
    container_name: zigbee2mqtt
    image: koenkk/zigbee2mqtt:1.22.2
    volumes:
      - ./data:/app/data
      - /run/udev:/run/udev:ro
    devices:
      - /dev/zigbe
    ports:
      - '8080:8080'
    restart: always
    # network_mode: host
    privileged: true
    environment:
      - TZ=America/New_York
  portainer:
    container_name: portainer
    image: portainer/portainer-ce:2.11.0
    volumes:
      - portainer_data:/data
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - "9000:9000"
      - "9001:9001"
    restart: always
volumes:
  portainer_data:
networks:
  zwave: