Home Assistant Setup with Z-Wave device

I know the new release is right around the corner, and it might be best to wait, but I am curious now.

I have HomeAssistant installed on my Truenas box, and I just got a Z-Wave USB hub. I want to set up the Z-wave, but I need the hostname of the home assistant install to make that work.

The Zwave integration in HA defaults to…

ws://localhost:3000

Where do I find the hostname for the home assistant installation?

When I tried

ws://myip:20810

This didnt work it tried then failed.

Hang in there, there are people her who know how to do this kind of stuff. I wish it were me. I’m still upset that I can’t find a long-lasting switch. The longest I have so far is 3.5 years. It wouldn’t be so bad if it were not in two 4-gang boxes. Lots of wires!

I’ll be watching to see how this goes for you.

@Rocketplanner83 - Are you using one of the TrueNAS apps? If so, you need to find the Z-Wave JS container name and use that. There used to be a TrueCharts tool that helped figure it out, but the web page has been removed. I know nothing about Kubernetes, so I can’t provide any commands that may help.

Honestly, I would stay away from the TrueNAS apps for Home Assistant. They provide their own configuration file, which is missing some of the necessary default entries. They also use an external database, which is really only needed for advanced users who know why they need it and should not be part of a beginner setup. (Years ago, the Home Assistant team recommended an external database for large setups, but that’s no longer the case)

If / when you’re on SCALE Electric Eel - I would recommend using the official Home Assistant docker with the configuration file it comes with. In this case (at least with docker-compose), you can specify the container name in your compose file. I switched to HAOS a few years ago, but here are the Home Assistant and ZWave JS entries from my old compose file. (I was using ‘macvlan’ to give my containers their own IP address and Pi-Hole for DNS)

With the following compose file I was using ws://zwavejs:3000 to configure the zwave integration.

version: '3.7'

networks:
  vlan:
    driver: macvlan
    driver_opts:
      parent: eno1
    ipam:
      config:
        - subnet: 10.10.1.0/24

services:
  homeassistant:
    image: homeassistant/home-assistant:stable
    container_name: homeassistant
    volumes:
      - ./homeassistant/config:/config
      - /etc/localtime:/etc/localtime:ro
    dns: 10.10.1.6
    networks:
      vlan:
        ipv4_address: 10.10.1.18
    restart: unless-stopped

  zwavejs:
    image: zwavejs/zwave-js-ui:latest
    container_name: zwavejs
    devices:
      - /dev/serial/by-id/usb-0658_0200-if00:/dev/serial/by-id/usb-0658_0200_if00:rmw
    volumes:
      - ./zwavejs/store:/usr/src/app/store
      - /etc/localtime:/etc/localtime:ro
    dns: 10.10.1.6
    networks:
      vlan:
        ipv4_address: 10.10.1.15
    restart: unless-stopped
    stop_signal: SIGINT
    tty: true

P.S. - I am not a docker expert - I only learned enough in one afternoon to get Home Assistant running.


I’m still using some of the original Zwave switches from Inovelli that I deployed in 2018. I also have some of the newer Red and Black series switches deployed. In total, I have 23 Inovelli Zwave switches deployed. Only one switch ever has died on me. They make ZigBee and Matter switches as well, and I would expect the same quality and longevity from those as well.

1 Like

@troy I am currently using the HA TrueNAS app but havent gotten very far. I was thinking of installing Home Assistant via docker and Jailmaker. But havent started that yet.

From what I understand In order to use the Zooz 800 Series Z-Wave Long Range S2, I bought I have to install Z-wave JS on the truenas box somehow. Ive been looking for a docker compose for Z-Wave JS and not had too much luck so far.

I did stumble across this Z-Wave JS · GitHub But I am not sure how that helps me right now.

You tagged the wrong Troy. I’m @troy - Unless you were trying to get someone else?

I would go with Docker / Jailmaker. What you’re looking for is ZWave-JS-UI. In my last reply, there’s a basic compose example using local folders (not volumes).

Link to the docs: HERE

And to their docker-compose example: HERE


EDIT: To be clear, Zwave JS UI includes Zave JS. You can use Zwave JS UI with the Zwave Home Assistant integration connected through the web socket. Using Zwave JS UI with Home Assistant does not require MQTT or MQTT discovery.

1 Like

@troy

I don’t know if you can point me in the right direction. I have the docker compose for zwave-js-ui in a dockge jail on trueNASA scale.

I am struggling to identify the USB Zwave serial. I thought I got it as “/dev/serial/by-id/ttyACM0”, but that didn’t work.

When I try that, I get this error during deployment.

Error response from daemon: error gathering device information while adding custom device “/dev/serial/by-id/ttyACM0”: no such file or directory

In the TrueNAS shell, I tried “dmesg | grep tty” to find the USB, but nothing returned. I know it is plugged in, so I am a bit stumped.

Hold I just tried that again and got this result.

