Templated card title

Dear All,

I was wondering if it is possible to template an entity card’s title. I tried it like this:

cards:
  - type: entities
    title: {{states("sensor.pihole_hostname")}}
    show_header_toggle: false
    entities:

But I get an error message:
invalid key: "OrderedDict([('states("sensor.pihole_hostname")', None)])" in "/config/lovelace-admin/40-system.yaml", line 125, column 0

The template works correctly on its own in Developer Tools --> Template. Also, the card works correctly, if I use a simple string instead of the Jinja2 template.

Is there any way to do this (using the default lovelace controls)?

Thank you in advance for any pointers!

v

Yes but you need a custom card to do it.

This uses JavaScript templates, not jinja. There is another custom card that uses jinja but it comes with a performance overhead.

Thank you, I’ll look into this!