Z-NET Integration with HA

Here is my implementation of the LED status light on the Z-net board:
ZWave-JS-UI status via Z-NET LED

I want to switch from HS4 to HA and would like to keep my Znets if possible. I have tried to follow this article, which is great, but I am stuck at step #7.

I did some troubleshooting had I assume this is my issue, but I don’t know how to fix it. When I do a Telnet to the ZNet, I get this error. “Port already in use. Connection Lost”

I have disabled the Znet in HS4, tested multiple time, but the same error. Could this be causing my ZNet not to connect to Home Assistant?

Thanks!


HS 4 Error 4


Getting Closer!

  1. The connection is lost issue was due to the Znet still being connected to the HS4 Console. I disabled the Interface in HS4 and then had the ZNet reboot. Waited for the red light and was able to connect to the ZNet with Zwave UI.

Next issue now is with the Encryption Keys that HS4 shows. They are not 32 characters for the S2 Unauthenticated or S2 Access Key.

HS4 removes leading zeros in the key. This solved the issues

I think I am onto the final step. I cannot get a connection to the WS address with the Zwave.

  1. Navigate to Settings > Devices & Services, then click the ADD INTEGRATION button and select Z-Wave.

I get connection failed. What could be causing this?


I was able to get this sorted. It was the issue of putting the WS address in multiple locations. (Hope this can help someone else out)

@mterry63 - I am looking to do the same as you with two ZNet devices. Are you able to point me in the right direction to set up the second ZNet device with Home Assistant? I have one working with Zwave JS UI, but not sure where to configure the second ZNet. TIA!

With 2 Z-Nets you would need 2 instances of Z-wave-JS UI (ideally). You could use 1 Z-wave-JS UI and 1 Z-wave JS, but I wouldn’t recommend it.

This post Zwave-JS-UI on Znet via docker - Configuration / Z-Wave - Home Assistant Community (home-assistant.io) shows how to run Z-wave-JS UI directly on the Z-Net. If I were to add a second Z-Net I would go this route. Then you can add a second Z-wave integration and point it directly at the Z-net. If you did this on both Z-Nets you can eliminate the Z-Wave-JS UI Addon.

Not for the faint of heart, but if you’re reasonably technical these are step by step directions. @goldriver has posted here and the HomeSeer forum on how to get this running.

If you copy your Z-Net image before starting it should be to recover back to square 1.

Maybe someone can make an image and host it of these mods.

Thanks! I am technical enough to put Zwave-JS UI on the Znet and will check this out!

My HA is a VM with one Znet in the same location and anther remote.

  1. Do I just transfer one Znet to a USB stick and run the other from the remote location?
  2. Try to add another Zwave-JS UI - Which I am googling to see how feesable this is in AH.
  3. As you stated, add Zwave-JS UI to the Znet.

I was leaning toward the multiple Zwave-JS UI, but feel now the USB stick might be a better path.

A USB stick doesn’t solve the problem, you still need 2 copies of Z-Wave-JS UI to run 2 Z-Wave Networks whether they are Z-Net or standard USB. 99% of Home Assistant users don’t have multiple Z-Wave networks. It can be done, but there won’t be a lot of examples.

You need 2 of each:

Z-Wave-JS Integration ↔ Z-wave-JS-UI (Docker is a good choice) ↔ Z-Wave Hardware Controller

Home Assistant natively supports multiple Integrations (Note the Add Hub button)
image

Home Assistant doesn’t support 2 Z-Wave-JS-UI Addons out of the box. You can run an addon and an external copy of Z-Wave-JS UI (Like on the Z-Net) or it could be on another host, lots of choices.

Of course, each instance of Z-Wave-JS UI only supports 1 Z-wave hardware device, whether it be a USB based controller or the EZee Pi HAT in the Z-Net.

Setting up multiple Z-Wave Networks is simple. You just need to do 5 things.

  1. Install a second copy of Z-Wave JS UI.
  2. Enable the websocket server in the settings.
  3. If your new install is on the same subnet as your home assistant install it will automatically show up in the integration settings. The home id displayed when you hover over the information icon in the top right corner of Z-Wave JS UI is the same one that will be displayed in home assistant.
  4. Click configure to set it up.
  5. Every network you create will have a default name of Z-Wave JS so I recommend to rename it to something more descriptive.

brave_screenshot (18)


brave_screenshot (17)

Thanks @cornellrwilliams. I am struggling how to do step 12c 1. Install a second copy of Z-Wave JS UI.

