I was able to do exactly that! Make sure the OpenZwave addon is stopped (and turn off WatchDog for the addon, if you have it toggled on). Then spin up the zwavejs2mqtt container.
You’ll need to configure MQTT discovery, then configure zwavejs2mqtt via the web panel. Once it’s all configured correctly, it should pick up all of your zwave nodes without needing to exclude/include again.
The unfortunate downside that I found: you will have all new entities in home assistant and they are named things like switch.node_65_switch. I couldn’t find an easy way to change them through the zwavejs admin.
I’m really not looking forward to trying to rename everything again
node_location : location of the Zwave Node (optional, if not present will not be added to the topic)
node_name : name of the node, if not set will be nodeID_<node_id>
and:
Entity name template : Custom Entity name based on placeholders. Default is %loc-%n_%o
%n : Node Name
%loc : Node Location
%pk : valueId property key (fallback to device type)
%pn : valueId property name (fallback to device type)
%o : HASS object_id
%l : valueId label (fallback to object_id)
Tho I couldn’t find a way to change the name template. It says there is supposed to be an entry for it but I couldn’t find one.
So…
You can change the discovery name in HA by going to the “Home Assistant - Devices” table for the device and modify the json there to change the node name.
If you see the other thread about this I put a couple of screenshots there to show where to make the changes.
Configure zwavejs2mqtt with the exact same openzwave names.
then you shouldn’t have to rename anything using the UI. Step 2 should remove the openzwave config entries, thus making the entity_id available for use in step 3.
I’m pretty sure you can use that method to swap back and forth. But openzwave uses a stupid naming convention for entity_ids based on all the information provided by the client. So you’ll always be ‘renaming’ when moving back to openzwave. But if you use the supervisor you can just reload your config from an old snapshot.
I am looking at the same thing, and dreading renaming everything again, as I just went through that once.
Is there a way to script this? If you dumped all your ozw entity names, could you programmatically generate the equivalent zwjs2m names, and then run a sed script to map them back? Or maybe you don’t know what “node id” will be used for a given entity until zwjs2m picks one?
And just to clarify (since that statement seems imply a possible misunderstanding)…
The node_id’s aren’t assigned by HA/ozw/zwavejs. They are assigned by the controller when the device is paired. HA/ozw/zwavejs just reads that info from the controller and updates the database accordingly.
So all of those systems will always have the same node_id’s for each device
To people familiar with the naming conventions, does this look like an accurate entity id translation from ozw to zwjs? On the left are the custom names I’ve set up in ozw, on the right are the anticipated generated names coming out of zwjs.
I guess this can’t be complete yet because it generates redundant names for zwjs. But maybe it’s getting close.
{%- for node_id, statelist in states | selectattr('attributes.node_id', 'in', range(255)) | groupby('attributes.node_id') %}
{%- for s in statelist %} {%set type = s.entity_id.split('.')%}
(node {{node_id}}): {{ s.entity_id }} => {{type[0]}}.node_{{node_id}}_{{type[0]}}
{%- endfor %}
{%- endfor %}
What I’m after here is to generate a search/replace script that would run the reverse mapping to replace the entity names created by zwjs to the names you currently have in ozw. I’m assuming these are set in some text config file and could be swapped out by editing that file.
Ok, so I started bringing in a couple entities through zwjs to look at the entity naming scheme, and while this approach might work for simple things like switches, it seems to face a very uphill battle for more complex devices. For example, for a smart switch I have, I get a default zwjs entity name of:
sensor.nodeID_3_electric1_a_meter_66817_value
for the amperage sensor.
It’s not clear where “66817” came from (at a minimum), so I don’t know how I could anticipate this default name for programmatic renaming purposes.
Got it. Any thoughts on how would I get it to “rediscover” with new entity names if I changed the template and saved the new settings?
… (answering my own question)
I deleted the device, then restarted HA, and it seemed to rediscover the device/entities. However, it didn’t seem to change how the entities were named. Hmm.
That depends on how you installed HA (HASSOS, Supervised, Container, Core)?
once you get it installed you just go to the IP of the macine where it is installed and whichever port you assigned it in the docker install. Default port is 8091.
I have it Supervised version installed as a VM on a synology nas. I was able to get the repo installed for portainer into HA. Ive never installed a docker container in the supervised version through portainer. How is this part accomplished?