Open chelming opened 7 months ago
Hey there @home-assistant/z-wave, mind taking a look at this issue as it has been labeled with an integration (zwave_js
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
zwave_js documentation zwave_js source (message by IssueLinks)
it looks like it's only happening to the lock entity and not any other entities it creates.
We strip the default name of spaces at the ends before setting it. If there's a space you've probably added it when changing the name.
this is without a friendly name manually set. another user confirmed the same thing on discord. :/
entity registry json for the lock:
{
"aliases": [],
"area_id": null,
"capabilities": null,
"config_entry_id": "29ccdc63c0d7636a48df0351d73f3476",
"device_class": null,
"device_id": "e17223c16cc35da546ae0f2736d8c684",
"disabled_by": null,
"entity_category": null,
"entity_id": "lock.back_door_deadbolt",
"hidden_by": null,
"icon": null,
"id": "a7b1d130794550a482cb8f3168a28897",
"has_entity_name": true,
"labels": [],
"name": null,
"options": {
"conversation": {
"should_expose": true
}
},
"original_device_class": null,
"original_icon": null,
"original_name": "",
"platform": "zwave_js",
"supported_features": 0,
"translation_key": null,
"unique_id": "3489038839.3-98-0-currentMode",
"previous_unique_id": null,
"unit_of_measurement": null
}
The only thing that sticks out to me compared to the other sensors that are created is that the original_name
is set to an empty string vs an actual name.
Compared to the entity registry json for one of the binary sensors:
{
"aliases": [],
"area_id": null,
"capabilities": null,
"config_entry_id": "29ccdc63c0d7636a48df0351d73f3476",
"device_class": null,
"device_id": "80dd766f7b3bef06c61f2c69c08566c2",
"disabled_by": null,
"entity_category": null,
"entity_id": "binary_sensor.front_door_deadbolt_keypad_temporary_disabled",
"hidden_by": null,
"icon": null,
"id": "bc32847bf1768e99c9c7b4e94d267435",
"has_entity_name": true,
"labels": [],
"name": null,
"options": {
"conversation": {
"should_expose": false
}
},
"original_device_class": null,
"original_icon": null,
"original_name": "Keypad temporary disabled",
"platform": "zwave_js",
"supported_features": 0,
"translation_key": null,
"unique_id": "3489038839.4-113-0-Access Control-Keypad state.16",
"previous_unique_id": null,
"unit_of_measurement": null
}
Ok, I see the problem. The default entity name was calculated to empty string. That's not expected.
We should set the default entity name to None
for lock entities as they will be the main feature of lock devices.
https://developers.home-assistant.io/docs/core/entity#entity-naming
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
In addition to locks, I'm also seeing this for my lights and fans as well. I have a few other device types (motion, water & smoke detector sensors and it does not seem to add the errant space at the end for those types.
The problem
All of my Z-wave locks added through the front end using the zwave_js integration have a space appended to the friendly name.
What version of Home Assistant Core has the issue?
core-2024.3.0
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Z-wave JS
Link to integration documentation on our website
https://www.home-assistant.io/integrations/zwave_js/
Diagnostics information
config_entry-zwave_js-29ccdc63c0d7636a48df0351d73f3476.json
Example YAML snippet
Anything in the logs that might be useful for us?
No response
Additional information
{{ state_attr('lock.back_door_deadbolt', 'friendly_name')+'nospaces!' }}