So my current practice is the following:
Include the Devices: “Z-Wave > Add Node” for all new devices. Jot down their Node IDs.
Stop Home Assistant: SSH into the hass.io instance and stop HA (
hassio ha stop)
Rename the Z-Wave Devices: Open
zwcfg_0x*.cfg. Find the entries for whatever nodes I added and edit the
name attribute on the root entry for the device. This also lets me do whatever configuration tweaking I might need to do (like adding central scene support, etc).
Delete the old Entities from the Registry: Open
config/.storage/core.entity_registry and delete the entries for entities related to the new devices. You can find the z-wave device by looking for
"unique_id": "node-<N>" where
<N> is the node number. Child entities should be immediately following the Z-Wave device entity, and will have a
unique_id attribute that starts with the node number (so
"unique_id": "19-72057594361511937" would be a child of the device on node 19).
Restart Home Assistant: Using
hassio ha start from the SSH terminal.
When the server starts it will load the z-wave devices with the new names as specified in the
zwcfg_0x*.cfg file, and then re-create the entities for it using the new base name. The reason you have to delete the entity IDs from the registry is because the registry essentially is a
customizations.yaml file for every entity. Even if you rename the node, the old entities with the old names are still around.
This is also why using the zwave “Rename Node” service doesn’t work now like it once did. Since all entity names are explicitly stored in the entity registry upon creation, renaming the node (which is equivalent to editing the names in the
zwcfg_0x*.cfg) will change what Z-Wave calls the device, but it will still point to the same entities with the same names.
The equivalent of what I suggest above with the new interface would be:
Rename the Z-Wave Device: use the (now hidden)
zwave.rename_node service to give the device an explicit name.
Rename the Z-Wave Device’s Entity: Use the Entity Registry panel to change the
entity_id for the entity corresponding to the z-wave device
Rename Each Child Entity: Use either the Entity Registry or Integrations > Z-Wave panel to rename child entities for the node
You could maybe argue that the above steps are easier than what I suggested before. Personally, I prefer the lack of potential typo errors and UI digging that just renaming the devices and relying on re-generating the entities provides. Also when you start adding lots of devices in one go (redoing a bunch of lights) or dealing with devices that produce lots of entities (hello, flood / multi-sensors) I think it ends up being much more streamlined.
However, regardless of which you prefer it seems like the system has everything it needs to just provide a “Rename Node and Entities” function that does it all. If I can figure out the best way to set up a dev environment without turning my actual house into a sandbox maybe I will poke around at it…