Merci @Pulpy-Luke !
Voici ce que cela donne pour moi. J’ai rajouté les logos centrés à 40px, une couleur GreenLime, pas de gras pour le chiffre en rouge et divisé en deux pour deux villes.
# CARBURANTS CHALON
- type: custom:stack-in-card
cards:
- type: markdown
content: >-
{%- set items = {1:'e10', 0:'sp95'} -%}
{%- set colormin = '#32CD32' -%}
{%- set colormax = 'red' -%}
{%- set prices = namespace(minima=[],maxima=[],update='') -%}
{%- for i in range(items|length) -%}
{%- set tmp = expand('group.carburants_chalon')
|selectattr('attributes.'+items[i]+'_price', 'ne', '-')
|map(attribute='attributes.'+items[i]+'_price')|list -%}
{%- set prices.minima = prices.minima + [min(tmp)] -%}
{%- set prices.maxima = prices.maxima + [max(tmp)] -%}
{%- endfor -%}
{%- set carburants_entities = expand('group.carburants_chalon') | map(attribute='entity_id')|list -%}
<table><thead><tr> <th colspan="2">Stations Chalon</th>
{%- for j in range(items|length) -%}
{{ '<th>'+items[j]|upper+' €/L</th>' }}
{%- endfor -%}
<th>Date</th> </tr></thead><tbody>
{%- for carburants_entity in carburants_entities -%}
{%- set prices.update = '01/01/20' -%}
{%- set nd = 0 -%}
<tr>
<td align='center'><img src="{{state_attr(carburants_entity, 'entity_picture')}}" height="40"> </td>
<td>{{states(carburants_entity)}}</td>
{%- for k in range(items|length) -%}
{%- set price=state_attr(carburants_entity, items[k]+'_price') -%}
<td align='center'>
{%- if price==prices.minima[k] -%}
{{ '<font color='+colormin+'><b>'+price+'</b></font>' }}
{%- elif price==prices.maxima[k] -%}
{{ '<font color='+colormax+'>'+price+'</font>' }}
{%- else -%}
{{price}}
{%- endif -%}
{%- set ndstr = state_attr(carburants_entity, items[k]+'_date') -%}
{%- if ndstr != '-' -%}
{%- set nd = strptime(ndstr, '%d/%m/%y')|as_timestamp -%}
{%- if nd >= strptime(prices.update, '%d/%m/%y')|as_timestamp -%}
{%- set prices.update = ndstr -%}
{%- endif -%}
{%- endif -%}
</td>
{%- endfor -%}
<td>{{ prices.update }}</td>
</tr>
{%- endfor -%}
</tr></tbody></table>
# CARBURANTS LE CREUSOT
- type: custom:stack-in-card
cards:
- type: markdown
content: >-
{%- set items = {1:'e10', 0:'sp95'} -%}
{%- set colormin = '#32CD32' -%}
{%- set colormax = 'red' -%}
{%- set prices = namespace(minima=[],maxima=[],update='') -%}
{%- for i in range(items|length) -%}
{%- set tmp = expand('group.carburants_creusot')
|selectattr('attributes.'+items[i]+'_price', 'ne', '-')
|map(attribute='attributes.'+items[i]+'_price')|list -%}
{%- set prices.minima = prices.minima + [min(tmp)] -%}
{%- set prices.maxima = prices.maxima + [max(tmp)] -%}
{%- endfor -%}
{%- set carburants_entities = expand('group.carburants_creusot') | map(attribute='entity_id')|list -%}
<table><thead><tr> <th colspan="2">Stations Le Creusot</th>
{%- for j in range(items|length) -%}
{{ '<th>'+items[j]|upper+' €/L</th>' }}
{%- endfor -%}
<th>Date</th> </tr></thead><tbody>
{%- for carburants_entity in carburants_entities -%}
{%- set prices.update = '01/01/20' -%}
{%- set nd = 0 -%}
<tr>
<td align='center'><img src="{{state_attr(carburants_entity, 'entity_picture')}}" height="40"> </td>
<td>{{states(carburants_entity)}}</td>
{%- for k in range(items|length) -%}
{%- set price=state_attr(carburants_entity, items[k]+'_price') -%}
<td align='center'>
{%- if price==prices.minima[k] -%}
{{ '<font color='+colormin+'><b>'+price+'</b></font>' }}
{%- elif price==prices.maxima[k] -%}
{{ '<font color='+colormax+'>'+price+'</font>' }}
{%- else -%}
{{price}}
{%- endif -%}
{%- set ndstr = state_attr(carburants_entity, items[k]+'_date') -%}
{%- if ndstr != '-' -%}
{%- set nd = strptime(ndstr, '%d/%m/%y')|as_timestamp -%}
{%- if nd >= strptime(prices.update, '%d/%m/%y')|as_timestamp -%}
{%- set prices.update = ndstr -%}
{%- endif -%}
{%- endif -%}
</td>
{%- endfor -%}
<td>{{ prices.update }}</td>
</tr>
{%- endfor -%}
</tr></tbody></table>
Résultat :