> admin@Odin[~]$ sudo dmesg | grep tty
> [    0.000000] Command line: BOOT_IMAGE=/ROOT/24.04.2@/boot/vmlinuz-6.6.32-production+truenas root=ZFS=boot-pool/ROOT/24.04.2 ro console=tty1 console=ttyS0,9600 libata.allow_tpm=1 amd_iommu=on iommu=pt kvm_amd.npt=1 kvm_amd.avic=1 intel_iommu=on zfsforce=1 nvme_core.multipath=N
> [    0.014794] Kernel command line: BOOT_IMAGE=/ROOT/24.04.2@/boot/vmlinuz-6.6.32-production+truenas root=ZFS=boot-pool/ROOT/24.04.2 ro console=tty1 console=ttyS0,9600 libata.allow_tpm=1 amd_iommu=on iommu=pt kvm_amd.npt=1 kvm_amd.avic=1 intel_iommu=on zfsforce=1 nvme_core.multipath=N
> [    0.049857] printk: console [tty1] enabled
> [    0.050123] printk: console [ttyS0] enabled
> [   52.335558] serial8250: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
> [   84.981849] systemd[1]: Created slice system-serial\x2dgetty.slice - Slice /system/serial-getty.
> [  100.938360] cdc_acm 1-8:1.0: ttyACM0: USB ACM device

Which is the right serial to snag?

@Rocketplanner83 - Try this in the TrueNAS shell:

 ls /dev/serial/by-id/

hey thank you!

Do I use the whole thing?

usb-Zooz_800_Z-Wave_Stick_533D004242-if00

this is the part that I am getting stuck at

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’

I thought that it should just be - ‘/dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D004242-if00:/dev/zwave’

However, that isn’t working. I am getting the same error.

You’re close, just don’t include the :/dev/zwave at the end. So, it should be

/dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D004242-if00

EDIT:
Shit I just realized you’re talking about the compose file.

I would use

    devices:
      - /dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D004242-if00:/dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D004242-if00:rmw

and in the Zwave JS settings you would use:

/dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D004242-if00

I should note. The above should work in Electric Eel using docker without the jail. I don’t know if you need to do any extra steps to get the Zwave device passed into the jail. That could be your issue

@troy, I want to say thank you for working through this with me. I tried what you recommended above, and I got the error below.

I wonder if @Stux could help with the USB passthrough to the docker jail. As @Troy mentioned, that might be the problem.

daemon: error gathering device information while adding custom device “/dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D004242-if00”: no such file or directory

This is how my compose is right now.

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=xxxxxx
- ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db
# Uncomment if you want log times and dates to match your timezone instead of UTC
# Available at List of tz database time zones - Wikipedia
#- TZ=America/New_York
networks:
- zwave
devices:
#- /dev/serial/by-id/Stick_533D004242-if00:/dev/zwave
- /dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D004242-if00:/dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D004242-if00:rmw
volumes:
#- zwave-config:/usr/src/app/store
# Or by using local folder
- ./store:/usr/src/app/store
ports:
- 8091:8091 # port for web interface
- 3000:3000 # port for Z-Wave JS websocket server
networks:
zwave: null
volumes:
zwave-config:
name: zwave-config

I’m not at all familiar with the sandbox / jails aspect. We know the device shows up correctly on TrueNAS, and I’m 99% certain your compose file is correct (at least the device passthrough, anyway)

Is there a way to access the jail shell? If so, I think you want to try this command inside the jail and see if the device shows up.

 ls /dev/serial/by-id/

Sorry I can’t help beyond that

1 Like

You are right. It can’t be seen inside the docker jail!

That is the next thing to tackle.

In the jail I tried

–bind=‘/dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D004242-if00:/dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D004242-if00:rmw’

That was wrong the jail didn’t start.

If I were going to take a guess - I would try:

–bind='/dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D004242-if00'

But I wouldn’t know where or when to run that. I assume it looks like an argument to use when creating the jail. I really can’t say for sure.

I would also assume you must run whatever command is needed outside the jail.

I think this could work, but then I would need “:/dev/zwave” inside the jail, and then the docker-compose could grab that to use for the app.

I tried this, and jlmkr didn’t start

–bind=‘/dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D004242-if00:/dev/zwave’

So this deals more with folders - and warns not to mount root directories (among other /dev)

But based on that, Maybe try

–bind='/dev/serial:/dev/serial'

Only took a quick glance but I don’t see anything in @Jip-Hop docs related to mounting a single file (or in this case device)

I don’t know how much is configured on TrueNAS or how mission-critical it is, but maybe you can consider upgrading TrueNAS to the EE beta - I don’t want to suggest you compromise the rest of NAS, but it would certainly simplify using ZWave with Home Assistant.

I did try this and it didn’t work.

I think you may be right i might be barking up the wrong tree.

@troy I am on 24.10 now. I have the zwave serial device mapped into the docker container (inside dockage), but I get an error inside z-wave JS UI…

image