Rebuild Z-wave routes via automation

You really should make an effort to understand what you are doing and not following instructions blindly without comprehension. 30 minutes on basic docker instruction would go a long way.

/dev/zwave on the right side of the colon would mean that within the container the device name is /dev/zwave. That’s fine, but in the UI settings you then need to use that name.

I’m over here in docker docs (and have been since yesterday) looking at various commands to try and figure out what each does. For starters, Linux is not something I use regularly. At all. So, I get fairly turned around quick.

I get what you’re saying about the device mapping. Makes sense. What I don’t know is whether just making these changes to docker-compose.yml on its own is enough, or whether I need to stop and start the container, re-run docker compose, etc. And, if it’s necessary, how to do that.

This path may be correct. I never used /dev/serial path and always created udev rule for mounting usb and pci devices. In the case of zwave I have udev rule to mount it at /dev/zwave. How you do it makes no difference, the overall requirment is choosing the correct path so just verify it is OK which I believe you did.

The system may heat and lock up specifically because path is good and communication error. Communiction problems with zwave stick can cause system lock. You may want to unplug/plug zwave dongle from usb. I actually had same thing happen to me yesterday when accidently started a second container that tried to connect to same dongle. Locked the dongle up and it stopped working on my system. unplugging/plugging fixed it but that something I hadnt seen in years.

/dev/ACM0 path may not be good path. It will fail quickly on bad path with same error. like I said, verify path is correct.

Try adding yourself to dialout group.

########################
#   Add User to Group  #
########################
# -a append
# -G group
# -u set uuid of user
# -U create group with users name and add to group
sudo usermod -a -G <group> <user>
groups <user> #to check groups of user

EDIT: sorry put above info with little context
you should run below to add yourself to dialout. I dont remember if this matters or not
sudo usermod -a G dialout <yourusernameonhost>

both are correct
ActualNameOnHost:WhatYouWantItCalledInDockerContainer

1 Like

make change in compose >> stop >> start
This is the way

its a lot. but your almost there. after you do it once its easier the next time

1 Like

Thank you - I’ve just successfully saved my settings in the UI with this path identified:

image

This matches the right side of my mapping in docker-compose.yml.

However, I still have this:

I drilled down into /dev/ttyACM0 via SSH. It’s there… but since I’m using that other path, I don’t think it matters. I was just trying it this morning to see if I could get anywhere with it.

I have the dongle plugged into a USB extension. I just removed the extension to see if that would do anything. If the dongle weren’t accessible… it wouldn’t appear when I check lsusb -v, would it?

Hm… is this a clue?

x@xxxxxxxxxxxx:~/zwavejsui $ lsusb -v
Bus 001 Device 006: ID 1a86:55d4 QinHeng Electronics 800 Z-Wave Stick
Couldn't open device, some information will be missing

There’s a lot more information after that, but I didn’t think it pertinent. Every other device that comes up has the same message.

A simple extension cable buy itself wont/shouldnt show on system

to skip a lot of steps you can temporarily try running the container in privileged mode.
I do this when connecting devices and run into trouble to rule out permission problems. And only do this with trusted container images to temporarily to test.

Thanks, I was able to start/stop the container.

Probably, but only incrementally. I touch this stuff very infrequently. And this is feeling like a dead end:

image

Again, I appreciate the help. I just don’t know where to go from here.

Agreed, but a bad cable might keep the device from being seen.

That’s with --privileged, correct? This isn’t working for me:

x@xxxxxxxx:~/zwavejsui $ sudo docker compose start --privileged
unknown flag: --privileged

Or maybe this is the commend I’m looking for…?

x@xxxxxxxx:~/zwavejsui $ sudo docker run zwave-js-ui --privileged
Unable to find image 'zwave-js-ui:latest' locally
docker: Error response from daemon: pull access denied for zwave-js-ui, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.

Sorry… I meant to say earlier that I have done this:

x@xxxxxxxxx:~/zwavejsui $ groups x
x : x adm dialout cdrom sudo audio video plugdev games users input render netdev spi i2c gpio lpadmin

add it to compose

services:
  my_service:
    image: my_image
    privileged: true

Thanks - I’ve done this. My docker-compose.yml is now:

