Tile card icon color from template (without card-mod?)

Hello,
I’m trying to configure my tile card icon color to match the entity state.
I’m wondering, why template are not working to set my tile-card icon color ?

type: tile
entity: sensor.rte_tempo_couleur_actuelle
icon: mdi:lightning-bolt-circle
color: 'red'

this works:
image

but if I try to templage the color:

type: tile
entity: sensor.rte_tempo_couleur_actuelle
icon: mdi:lightning-bolt-circle
color: "{{ 'red' }}"

this time it’s not working :
image

Templating is not supposed to work on evey field ?
(of course I need to do a more compex template to remap my french colors in english, but i already tested it in template toolbox)

Thanks.

According to the docs, icons on tile cards can be coloured by token or code. No mention of templates.

1 Like

Templates are only supported in Markdown card for “content” option.

1 Like

@jackjourneyman what do you mean by code ?
from the card itself or from an automation or something else ?

Otherwise I will use card-mod :slight_smile:
(I also found another way by conditional display based on status value, but that’s a little messy I think)

Hexadecimal colour code.

Okay a little too static so :smile: