Hey guys,
I’ve got the following “garbage collection” card
this is the YAML:
type: custom:auto-entities
card:
type: glance
show_name: true
columns: 3
state_color: false
title: Aantal Dagen
show_state: true
show_icon: true
filter:
include:
- entity_id: sensor.gft_ophalen
- entity_id: sensor.pbd_ophalen
- entity_id: sensor.restafval_ophalen
sort:
method: state
numeric: true
reverse: false
show_empty: true
What I would like to change is the tiny symbols to become BIG and only the days left underneath.
And when the days are less than 2 (so 1 and 0) then the symbol gets a colour to signal collection of that type is due. (maybe blinking or w/e)
Ive been fiddling around with the following code:
type: grid
cards:
- type: custom:state-switch
entity: sensor.gft_ophalen
default: 0
states:
'1':
type: markdown
style: |
ha-card {
box-shadow: none;
font-size: 18px;
animation: blink 1s 4;
text-align: center;
padding: 10px}
@keyframes blink {
50% {
background-color:orange;
}
content: '# Morgen GFT !'
- type: custom:state-switch
entity: sensor.pbd_ophalen
default: 0
states:
'1':
type: markdown
style: |
ha-card {
box-shadow: none;
font-size: 18px;
animation: blink 1s 4;
text-align: center;
padding: 10px}
@keyframes blink {
50% {
background-color:orange;
}
content: '# Morgen Plastic !'
- type: custom:state-switch
entity: sensor.restafval_ophalen
default: 0
states:
'1':
type: markdown
style: |
ha-card {
box-shadow: none;
font-size: 18px;
animation: blink 1s 4;
text-align: center;
padding: 10px}
@keyframes blink {
50% {
background-color:orange;
}
content: '# Morgen Restafval !'
columns: 1
square: false
But this code is not showing anything (no error, just an empty card)
The sensors I use are custom templates:
- platform: template
sensors:
gft_ophalen:
friendly_name: "GFT"
value_template: "{{ state_attr('sensor.afvalinfo_gft', 'days_until_collection_date') }}"
pbd_ophalen:
friendly_name: "Plastic"
value_template: "{{ state_attr('sensor.afvalinfo_pbd', 'days_until_collection_date') }}"
restafval_ophalen:
friendly_name: "Restafval"
value_template: "{{ state_attr('sensor.afvalinfo_restafval', 'days_until_collection_date') }}"
I tried my best, but I can not see the wood for the trees.