Switching from Zwave 1.4 (Deprecated) to ZwaveJS2MQTT

Tags: #<Tag:0x00007f325e40e5d8>

*** THIS GUIDE IS CURRENTLY UNDER CONSTRUCTION ***

This guide is for switching from Zwave 1.4 to ZwaveJS2MQTT & Zwave JS Integration.

Click here for the docker image install

Preparation

In home assistant.

  1. Browse to Developer Tools.

    image

  2. Click on the template tab

    image

  3. Paste the following code into the template section.

    {%- for node, zstates in states | selectattr('attributes.node_id', 'in', range(1000)) | groupby('attributes.node_id') %}
    {{ node }}:
      {%- for s in zstates %}
      - {{ s.name }}
        {{ s.entity_id }}
      {% endfor %}
    {%- endfor %}
    

  4. Copy the results and paste them to a text file for safe keeping. You’ll reference this at a later time.

    image

Migration

  1. Locate your device and network_key. If you don’t already know them, they will be in a hidden file within your configuration folder.

    device - This is the path for the USB Stick
    network_key - This is the key used when adding a secure node.

    1.1 Browse to /config/.storage/
    1.2 Open core.config_entries with a text editor.
    1.3 Search for Zwave in the file.
    1.4 Inside that section will be a path to a usb device and a key. The usb device will look something like /dev/ttyACM0 or /dev/serial/by-id/usb-<bunch of numbers>. The key will have the format 0xD3, 0x05, 0x0A, etc.

  2. Save the device and network_key to a text file for later use.

  3. Remove Zwave 1.4 from HA.

    This requires you to delete it from the integrations in the UI

    or

    Delete it from configuration.yamlThis of course depends on how you integrated it.

  4. Reboot your entire system.

    These steps are needed because the zwave 1.4 is tightly integrated with home assistant. Without restarting the hardware, home assistant keeps holding on to the zstick.

  5. Install ZwaveJS2MQTT addon.

  6. Start ZwaveJS2MQTT addon.

    image

  7. Open the Web UI

  8. Paste information into ZwaveJS2MQTT configuration area.

  9. Watch the device list and wait for the last node to be found.

  10. Fix all ‘unknown’ devices by waking them up. No need for a refresh node, just wake them up.

    NOTE: This will require you to wake the devices up phsycially. Meaning you have to go to the device and wake it yourself. Most zwave devices have a periodic wakeup period where they wake up once a day. If you don’t want to walk around the house and wake devices, you can simply wait for the device to wake itself. Just be warned, it may take a day or 2 for this to happen.

  11. Install Zwave JS integration. Make sure you uncheck the Use the Z-Wave JS Supervisor add-on.
    zwavejs-install
    In the next step enter the following so a connection to the ZWaveJS2MQTT add-on is being made.
    ws://a0d7b954-zwavejs2mqtt:3000
    zwavejs-install-2
    Hit Save and the integration is added which should give you a list of devices that matches devices in the ZwaveJS2MQTT control panel.

  12. Rename Devices using the text file as a reference from the Preparation #4 step. This is the most time consuming step

    image

    image

    image

9 Likes

If running HA in a docker restarting the docker appears to be sufficient.

1 Like

If running Docker this is the docker image you want

Will the entities all be named different compared to what they were named before in ozw 1.4?

Yes, you will have to rename them once.

That’s a lot of work for 300 entities. Is there a tool or system being planned that will do this migration automatically?

I’ve done it myself for about 700 entities in about 2 hours.
Make sure to rename the device and it will automatically update its entities.

And yes, we have planned to create a full automatic migration but not sure if yet when/if that will be available at this time. We’re exploring possibilities. It’s a bit hard because the internals of OZW and Z-Wave JS are different.

1 Like

