Forum › Forum › Schnelle Frage › Abfallkalender über ICS Datei › Antwort auf: Abfallkalender über ICS Datei
13. Januar 2021 um 8:13
#1552
Teilnehmer
Hallo zusammen,
ich bin ziemlich neu bei/mit Home-Assistant unterwegs und habe auf der Suche nach einer Lösung für meinen Müllplan dieses Forum gefunden. Mit Hilfe der Anregungen von euch ist das hier dabei herausgekommen:
Die jeweiligen Icons blinken (schön langsam, damit es nicht nervt) wenn der Status der Tage bis zur Leerung <= 1 ist. Die Senoren dazu sind glaube ich hier in dem Thema oft genug gepostet worden 🙂
Hier der passende Code dazu:
<code class="language-markup-templating">type: horizontal-stack cards: - type: 'custom:button-card' entity: sensor.restmuell_collection icon: 'fas:trash' styles: icon: - width: 45px - color: gray - margin-bottom: 15px show_label: true label: | [[[ var days_to = entity.state if (days_to == 0) { return "Heute" } else if (days_to == 1) { return "Morgen" } else { return "in " + days_to + " Tagen" } ]]] show_name: false state: - styles: icon: - animation: blink 2s ease infinite operator: template value: '[[[ return entity.state <= 1 ]]]' - value: default - type: 'custom:button-card' entity: sensor.papier_collection icon: 'fas:trash' styles: icon: - width: 45px - color: 'rgb(66, 135, 245)' - margin-bottom: 15px show_label: true label: | [[[ var days_to = entity.state if (days_to == 0) { return "Heute" } else if (days_to == 1) { return "Morgen" } else { return "In " + days_to + " Tagen" } ]]] show_name: false state: - styles: icon: - animation: blink 2s ease infinite operator: template value: '[[[ return entity.state <= 1 ]]]' - value: default - type: 'custom:button-card' entity: sensor.plastik_collection icon: 'fas:trash' styles: icon: - width: 45px - color: 'rgb(237, 228, 97)' - margin-bottom: 15px show_label: true label: | [[[ var days_to = entity.state if (days_to == 0) { return "Heute" } else if (days_to == 1) { return "Morgen" } else { return "In " + days_to + " Tagen" } ]]] show_name: false state: - styles: icon: - animation: blink 2s ease infinite operator: template value: '[[[ return entity.state <= 1 ]]]' - value: default
Hinweis: Ich habe folgende Erweiterungen bei mir installiert und nutze diese in meinem Code:
- Waste Collection Schedule
- button-card
- fontawesome
Hoffe es hilft dem einen oder anderen.
Grüße
Brazier85