Sometimes in Lovelace, you don’t want to display an entity exactly as-is, but rather in a modified or formatted way.
To achieve this, you always need to create a template sensor first.
If you need five different representations or formats of an entity in five different places, you have to create five separate templates. Eventually, it becomes hard to manage.
It would be very convenient if you could use templates directly in Lovelace.
Example:
Date-time values are stored in the database in the following format:
2025-05-07T18:42:00+00:00
Lovelace cards only allow you to select and display an entity directly.
But often, you might want to display only part of it—such as just the time.
It would be very helpful if you could use Jinja-style templates directly in Lovelace, e.g. to show just the time:
{{ states('sensor.your_datetime_sensor') | as_datetime | as_local | strftime('%H:%M') }}
There are endless examples where templates would be useful, such as:
- Concatenating two sensor values
- Reformatting strings (uppercase, lowercase, etc.)
- Abbreviating text
- Substitutions
- …