Als praktisches Beispiel, hier mal eine Markdown Kate mit den Abfuhrterminen.
Die Wochen Tage werden hier übersetzt. -> ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"]
Sowie die Monate -> ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"]
Code: Alles auswählen
type: markdown
content: |
{% set wochentag = ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"] %}
{% set wochentag_waste = wochentag[states.sensor.waste_collection_waste.attributes | first | as_timestamp |timestamp_custom("%w", false) | int ] %}
{% set wochentag_paper = wochentag[states.sensor.waste_collection_paper.attributes | first | as_timestamp |timestamp_custom("%w", false) | int ] %}
{% set wochentag_bio = wochentag[states.sensor.waste_collection_bio.attributes | first | as_timestamp |timestamp_custom("%w", false) | int ] %}
{% set monat = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"] %}
{% set monat_waste = monat[states.sensor.waste_collection_waste.attributes | first | as_timestamp |timestamp_custom("%m") | int - 1] %}
{% set monat_paper = monat[states.sensor.waste_collection_paper.attributes | first | as_timestamp |timestamp_custom("%m") | int - 1] %}
{% set monat_bio = monat[states.sensor.waste_collection_bio.attributes | first | as_timestamp |timestamp_custom("%m") | int - 1] %}
| Müll | Datum |
|------------|------------|
|<ha-icon icon="mdi:recycle"></ha-icon> Restmüll| {{ wochentag_waste}}, den {{ states.sensor.waste_collection_waste.attributes | first | as_timestamp | timestamp_custom("%d") }} {{monat_waste}} |
|<ha-icon icon="mdi:file"></ha-icon> Papiermüll| {{wochentag_paper}}, den {{ states.sensor.waste_collection_paper.attributes | first | as_timestamp | timestamp_custom("%d") }} {{monat_paper}} |
|<ha-icon icon="mdi:leaf"></ha-icon> Biomüll|{{wochentag_bio}}, den {{ states.sensor.waste_collection_bio.attributes | first | as_timestamp | timestamp_custom("%d") }} {{monat_bio}}|
![Abfuhrtermine.png](./download/file.php?id=98&sid=3438515622dc8af2717bf97136a6483b)
- Abfuhrtermine.png (28.9 KiB) 1978 mal betrachtet
Ohne der Übersetzung würde es so aussehen.
Code: Alles auswählen
type: markdown
content: |
| Müll | Datum |
|------------|------------|
|<ha-icon icon="mdi:recycle"></ha-icon> Restmüll| {{ states.sensor.waste_collection_waste.attributes | first | as_timestamp | timestamp_custom("%a, %m.%Y") }}|
|<ha-icon icon="mdi:file"></ha-icon> Papiermüll| {{ states.sensor.waste_collection_paper.attributes | first | as_timestamp | timestamp_custom("%a, %m.%Y") }} |
|<ha-icon icon="mdi:leaf"></ha-icon> Biomüll|{{ states.sensor.waste_collection_bio.attributes | first | as_timestamp | timestamp_custom("%a, %m.%Y") }} |
![Abfuhrtermine_orginal.png](./download/file.php?id=100&sid=3438515622dc8af2717bf97136a6483b)
- Abfuhrtermine_orginal.png (24.04 KiB) 1978 mal betrachtet
Gruß
Osorkon