Rebuild Z-wave routes via automation

I have a pretty robust Z-wave network made up of 700- & 800-series devices, as well as some legacy devices that I can’t find a current replacement for (Trane thermostat, for instance). 69 devices in total.

I have a two devices on the geographical fringe of my network that drop out frequently enough to be annoying… once or twice a week. Those ones are Jasco and Zooz switches. They’re two of probably six or seven devices in outbuildings that otherwise work well and route through a powered repeater in the garage. If I Rebuild Routes for those, they’ll start responding and work pretty much instantly. What’s odd is, they’re both in gang boxes with other identical Z-wave switches that are rock solid… for instance, I have two Zooz ZEN21 in one box, only one of which is troublesome. Those are the most-recently-installed switches, put in about a month ago in a four year-old network built up over time.

I’m using Zwave JS UI v3.17.0. The best answer is probably to figure out why these nodes are dropping and address that… but I’m wondering if there’s a way to trigger an automation that rebuilds the routes/heal the network instead.

Suggestions welcome!

You won’t be able to automate rebuilding routes in HA, there’s no feature to do so. It is not provided because for many users the process can make their network worse. It’s something you would usually do sparingly, most often when including new nodes or physically relocating existing ones.

See https://zwave-js.github.io/node-zwave-js/#/api/controller?id=rebuilding-routes for some details:

Contrary to popular belief, this process does not magically make the mesh better. If devices have a physically bad connection, assigning new routes will not help. In fact, it can make the situation worse by deleting routes that were found to be working and assigning other bad routes.

“Rebuild routes” used to be called “healing”, which is what most other software call the process, but the name was a bad choice because of what it actually does (throws away everything). Here’s another note on the renaming reasons: https://zwave-js.github.io/node-zwave-js/#/getting-started/migrating/v12?id=renamed-network-heal-to-rebuild-routes

Due to this, we’re often faced with feature requests for automatically and regularly performing a network heal. While this is certainly doable, it’s absolutely not a good idea.

That’s (probably) the reason why Home Assistant doesn’t support it via automation. If you really want to automate it, you’ll either need to dig into using the websocket API, or MQTT.

I’d suggest going through the “first steps” troubleshooting. The last step includes some notes about manually assigning routes, which might work better for you if it’s just these two devices. Assigning routes is possible in ZUI’s network map. https://zwave-js.github.io/node-zwave-js/#/troubleshooting/first-steps

2 Likes

This is the way!

Get a good repeater. I like the aeotec range extenders. Or add more AC powered devices

Rebuilding routes constantly may cause problems in other devices. I’ve also had devices at edge of my network crash my HA server. Best to just fix it.

1 Like

Thank you—I recall reading while researching this that manually assigning routes could lead to problems with future network heals; is there any truth to that?

Asked another way: are there any downsides to manually-assigning routes? I see some that could easily be improved (e.g., 4 hops to go 8 feet when there are like 10 line-powered Z-wave devices within 8 feet of the controller).

My network is 85% line-powered. Like I said, I do have a repeater/range extender, and I think it actually may be the Aeotec.

What throws me is that I don’t have issues with identical switches in the same gang boxes.

I’m going to start by looking at my reporting intervals to see if I can make any improvement there, and then check for S0-secured devices as suggested in the links above.

Look at dropped TX / RX in the device stats

I switch from trane to Honeywell T6. I like honeywell better

I doesn’t matter how many ac devices you have, if units are far away you must put extender to bridge the distance.

In my case I had fdevices too far away and their bad tx/rx were crashing my network. I eventually removed them and setup pi running ZwavejsUI in docker just for these nodes. A single extender couldn’t bride the distance so seperat network was best

In another case although all my light/fan switches are AC I had devices in concrete/metal room where I literraly must place Wi-Fi AP in adjoining room since area is so signal unfriendly. In this case extender placed close to door helped bride network.

Point being environment matters and in both theses case command dropped TX/RX was extremely high before solution was found. Also sometimes repeater is good fix and sometimes its useless but its placement is important

That aeotech extender has better reception/transmit than my GE/Jasco switches

Thanks, will do.

My use case requires an input for a temperature probe. Does the T6 have one?

I’ve got an extender. Confirmed, it’s the Aeotec Gen 7.

Is there any reason a chain of two extenders wouldn’t work?

No. What is purpose
Esp32 with probe maybe?

I pi running zwavejs or esp device may be best. When you start chaining extenders it begins to look real hacky and fragile. Best to use a real solution.

Does that device really need to be zwave?
If multiple devices definitely put another network dedicated to these devices at edge

Possibly. I have no ESP32 devices yet. It’s currently controlling a pool heater.

I’ve removed all periodic power reporting, and today I’ll investigate moving my only two S0 devices to S2. These are incremental changes that might make a difference, I’ll have to see.

I plan to use esp for temp and pressure for pool

Well, in the years I’ve been using it, that legacy thermostat has never caused me issues. What I don’t know is whether having it in my network is slowing things down.

I’ve getting dropped packets in the more distant devices… though, it’s only one at a time that has problems. Picture three buildings in a line; sometimes a device (always the same switch) in the middle building will drop, while the other four or five devices in that same building have no problems, and the devices in the farthest building still work. And sometimes it’s a device in that farthest building that drops while everything else works.

I’m not opposed to setting up a separate Z-wave network. I have an RPi I could use, and I’d just need a dongle. But I have no idea about setting it up. Any resources you know of would be helpful. And… in this case, Ethernet is impossible. I have decent WiFi signal to the middle building.

I would, and did:

Install Raspbian
Install ZwavejsUI in docker
Connect devices to new zwave network
In your main HA devices and services setup another zwave integration using the pi’s ip

You could setup the pi with HAOS but I’m honestly not sure if you could simply connect to the pi’s ip to get it into your main HA instance

Docker compose is best. It’ll make upgrade of zwavejsui easier when needed.

I have compose file if needed

1 Like

I’m running into an issue installing docker-compose:

I’ve run it again with --break-system-packages, and I get another error.

I continue on, installing Zwave JS UI… and it seems to work fine. I can edit docker-compose.yml; but I can’t get to the web UI, and I see no evidence that the container is starting even after a reboot:

I’m using the instructions here, though with the updated Zwave JS UI package. I’m SSH’d in to the RPi via WiFi. Not sure what’s failing here.

I have confirmed a solid connection to the RPi via SSH in the outbuilding… so as long as I can get a ZwaveJSUI installation on it, I should be good!

What OS are you using? For pi I use Raspbian.

Docker has its own instructions for install. Use that. There is a Linux package. I don’t use python install.

Post the compose you are using

When I ran that same shell script to install docker on my RPi it installed docker compose at the same time. I think your instructions are outdated.

That is why you shouldn’t use guides and just use the software docs

EDIT
That guide you used is just wrong. Websocket has been available since zwavejsui came out so mqtt never was needed

Don’t use MQTT and you don’t need MQTT. Use websocket.

I flashed Raspberry Pi OS 64-bit from the official imager menu. I’m using a RPi 3B+.

I’ll start from scratch and look for that.

The yml file? Here it is:

version: '3.7'
services:
  zwave-js-ui:
    container_name: zwave-js-ui
    image: zwavejs/zwave-js-ui:latest
    restart: always
    tty: true
    stop_signal: SIGINT
    environment:
      - SESSION_SECRET=mysupersecretkey
      # Uncomment if you want logs time and dates to match your timezone instead of UTC
      # Available at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
      #- TZ=America/New_York
    networks:
      - zwave
    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/insert_stick_reference_here:/dev/zwave'
    volumes:
      - zwave-config:/usr/src/app/store
    ports:
      - '8091:8091' # port for web interface
      - '3000:3000' # port for Z-Wave JS websocket server
networks:
  zwave:
volumes:
  zwave-config:
    name: zwave-config

This is the default one I pulled from here… I changed port #s but it’s otherwise the same.

They’re 100% outdated. I didn’t use MQTT, and instead pointed to the Zwave JS UI git.

From what I’m seeing here… maybe I need to start with the 32-bit OS?

I installed on the 64-bit OS using the same curl command and shell script you listed above. That was the only install I had to do for docker.

Is this what you literally have now?
You need to identify the location of the zwave stick and input it instead of the generic text

There isn’t a problem with the python install. The problem was the guide really. Guides get old and provide bad info a lot of times. Always read the real docs and understand the goal before using someone else’s bad suggestion. That includes those I’m providing :stuck_out_tongue_winking_eye: read the docs

No, I have my USB stick path in there… I had already restarted the re-installation and just pasted from the template.

My docker installation is failing now! Following the docs here, and I get to installing the docker packages and I get this:

E: Package 'docker-ce' has no installation candidate
E: Package 'docker-ce-cli' has no installation candidate
E: Unable to locate package containerd.io
E: Couldn't find any package by glob 'containerd.io'
E: Couldn't find any package by regex 'containerd.io'
E: Unable to locate package docker-buildx-plugin
E: Unable to locate package docker-compose-plugin

Didn’t you say you have the 64-bit OS installed?