I cannot do this through HA under Settings | Add-Ons. Any links on how to do this? Can I configure this in YAML?

I get what to do if I can get the second Zwave-JS UI into HA.

You need to go to:

Settings/Devices & Services/ Z-Wave then press the ‘ADD HUB’

It makes sense, @goldriver , but forgive my additional questions. I am not connecting the dots on the two Zwave-JS UI and 2 Znets since it seems I need two unique WebSockets Addresses.

In ZWave-JS UI I can only configure one Zwave device via the Serial Port

Then, when I add a new hub, I cannot add the other Znet because it is not USB and requires a Serial to TCP connection, which I believe I can only do with Zwave-JS UI, which gives me a WS address for the additional Zwave Hub.

When I moved from Vera to HS4, I did this because HS supported multiple Zwave Environments in one UI, and I thought the ZNets, being IP-based, would be better between locations for flexibility in centrally locating the Zwave sticks. My locations are close (within 200’ of each other), and I wonder if one Zwave environment would be better now.

I am trying to determine if two Zwave environments are custom in HA (it seems not); however, two Zwave-JS UIs seem to be my current issue. Since the ZNets are IP-based, from my reading, I must have a Zwave-JS UI as the front end for each.

My dilemma is: Should I abandon the Znets and move to ZooZ 800 or keep them? I am trying to keep the Znets, but I cannot figure out how to get the second Znet into HA.

I hope this makes sense, and your help is appreciated!

In Z-Wave JS UI you enter the TCP IP address of the Z-NET the in Home Assistant you enter the websocket address of of your Z-Wave JS UI Install.

You can’t install two instances of the same add-ons, unless you copy it and host it yourself with a new repository ID:

I would guess most people who have more than one network aren’t using HAOS, or at least aren’t using add-ons. You can run more than one Z-Wave JS UI via docker or standalone binary, on other hosts.

Another option is to run Z-Wave JS UI natively on the Z-Net, then it’s just a matter of connecting the integration to it:

Update: I did some testing with the ZooZ stick.

  1. ZooZ Pro - Zwave devices show the Manufacturer and Model in the Zwave configuration
  2. ZooZ Pro - Zwave device sensors show up properly in HA too
  3. Distance Con - I cannot add some devices as they are too far away from the ZooZ stick. Some will add and others will not, but devices far away ultimately show Dead after a few minutes. I only assume based on distance away from the controller (even after rebuilding routes). I am able to add plugin devices when I move them closer to the ZooZ. However, when I move them back and rebuild the routes, they show dead after a few minutes.
  4. Znet Pro - this solves that issue with the Znet being located closer to the devices.

@HomeSeerRich - I want to avoid doing this to the Znet in the event I want to go back to HS.

I appreciate all the information sharing! What I think I am going to do is replace 1 Znet with the ZooZ and use the other Znet in the my remote location to avoid Zwave needs going dead. (Unless anyone can think of a better option).

Thanks! :pray:

@Raven999 I still think you’re missing some of the components in this situation. If I’m wrong, my apologies. Here are some diagrams of the options you have that I hope will clear things up.

First, the way you’ve likely got your single Z-Wave network with a single Z-Net

HAOS is running multiple Docker instances, 1 for Home Assistant and the Z-Wave-JS Integration

