With sensors I can calculate the friendly_name. EG
‘’’
##############################
sensor:
##############################
- platform: template
sensors:
job00_running:
friendly_name: >
{% set a = (‘{:02}’.format(states(‘input_number.job00_number’) |int )) ~ ’ - ’ %}
{% set b = states(‘input_text.job00_description’) %}
{% if states(‘input_boolean.job00_running’).lower() == ‘on’ %}
{% set c = ’ running’ %}
{% else %}
{% set c = ‘’ %}
{% endif %}
{{ a ~ b ~ c }}
value_template: “{{ states(‘input_boolean.job00_running’) }}”
‘’’
I would like to do similar for input_XXX (XXX = boolean, select, text, number, datetime)
using the “name” attribute, which in the documentation is referred to as the “friendly_name” When calculating the name I get a display of “{% set a = ‘relay’ ~ ('{…”
Example of the calculation of the name attribute.
‘’’
input_boolean:
test00_boolean:
name: >
{% set a = ‘relay’ ~ (‘{:02}’.format(states(‘input_number.test00_number’) |int )) ~ ’ - ’ %}
{% set b = states(‘input_text.test00_text’) %}
{{ a ~ b }}
‘’’
Where I want to use this is:
I have around 100 relays in my irrigation system (relay01 to relay99) for each relay I have a description (input_text) entity to describe what the relay is for. I want to use this description in the “name” of the entity to make the entity card much easier to read and operate. (Currently I have to display the input_text entity followed by the input_boolean entity to be able to switch the correct relay on or off manually.
Finger trouble (phones are small and fingers are big) means I’m constantly editing the description which I do not want to do. Making a sensor from the input_text entity is an option but I still need to display 2 entities. It would be much easier and more versatile if the Name attribute could be calculated as for sensors.
Anyone with ideas?