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?
If you’re using Portainer, create a new “Container” following the zwavejs2mqtt instructions. Here’s my setup for zwavejs2mqtt in Portainer. Note second picture: you need to add your zwave USB hub device
The volume mapping above is optional. I did that so I can have access to the files and tinker a bit. You can omit the Volume setup completely if you want, until you have some need to edit the files.
I don’t know if this is what you have run into, but Hass and its device registry love to prevent re-use of a device id. …even when it is the same device through a new service or a replacement for a dead device. It drives me stark raving mad. The only solution I’ve found is to shutdown Hass and then manually delete the devices at issue from the device registry file. I suspect that I could delete the entire file and let it be rebuilt. …this isn’t the only reason for devices to get “new” ids, but it is the reason I most often run into. Hate it! Hate it! Hate it!
Delete the Mqtt integration, shutdown ha, start ha, add the MQTT integration back. Everything will be auto created as long as the discovery configs are sent on startup. I would assume zwave2jsmqtt would do this.
Edit: don’t do this if you renamed the entity_ids. You’ll have to name them all again.
Will you be able to assist me? So I am able to pair devices in the ZWavejs2MQTT UI but I do not see them show up in my home assistant. Are you able to notice any issues with my setup?
Sorry, I’ve never used it. I just know how mqtt discovery works.
Edit: I can say that the mqtt setup you have is default and not necessary. You should be able to just use the UI integration without that configuration in yaml. Assuming that zwave2mqtt uses the default configuration.