Hi,
Sorry if my question is stupid. I’m a little bit lost between the zwavejs integration which was announces in 2021.2.1 and zwavejs2mqtt. May they run together in ha or only one of them? If my understanding of your article is correct you have installed both together?
I will have a new zwave network and I’m not sure if I must go for the zwavejs or zvwavejs2mqtt. I would avoid to need to move to another one in a near future so I think the zwavejs which will be the recommended one is the right one but in the meantime I will need to be able to set config parameters on the devices

Please take a look at the community guides, maybe it will help you understand the differences.

1 Like

That actually sounds not too bad. Are you editing entity names inside a file in HASS or through the gui? What’s your workflow like to rename that many entities that fast? This is the only thing stopping me from moving over to zwaveJS.

1 Like

For docker fans, here’s a docker-compose example:

  zwave2mqtt:
    container_name: zwave2mqtt
    image: robertslando/zwave2mqtt:latest
    restart: always
    tty: true
    stop_signal: SIGINT
    devices:
      - '/dev/<my-zwave-stick-tty>:/dev/ttyACM0'
    volumes:
      - <path-to-your-zwave2mqtt-config-folder>:/usr/src/app/store
    ports:
      - '8091:8091'
    network_mode: host
    depends_on:
      - mosquitto

1 Like

ZwaveJS UI also offers renaming so which is best way to do for once and forever in case of using websocket and mqtt? Great job!

How about MQTT instead of the websocket?

Sorry, that’s not covered in these guides. This guide is purely meant to get people to the new Zwave JS integration.

Hi all. Thanks for the awesome guide. I was doing OK - my light switches came right back and I was able to rename them and re-do my automations.

I have 3 garage door tilt sensors. 2 came up after some time and the Interview Stage shows as being “Complete.” However, the third one seems to be stuck at “ProtocolInfo”. Any thoughts?

I’ll confess, I did something out of order - I renamed the device in HA before it completed the Interview. Is that a problem? I forgot that the Z-Wave JS integration page says “Once a node hits the ready state, the entities will be created (so not before). Only at this point, is it safe to rename the device (and so its entities).”

Do I need to re-do everything? Or any other ideas on why my sensor isn’t advancing in the Interview process?

Thanks again!!

Great guide - question, i’m seeing that turning switches and lights on/off now has a 1-2 second delay whereas the original deprecated zwave integration was near instantaneous. Is this expected or will things run faster after a network heal? Running on fairly fast hardware (gen 10 i7 nuc).

Have you tried a restart?

That’s odd, have you waited for it to fully start? The latency on my network is non-existent. It’s much faster than the previous zwave

I have restarted HA several times (mostly for other reasons) since setting this up, yet. I have not done a complete reboot of the host since I did so to make sure the system wasn’t hanging on to the USB stick (step 4 in the guide). Would restarting the host help?

FYI, I have gone into the control panel (WebUI) and tried “Re-interview Node” and “Refresh values” a couple times. It does seem to restart the Interview but hasn’t advanced past “ProtocolInfo.” Finally, I did manually wake the switch (and it said “Awake” under Status), but it did not advance.

It wouldn’t be too bad to start over if you think that I messed up the order of things. I only have 6 switches and these 3 garage door tilt sensors.

Thanks.

Thanks for the guide! After 2 days of futzing (my install is quite complex), I have everything running. For me, ZwaveJSMQTT is far superior to ZwaveJS as there are some things that aren’t exposed (yet, maybe?) in the ZwaveJS install such as refreshing values and getting all Zwave events. While I don’t need to poll my devices, I have some in-wall controllers that are associated with other devices and the device statuses don’t update if I use the controllers; with MQTT, I can pull off when the controller is touched and then send an MQTT message to refresh the values.

The deprecated Zwave had both a refresh node and an event when any Zwave message came through.

While I don’t expect these 2 items to come to the standard installation just for me, I am quite glad there is an alternative. So far, I’m pretty pleased with the transition and restarting Home Assistant takes just about 20 seconds instead of the 8-10 minutes before having to setup my Z-Wave network.

Thanks!