-
-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] hass entity names are now being prefixed with -
#162
Comments
@chilicheech Essentially the problem is that location is missing, did you tried to remove %loc from the entity name plaeholder? |
IT would be a good idea to check the name and remove the @chilicheech does all your entities not use location? |
@billiaz that is correct. All my entities don't use location, a.k.a. the location is empty/null. I could adjust the template, but I believe the default template should produce a name that doesn't start with a dash when the location is empty, which was the behavior before we added the template feature. |
@chilicheech if you are able to compile from a branch can you compile from https://github.com/zwave-js/zwavejs2mqtt/tree/cleanup_hyphen |
cool, that seems to work. here's the new discovery payload. notice the name:
no more dash in the beginning. and verified the name is correct in HASS as well. thanks for this fix |
I have created a pull request, We will need to discuss if this is the best way (for this moment) to fix this. |
Version
Build/Run method
zwavejs2mqtt version: 1.0.0.alpha.2
Describe the bug
Before this version HASS entity names were being reported correctly, for instance,
patio_lights_dimmer
. In this version the name is being prefixed with a dash,-patio_lights_dimmer
. This is probably due to the introduction of the entity name template feature, that has a default template of%loc-%n_%o
. However, this "breaks" the name when there's no location present. When the location is empty/null, the dash should be removed.Expected behavior
Using the default entity name template, when the node's location is NOT empty/null, the effective template should be what it is now:
%loc-%n_%o
. However, when node's location IS empty/null, the effective template should be%n_%o
(without a dash for a prefix).Additional context
Here's a picture of my config:
Here's a picture of the config of the patio_lights device:
And here's the generated HASS discovery:
Notice how it now sets
"name": "-patio_lights_dimmer"
whereas before the entity name template feature was introduced it would correctly set it to"name": "patio_lights_dimmer"
.The text was updated successfully, but these errors were encountered: