Copying device names into Z-Wave JS UI

Today I switched (upgraded? side-graded?) from “Z-Wave JS” to “Z-Wave JS UI”.
So far I really like it. I’m glad I switched. I’m hoping it is the first step in diagnosing some really strange zwave issues I have been having. Anyway…

After the migration, the Z-Wave JS UI shows all my devices and everything is working at least as well as it was before. But… in the UI, they are missing the Name / Location information.

I understand that the Z-Wave JS UI is a separate thing from HA, and isn’t aware of HA or the names of my devices in HA… no problem.

But, I was wondering… is there a way to mass-export the names (&locations) from HA, and then import them into Z-Wave JS UI?

Or do I have to manually copy-paste all those names by hand?

1 Like

Here’s something I quickly wrote up, after seeing this requested many times. Let me know how it goes if you try it.

Copy and paste this code into the Dev Tools Template editor:

{%- set ns = namespace(nodes=[], export={}) %}
{%- for dev_id in integration_entities('zwave_js') | map('device_id') | unique %}
  {%- set node_id = (device_attr(dev_id, 'identifiers') | first | last).split('-')[1] %}
  {%- set ns.nodes = ns.nodes + [(node_id | int, dev_id)] %}
{%- endfor %}
{%- for node_id, dev_id in ns.nodes | sort(attribute='0') %}
  {%- set node = {(node_id | string): {}} %}
  {%- set name = device_attr(dev_id, 'name_by_user') %}
  {%- set location = area_name(dev_id) %}
  {%- if name and location %}
    {%- set node = {(node_id | string): {"name": name, "loc": location}} %}
  {%- elif name %}
    {%- set node = {(node_id | string): {"name": name}} %}
  {%- elif location %}
    {%- set node = {(node_id | string): {"loc": location}} %}
  {%- endif %}
  {%- set ns.export = dict(ns.export.items(), **node) %}
{%- endfor %}

{{ ns.export | to_json }}

It will output a JSON object in the format ZUI uses for node name and locations backups. Save the template output to a file named nodes.json (or whatever you want).

In Z-Wave JS UI, go to the Control Panel, click the blue FAB (floating action button), Advanced Actions, then IMPORT under the Backup section. Pick the file created above.

image

In the future, to keep both applications in-sync always add nodes from ZUI, as it allows you to pre-configure names and locations before including a node. During inclusion, HA will see the pre-configured values.

9 Likes

Perfect!

Thanks, that did precisely what I needed. :slight_smile:

I really appreciate it.
And the advice to add new devices via the UI. Sounds like a lean solution. Will do!

1 Like

Thank you. That was a perfect fix.

1 Like

Thank you!!!

thanks so much for this, it worked really well. Only issue I’ve got is that I’m still seeing unknown manufacturer for all my nodes. I’ve tried reinterviewing but it doesn’t seem to do anything, even when I wake the device first. My sensors and switches seem to work so do I just ignore this?

The code for the developer template area by freshcoast was very helpful to extract the detail from homeassistant. I have struggled for days trying to re-instate the detail on the zwave js ui app using everyone’s directions; however, an interesting thing showed up from using this code.

the nodes.json file created from zwave js ui has an extra column of two spaces with a hex string at the very top encapsulated with braces. the json file this code creates lacks that. Once I took the hex line out and the extra spaces, the nodes.json file uploaded (as it usually did anyway) but this time the edits returned as viewed in the js ui control panel.
image_2025-10-16_081747861

Hi Charlie,

I have been thinking about installing Z-Wave JS UI, I currently am using Z-Wave JS. Does the UI version just install as an add-on giving you a GUI or do you have to delete Z-Wave JS then install JS UI? I only have 4 devices, my Schlage door locks but want to make sure I know what to do before messing with them lol

Thanks in advance

Depending on your needs, delete the Z-Wave integration and ensure the add-on is also deleted, and then start over with Z-Wave JS UI, or perform a migration: