Ob deine Calender funktionieren weiß ich nicht, gehe ich aber von aus, wenn die Termine enthalten sind.
die Equals, also die Überstimmungen müssen natürlich auch passen. Wenn dein Eintrag bspw nicht Restmüll heißt, dann findet der natürlich nichts …
Der Helfer sollte so passen.
Die kommen aus der Dashboardkarte.
Im Raw-…Editor steht bespw:
decluttering_templates:
muellAbfuhr:
card:
type: custom:button-card
entity: "[[muellAbfuhr_entity]]"
tap_action:
action: none
hold_action:
action: none
show_name: true
show_icon: true
show_label: true
show_state: false
name: "[[muellAbfuhr_name]]"
Das hier: [[muellAbfuhr_entity]] und das hier: [[muellAbfuhr_name]] sind Variablen der decluttering-Card. Die werden befüllt, aus der Dashboardkarte. Dafür setzt du die Decluttering-Card in dein Dashboard, dahin wo die Ausgabe erscheinen soll und befüllst nur noch die Variablen, so z.B. (für Bio Müll)
type: custom:decluttering-card
template: muellAbfuhr
variables:
- muellAbfuhr_entity: sensor.abfuhr_bio_mull
- muellAbfuhr_name: Bio-Müll
...
Durch das Script in deiner configuration.yaml sind dir auch 4 neue Entitäten angelegt worden.
sensor.abfuhr_bio_mull zum Beispiel. Die musst du dann in die Karte übernehmen.
Wenn du das alles nicht benötigst (geht ja auch ohne Decluttering Card), dann nimmst du alles aus dem Raw-…Editor wieder raus und packst das einfach in eine Custom Button Card in deinem Dashboard.
Die Variablen musst du dann aber rausnehmen und mit den echten Entitäten befüllen., zum Beispiel dann so:
type: custom:button-card
entity: sensor.abfuhr_bio_mull
tap_action:
action: none
hold_action:
action: none
show_name: true
show_icon: true
show_label: true
show_state: false
name: Bio-Müll
label: |
[[[
if (entity.state == '0') return 'Heute';
if (entity.state == '1') return 'Morgen';
var datum = states['sensor.abfuhr_bio_mull'].attributes.datum;
return 'In ' + entity.state + ' Tagen';
]]]
styles:
card:
- background-color: |
[[[
if (parseInt(entity.state) <= '6') return '#4ab14f';
return 'rgba(27, 35, 54, 1)';
]]]
- border-radius: 12px
- padding: 8px
- height: 100px
grid:
- grid-template-areas: "\"i\" \"n\" \"l\""
- grid-template-columns: 1fr
- grid-template-rows: 1fr auto auto
icon:
- width: 35px
- color: |
[[[
if (parseInt(entity.state) <= '6') return '#fff';
return '#929292';
]]]
name:
- color: |
[[[
if (parseInt(entity.state) <= '6') return '#0a2f0c';
return '#929292';
]]]
- font-size: 13px
- font-weight: 400
- margin-top: 8px
label:
- color: |
[[[
if (parseInt(entity.state) <= '6') return '#0a2f0c';
return '#e1e1e1';
]]]
- font-size: 11px
- font-weight: 300
- margin-top: 4px
img_cell:
- width: 50px
- height: 50px
- justify-content: center
- border-radius: 14px
- background-color: |
[[[
if (parseInt(entity.state) <= '6') return 'rgba(255, 255, 255,0.2)';
return '#2f374a';
]]]