-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
add friendly_name_template to template sensor #12268
add friendly_name_template to template sensor #12268
Conversation
If set, overrides friendly_name setting.
Names are used to identify the entity you're looking at. Icons are used to identify the class of an entity and sometimes the state of that class (like a colored light bulb for lights that are on). Having the name be templatable means that being able to identify it, is lost. I find the use case even far fetched and definitely an edge case. I don't think that we should add this. |
@balloob This only makes the See this thread for a use case. The whole solution was complicated by the fact that we could not use templates for I understand you may want to keep things simple, but just wanted to highlight the need for something like this. |
I think this is a really useful feature! |
This is a bad argument. Every feature we add needs to be maintained, adds runtime overhead, adds tests and so increases the runtime of the test suite that runs for every new feature, adds to the docs etc etc |
@arsaboo that seems like an oke use case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs tests
I was thinking to add similar functionality to rest_sensor. But I guess adding it to template sensor should be enough to cover the use cases. (template sensor can 'pull' from the rest_sensors) |
EDIT: Ignore the below comment. My mail server got stuck and this came in way after everything was handled nicely. (left the comment for reference)
--------
Agree on the edge case argument, but we’re talking about the template sensor here. Which kind of is a solution to all sorts of edge cases.
Not being able to identify of course depends how it is used.
It could be used to further explain what exactlyuj the user is looking at. (Instead of adding another template sensor to add that information and group them)l
Another use case could be the next pickup of the garbage.
Instead of showing two sensors (date and type of garbage) that type of garbage can be included in the friendly_name so you only need to show one sensor.
I’m just trying to summarize some information to make the homepage/default_view a useful dashboard. Not only for me, but also for my wife.
|
seems this does not work on 0.64 on hassio? |
please file an issue with your configuration and other details. |
Description:
This makes the friendly_name 'templateable' like just like the icon.
Use case (for the template sensor) is probably a bit limited. But it can be things like: Changing the name of a calculated power consumption (value_template) from 'Consumption' to 'Production'
(see example yaml below)
friendly_name can still bet set, but the friendly_name_template will override that if set.
Will update documentation as soon as this gets approved.
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed: