Add possibility to use templates in lovelace

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

Currently the Markdown card allows the use of Jinja Templates.

Hello wrfz,

This appears to be a Frontend Related Feature Request as it is asking for changes to Frontend Menus, Dashboards, Cards, Sections, or other Frontend Feature.

These Feature Requests are handled in a different system, and will not be seen by the right people if posted in the HA forums.

Please add your Feature Request into GitHub here:
home-assistant/frontend Other Feature Requests · Discussions · GitHub.

See more info about Feature Requests HERE

1 Like