Sensor Entities Renaming Everytime HA or Device Restarts

I have a Zooz Zen17 zwave relay connected via ZwaveJS to Home Assistant. Every time the zwave device restarts, ZwaveJS restarts, or Home Assistant restarts, the sensor entities are renamed.

For instance, they go from:

binary_sensor.gate_relay_window_door_is_open_2
to
binary_sensor.gate_relay_window_door_is_open_2_5

The original entity shows as “unavailable” and the new entity is now the one that updates from the relay. I can rename the entities to their original name and delete the now duplicate entity, but it every time either device restarts, the entity is renamed.

This device has 2 relays and 2 sensors. It only happens to the relay entities, not the sensor entities.

Any idea what would cause this?

What is your Z-wave controller?

I have a raspberry pi with a homeseer zwave hat connected to it and zwavejs installed. Home assistant is connected to the raspberry pi via the zwavejs integration from Home Assistant.

This may help you figure out what is happening. I haven’t seen this happen with only a restart, but Home Assistant is discovering a new device and since the name already exists, the suffix is added.

Maybe a connection problem with the hat? Is the soldering OK?

Yeah it’s good. The issue happenes every time either Home Assistant or the ZwaveJS box is rebooted. So it makes me think it’s a software issue.

That makes sense except I’m not sure why it would be considered a new device or in this case just a new sensor entity.

Of course it’s a software issue. The automatic suffix is a particular pet-peeve of mine. I do a lot of experimental work using ESP devices and ESPHome and - without any logic - sometimes a device will gain a new suffix, frequently screwing up automations or scripts. I wouldn’t mind if Home Assistant interrupted my workflow to warn me that “a device named xyz already exists, is this a new device?”.

Try to reduce your testing protocol to determine how anyone else can reproduce the issue.

Wait, what? What is a “ZwaveJS box”? I have 14 Z-wave devices in my home, and I’ve never heard of a Z-waveJS box.

1 Like

I made it myself. Raspberry Pi 3 + Zwave Hat + ZwaveJS installed. It natively integrates to Home Assistant. Had to do that because this is at a gate a half mile away from the house.

Just wish I could get the entities to stay the same.

Post the device diagnostic file so we can see how HA is mapping the entities to the underlying Z-Wave JS value IDs, that may give a starting hint.

See link below. The one I care about and the one that keeps getting renamed is binary_sensor.gate_relay_window_door_is_open_2.

Note the ones called “gate_relay_window_door_is_open_2_x” and gate_relay_window_door_is_open_2_xy" are ones that I renamed myself because they were the old sensors that were renamed and I could not delete them so I had to rename them to something unique that way I wouldn’t have two entities with the same name.

zwave_js-01JPB8586KN7456NV7R89GHB9E-Gate Relay-451176f21af32c6e1830eb64445f5cb2.json

@mmilleville Did you ever figure this out?

I’m having the same issue with a ZEN17 on FW 2.10.0. with the ZST39 LR controller on FW 1.60. ZWave JS UI and Home Assistant are both running the latest versions. 10.9.0.26f2e69 and 2025.7.1.

Same scenario where window_door_is_open_2 creates a new binary_sensor entity every time HA or ZWJSUI are reloaded and when power is lost on the ZEN17.

