I’m trying to test templating in Devloper Tools → Template, and examples in this forums says things like:
{{
label_entities('Varme')
| list
}}
should work fine, but for me it returns nothing.
I have created a Label called Varme, and assigned to entities.
And would like to list those entities only.
The syntax is correct, are you certain the name is identical to your actual label name? The system is very forgiving with forgetting underscores for spaces and case sensitivity so the name seems to be the culprit.
if you pick one of the entities that should show up, and you do:
{{ 'light.entity_name' | labels }}
(replace light.entity_name with a real entity that has the ‘Varme’ label on it. ) what do you get?
you should get something like
['Varme']
if you don’t, the template isn’t the problem… if you do get a label, that’s the label verbatim that you need to use. give that a try and post what you get.
That did the trick.
It never occurred to me, or even heard of that there is a difference in labeling devices vs entities.
The device is also an entity, yes?
Just stumbling onto this…is there some easier way other than clicking manually thru hundreds of individual entities separately?!
It seemed daunting when I was trying to leverage labels to filter in templates and will have to click thru every device - but now it sounds like I’ll have to go thru dozens of devices * many entities per device ALL one by one separately!?
Is there some programmatic way of doing this in bulk?
I expected it to be more like renaming a device usually offers renaming all the sub-sensors to match