version: '3.7'
services:
  my_service:
    image: zwave-js-ui
    privileged: true
  zwave-js-ui:
    container_name: zwave-js-ui
    image: zwavejs/zwave-js-ui:latest
    restart: always
    tty: true
    stop_signal: SIGINT
    environment:
      - SESSION_SECRET=xxxxxxxxxxxxxx
      # 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/usb-Zooz_800_Z-Wave_Stick_533D004242-if00:/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

The serial port in my UI is id’d as /dev/zwave. I’ve rebooted the RPi and refreshed the interface. I still have the error, Driver: Failed to open the serial port: Error: No such file or directory, cannot open /dev/zwave (ZW0100)...

I’ve changed the path a couple of times in order to save the new settings; I went from /dev/zwave (correct/desired) to /dev/ttyACM0 (potentially correct as well) back to /dev/zwave. The error has remained. I’ve stopped and restarted the container several times to make sure. I keep getting this warning, but I doubt it’s in any way significant:

WARN[0000] /home/josh/zwavejsui/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion

In the application logs, it just keeps cycling this:

2024-12-13T20:15:25.503Z DRIVER   β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—        β–ˆβ–ˆβ•—    β–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—          β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
                                  β•šβ•β•β–ˆβ–ˆβ–ˆβ•”β•        β–ˆβ–ˆβ•‘    β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β•β•          β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β•β•β•
                                    β–ˆβ–ˆβ–ˆβ•”β•  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—            β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
                                   β–ˆβ–ˆβ–ˆβ•”β•   β•šβ•β•β•β•β• β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•”β•β•β•       β–ˆβ–ˆ   β–ˆβ–ˆβ•‘ β•šβ•β•β•β•β–ˆβ–ˆβ•‘
                                  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—        β•šβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘  β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—     β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
                                  β•šβ•β•β•β•β•β•β•         β•šβ•β•β•β•šβ•β•β•  β•šβ•β•  β•šβ•β•   β•šβ•β•β•β•   β•šβ•β•β•β•β•β•β•      β•šβ•β•β•β•β•  β•šβ•β•β•β•β•β•β•
2024-12-13T20:15:25.507Z DRIVER   version 14.3.7
2024-12-13T20:15:25.509Z DRIVER   
2024-12-13T20:15:25.510Z DRIVER   starting driver...
2024-12-13T20:15:25.512Z DRIVER   opening serial port /dev/zwave
2024-12-13T20:15:34.551Z DRIVER   Failed to open the serial port: Error: No such file or directory, cannot open 
                                  /dev/zwave
2024-12-13T20:15:34.555Z DRIVER   destroying driver instance...
2024-12-13T20:15:34.560Z DRIVER   driver instance destroyed

OK… I don’t know what to think of this, but on a whim I added /dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D004242-if00 as my device path in the UI… and everything came to life. Successful scan… and it looks like it’s ready to pair devices! Now… why would that be, when the device is mapped to /dev/zwave? I’m on the verge of not caring because it looks like it’s working… but I am trying to learn what’s happening here.

I removed the privileged mode section from docker-compose.yml, and it still works fine.

maybe its the single quote?
Maybe it should be double quote or nothing. I have no quote for devices.

  zwavejs:
    container_name: zwavejs
    hostname: zwavejs  
    privileged: false
    restart: unless-stopped
    image: docker.io/zwavejs/zwave-js-ui:9.26.0
    devices:
      - /dev/zwave0:/dev/zwave0  
    volumes:
      - "/srv/zwavejs/application/usr_src_app_store:/usr/src/app/store"
      - "/etc/localtime:/etc/localtime:ro"
    ports:
      - "3000:3000/tcp"
      - "8091:8091/tcp"
    networks:
      - dockerlocal

anyway. looks like working

I’ve only seen examples with a single quote. So, maybe I’ll try it without quotes.

Well… it appears I spoke too soon. I brought the RPi out to the building where I successfully tested the WiFi signal a few days ago… and it won’t hold a connection. I can ping it for a few minutes after boot–with really low latency–but the connection drops soon after. This, with my laptop sitting right next to it with a solid connection.

I don’t have it in me to fight this any more today. I really appreciate everything you’ve done to get me to this point. From here, either I’ll get this thing to hold onto a WiFi connection, or I won’t.

1 Like