The Integration then makes a WebSocket connection to the Addon Docker container running Z-Wave-JS-UI (that’s the ws://a0d7b954-zwavejs2mqtt:3000 reference in the integration configuration). Note that “a0d7b954-zwavejs2mqtt” is a docker host name reference for convenience but it just as easily could have been an IP address.

If you had a USB controller the Addon would reference a Linux device path (/dev/serial/by-id/mumble) but since you have a Z-Net that isn’t on the same host, your Addon configuration references a TCP connection to the Z-Net (tcp://192.168.1.101:2001) ser2net software.

The ser2net software on the Z-Net (RPi) points to the Linux device path of the EZZee Pi HAT (/dev/ttyAMA0)

With that you have end to end communications from Home Assistant to the Z-Wave controller.

Now consider adding a second Z-Wave network as you need to do. You have several options. Here are 2 discussed in this thread. First Option:

Using another host (Windows, Docker, or even cloning the existing Addon repository) you run a second instance of Z-Wave-JS-UI. A second integration is added to your existing Home Assistant and is configured to a different WebSocket address (I just made one up). The rest of the configuration is simply a repeat of the above steps with different IP addresses.

Cons: No automatic updates like the official Addon. You would have to keep the version up to date manually.

Second option:

Move one or both Z-Wave-JS-UI instances directly to the Z-Nets (this diagram shows moving both, but you could keep one stock)

The link I referenced in post 68 Z-NET Integration with HA - #68 by mterry63 shows you how to remove ser2net and install Z-Wave-JS-UI directly on the Z-Net. You can always buy a new SD card and back up the stock Z-Net configuration so you can revert by simply re-installing the original card. This is probably the route I’d go if I were to add a second network. Updating that software under docker isn’t that much of a chore.

Even with your proposed Zooz option (which I wouldn’t do as it will require you to migrate nodes to the new controller) you still need a second instance of Z-Wave-JS-UI which you can’t easily host on HAOS. Essentially you just swap the box in the diagram that says EZZee with the Zooz device. It doesn’t really help the situation much.

Hope this helps.

3 Likes

@mterry63 - Yes!!! this clears up my question and what I was looking for! thank you all so much for the assistance and I hope to pay it forward

For those interested, I had a friend work with me and get this working using dietPi. Not that I don’t appreciate the work that the Homeseer team did to get this to work natively, I found that due to perhaps the age of my z-nets (both were rPi 1s and I think OG z-nets) that it wasn’t working very reliably. Plus they’ve made other enhancements to newer znets like zigbee support, that I’m not sure mine would have had.

Above all that I still had the issue that if I wanted to run more than 1, I had to have another pi with 2 instances of zwave js ui. This solved it for me making each znet have it’s own zwave js ui install on it and removing an extra pi I had taling to the original znets.

That said, here are the instructions. I have followed these about 5 times now (2 I redid because i updated the rPis from v1 to v3 and just reused the daughter boards). I’ve also done this on a HomeTroller Pi.

Again, if you can get it working natively, then I wouldn’t do this, but this gives me more control to keep the OS and components up to date.

Assumptions made that installation will continue to use the default dietpi user.
If you choose to add your own user then substitute that user instead of dietpi.
dietpi Install
- First login as root/dietpi
- set passwords
- disable console - Yes
  - If you don't do this you have to do it manually editing /boot/dietpi.txt
    - CONFIG_SERIAL_CONSOLE_ENABLE=0
- software search
  - docker
  - docker-compose (this isn't the full docker-compose just the plugin...this is stupid)
- install software
- exit menu
- CLI
  - sudo apt install docker-compose vim -y
- Edit file (pico or vim)
  - /boot/config.txt 	
  - Edit Line:
    - enable_uart=1
  - Add Lines:
    - dtoverlay=pi3-miniuart-bt
    - dtoverlay=disable-bt
- Reboot
- Edit /etc/group
  - Add dietpi user to docker group
    - docker:x:993:dietpi
  - Or run as root (bad idea)
- Create docker-compose.yml in home directory or wherever you want
- Launch Z-wave JS UI
  - docker-compose up (launches in forground) add -d for background
  - Will restart on reboot so don't try loading it every boot it's automatic
docker-compose.yml
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
      - ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db
      # 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'
      - '/dev/ttyAMA0:/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

P.s. You can easily just keep your original z-net sdcard and revert if you have to at any time. The z-wave network is stored on the daughter card and so you don’t have to reinclude anything. You do have to have everything re-interviewed (so you have to wake up each battery device), but after that you’re good.

Also not that I deviated a bit from the instructions above and installed portainer (Install Portainer CE | 2.19 | Portainer Documentation) because i prefer it for managing my docker services. In this case I used the above docker compose to set up a portainer stack. That said, the portainer part isn’t really needed, but I personally find with all the znets I’m running it’s easier for me to keep zwave js ui updated.

2 Likes

Please ignore this post…

One of the only disappointments I have had with home assistant was the quality of the ZwaveJS implementation compared with Homeseer’s Zwave support (I was Homeseer user before transitioning to HA).

I was hoping this product would allow me to get the benefit of Homeseer’s excellent Zwave network management and protocol implementation and yet integrate all the devices into Home assitant, but this looks like I still am stuck with ZwaveJS support.

Is there a way for me to interface HA and Homeseer on a Pi and do what I want? I have made good progress in replacing my Zwave devices with Zigbee (Zigbee2mqtt works great!), but my 5 Yale locks are still better supported in Zwave than zigbee (though that is getting better - I moved one to the “Red” zigbee module a couple months ago and it’s doing Ok although passing through fewer options).

1 Like

What’s missing? ZWave2JS is the official integration for HA and I haven’t had any issues with it (granted, my network is small).