Core: Newly renamed Z Wave entity IDs are improperly reflected in entities list

Created on 16 Jul 2017  路  9Comments  路  Source: home-assistant/core

Home Assistant release (hass --version):
0.48.1

Python release (python3 --version):
Python 3.5.2

Component/platform:
zwave

Description of problem:
Renaming zwave switches or dimmers does not result in the desired name being reflected in the new entity ID.

Expected:
New entity id should be snake case version of entered node name.

Problem-relevant configuration.yaml entries and steps to reproduce:

  1. Rename node of zwave dimmer switch to something like "Family Room Lights"
  2. Check entity id in developer tools entity list
  3. Find new entity id is light.family_room_lights_level.

Additional info:
Same thing applies to zwave switches, but with _switch appended.

I'm guessing that I'm doing something wrong regarding renaming these nodes, but I can't find any actual documentation on how to do this. The blog post announcing the feature simply states you can do it.

Most helpful comment

That would be an anti-pattern and would lead to confusing behavior to users who have not read this thread 馃槃

In that case, as I mentioned in my last comment, you could use a template entity to map the attribute you are interested in to a templated entity. See examples and docs here. This way you can make whatever name you want (namely, removing the node attribute name from the entity id)

All 9 comments

From what I can tell, we can only rename the zwave domain entity id and any generated entities to other domains append the value name to make a unique entity id. Seems to me that since it is in a separate domain we need not worry about uniqueness of the entity id?

Since the zwave domain itself is somewhat new, or at least having each node an entity within it, I figured the expected behavior would be renaming the generated entity to other domains (i.e. light, switch, sensor, etc.). It appears we still don't have full control over those entity ids.

I'd argue that renaming those entity ids is where the true value lies, as they are the ones most often used in automations, but that is not my call.

Thoughts? @turbokongen

I had no work on the entity id change. That was @armills
But this is how I have understood this.
zwave domain: These will reflect the node name ie. zwave.[manufacturer_name]_[device_model_name]
That means if you don't bother with renaming the entity_id will be appended with _2
This name should be unique and is reflected to the other domains as i.e.: sensor.[manufacturer_name]_[device_model_name]. Let's call it _the base entity_id_
The base entity_id is then appended under each domain with the discovered value names from ozw. I.e.
sensor.[manufacturer_name]_[device_model_name]_[label]
This will also have to be unique to properly hide and handle the incoming data. If you have a entity_id with _2 appended you cannot handle that in the config file i.e. hide it or ignore it. The method I use to ignore unwanted id's is to append the value name with unused Then you can hide/ignore them easilly with ignore.

The suffixes level and switch are the value labels. These can also be changed from the zwave panel. If you select the node, and then scroll down there is a card labeled "Node Values". Select "Level" from there and rename it.

But so why are they there by default? It seems more logical to strip them at the same time as stripping the entity ID's. If someone really wants to they could go down to nodes values and turn them back on.

I believe it is due to the fact that a single Z Wave device can generate multiple entities in other domains. An example I recently ran across is Z Wave door sensor, they produce entities for alarm state, alarm level, security alarm, etc. thus a creating entities without the node value name appended would produce duplicate entity ID issues. Now that I've thought about it some more I think the current implementation is as clean as it can get without introducing further complexity or producing bugs for certain devices.

In the case of a unique mapping between the zwave domain and the produced entity device domain, if the node value name being appended is not desired, you could make use of the various templating integrations to rename the entity.

Personally I think this can be closed, but I'll leave this open as it seems it has spurred some discussion.

But how about devices that only have a single entity? Can maybe some automatic stripping of the suffix happen there?

That would be an anti-pattern and would lead to confusing behavior to users who have not read this thread 馃槃

In that case, as I mentioned in my last comment, you could use a template entity to map the attribute you are interested in to a templated entity. See examples and docs here. This way you can make whatever name you want (namely, removing the node attribute name from the entity id)

OK thanks. I think this can be closed then.

Agreed. Unfortunately the Z-Wave ecosystem is sort of a mess, and we have to support tons of different configurations. I think where we've landed now is the best compromise we can make to reasonably support both very simple and very complicated setups out of the box.

Was this page helpful?
0 / 5 - 0 ratings