I noticed the state key and endpoint seem to jump around. State key between 22 and 23 and the endpoint between 0 and 2. Is there a way to pin the endpoint and state key?

      {
        "domain": "binary_sensor",
        "entity_id": "binary_sensor.garage_relay_window_door_is_open_2",
        "original_name": "Window/door is open (2)",
        "original_device_class": "door",
        "disabled": false,
        "disabled_by": null,
        "hidden_by": null,
        "original_icon": null,
        "entity_category": null,
        "supported_features": 0,
        "unit_of_measurement": null,
        "value_id": "262-113-1-Access Control-Door state",
        "primary_value": {
          "command_class": 113,
          "command_class_name": "Notification",
          "endpoint": 1,
          "property": "Access Control",
          "property_name": "Access Control",
          "property_key": "Door state",
          "property_key_name": "Door state",
          "state_key": 23
        }
      },
      {
        "domain": "binary_sensor",
        "entity_id": "binary_sensor.garage_relay_window_door_is_open_2_2",
        "original_name": "Window/door is open (2)",
        "original_device_class": "door",
        "disabled": true,
        "disabled_by": "user",
        "hidden_by": null,
        "original_icon": null,
        "entity_category": null,
        "supported_features": 0,
        "unit_of_measurement": null,
        "value_id": "262-113-2-Access Control-Door state",
        "primary_value": {
          "command_class": 113,
          "command_class_name": "Notification",
          "endpoint": 2,
          "property": "Access Control",
          "property_name": "Access Control",
          "property_key": "Door state",
          "property_key_name": "Door state",
          "state_key": 22
        }
      },
      {
        "domain": "binary_sensor",
        "entity_id": "binary_sensor.garage_relay_window_door_is_open_2_3",
        "original_name": "Window/door is open (2)",
        "original_device_class": "door",
        "disabled": false,
        "disabled_by": null,
        "hidden_by": null,
        "original_icon": null,
        "entity_category": null,
        "supported_features": 0,
        "unit_of_measurement": null,
        "value_id": "262-113-1-Access Control-Door state (simple)",
        "primary_value": {
          "command_class": 113,
          "command_class_name": "Notification",
          "endpoint": 1,
          "property": "Access Control",
          "property_name": "Access Control",
          "property_key": "Door state (simple)",
          "property_key_name": "Door state (simple)",
          "state_key": 23
        }
      },
      {
        "domain": "binary_sensor",
        "entity_id": "binary_sensor.garage_relay_window_door_is_open_2_4",
        "original_name": "Window/door is open (2)",
        "original_device_class": "door",
        "disabled": false,
        "disabled_by": null,
        "hidden_by": null,
        "original_icon": null,
        "entity_category": null,
        "supported_features": 0,
        "unit_of_measurement": null,
        "value_id": "262-113-0-Access Control-Door state (simple)",
        "primary_value": {
          "command_class": 113,
          "command_class_name": "Notification",
          "endpoint": 0,
          "property": "Access Control",
          "property_name": "Access Control",
          "property_key": "Door state (simple)",
          "property_key_name": "Door state (simple)",
          "state_key": 23
        }
      },
      {
        "domain": "binary_sensor",
        "entity_id": "binary_sensor.garage_relay_window_door_is_open_2_5",
        "original_name": "Window/door is open (2)",
        "original_device_class": "door",
        "disabled": false,
        "disabled_by": null,
        "hidden_by": null,
        "original_icon": null,
        "entity_category": null,
        "supported_features": 0,
        "unit_of_measurement": null,
        "value_id": "262-113-2-Access Control-Door state (simple)",
        "primary_value": {
          "command_class": 113,
          "command_class_name": "Notification",
          "endpoint": 2,
          "property": "Access Control",
          "property_name": "Access Control",
          "property_key": "Door state (simple)",
          "property_key_name": "Door state (simple)",
          "state_key": 22
        }
      }

Your problem may be the messages are getting garbled. Review these links

Possibly but I don’t think that’s the issue. Everything else works flawlessly. The reed switch values always come through accurately and consistently with updates in under 1s. It’s just this one entity that likes to bounce around.

I’m using zwave long range and the Average Background RSSI is -110 for Channels 1 and 2 and -107 for channel 0.

That tells you how much noise the stick is hearing. What is the RSSI for the device?

1 Like

So, ChatGPT helped me solved this. The entity was constantly getting renamed so it helped me to create another entity name that always stays the same and uses the value of whatever the currently named entity is from the Zen17.

I have this pasted in my configuration.yaml. This has worked well for the last 5-6 months. I use this entity name now instead: gate_state_stable

- name: Gate State Stable
        unique_id: gate_state_stable
        state: >
          {% set candidates = states.binary_sensor
              | selectattr('entity_id', 'match', 'binary_sensor.gate_relay_window_door_is_open_2.*')
              | rejectattr('state', 'eq', 'unavailable')
              | list %}
          {% if candidates %}
            {{ candidates[0].state == 'on' }}
          {% else %}
            false
          {% endif %}
        device_class: door

Interesting workaround. I realized that while the window_door_is_open_2 entity name keeps changing, the sensor_state_door_window_2 does not so I just used that for my cover.