Hi,
I build a poll card with the dwd-integration (see my example). I realised it with multiple-row.
I want to have the Weekdays in it changing everyday with the new datas like Mo, Tue, Wed
Is it possible to create dynamic names for the rows (heute, morgen, übermorgen). They contain the todays indey and tomorrow an in 2-days.
{% set week_ger = [‘Mo’, ‘Di’, ‘Mi’, ‘Do’, ‘Fr’, ‘Sa’, ‘So’] %}
{{ week_ger[state_attr(‘sensor.dwd_pollenflug_ambrosia_50’,‘last_update’).weekday()] }}
{{ week_ger[state_attr(‘sensor.dwd_pollenflug_ambrosia_50’,‘last_update’).weekday()+1] }}
type: custom:multiple-entity-row
entity: sensor.dwd_pollenflug_roggen_50
name: Roggen
icon: fapro:roggen
show_state: false
entities:
- entity: sensor.dwd_pollenflug_roggen_50
name: HEUTE
tap_action:
action: none
- entity: sensor.dwd_pollenflug_roggen_50
attribute: state_tomorrow
name: MORGEN
tap_action:
action: none
- entity: sensor.dwd_pollenflug_roggen_50
attribute: state_in_2_days
name: ÜBERMORGEN
tap_action:
action: none
tap_action:
action: none
style: |
:host {
--paper-item-icon-color:
{% set belastung = states('sensor.dwd_pollenflug_roggen_50') | int %}
{% if belastung == 0 %}#848484;
{% elif belastung == 0.5 %}#a8bf0f;
{% elif belastung == 1 %}#bfb10f;
{% elif belastung == 1.5 %}#bf900f;
{% elif belastung == 2 %}#bf730f;
{% elif belastung == 2.5 %}#bf4a0f;
{% elif belastung == 3 %}#bf0f0f;
{% endif %}
}
:host .entities-row div.entity:nth-child(1) div::after {
color: var(--secondary-text-color);
font-size: 0.7rem;
content: "\A {{relative_time(strptime(states.sensor.test_david_2_device_status.last_changed,"%H:%M:%S %d/%m/%Y"))}}";
white-space: pre;
}