Hello
I have a garbage collection card set up to show me when the next pickup is for garbage, recycling and bio waste. Before the recent upgrade, the number of days would show under each image. For example if the recycle pickup was tomorrow, then “1 Day” would appear under the image of a recycle bin. Now it displays 1. 041666666. I’ve included a picture of the card. Can someone please tell me how I can get it back to “1 Day”? Thanks in advance for any help that can be provided.
Nobody can help you if you don’t post the code of the card and of whatever you use to calculate the days.
Hello
Thanks for the offer to help. Interestingly enough, the day is now displaying correctly. Here’s the code for the garbage collection:
type: custom:config-template-card
entities:
- sensor.waste_days
variables:
DAYS: states['sensor.waste_days'].attributes['days']+'d'
card:
type: picture-entity
entity: sensor.waste_days
name: ${DAYS}
show_name: true
show_state: false
state_image:
"0": /local/garbage/general_today.png
"1": /local/garbage/general_tomorrow.png
"2": /local/garbage/general_off.png
Here’s a screen shot of the current state. All seems good. Don’t know why I had that error yesterday.
Here’s some more code:
- type: horizontal-stack
cards:
- type: custom:config-template-card
entities:
- sensor.waste_days
variables:
DAYS: states['sensor.waste_days'].attributes['days']+'d'
card:
type: picture-entity
entity: sensor.waste_days
name: ${DAYS}
show_name: true
show_state: false
state_image:
'0': /local/garbage/general_today.png
'1': /local/garbage/general_tomorrow.png
'2': /local/garbage/general_off.png
- type: custom:config-template-card
entities:
- sensor.bio_days
variables:
DAYS: states['sensor.bio_days'].attributes['days']+'d'
card:
type: picture-entity
entity: sensor.bio_days
name: ${DAYS}
show_name: true
show_state: false
state_image:
'0': /local/garbage/bio_today.png
'1': /local/garbage/bio_tomorrow.png
'2': /local/garbage/bio_off.png
- type: custom:config-template-card
entities:
- sensor.recycle_days
variables:
DAYS: states['sensor.recycle_days'].attributes['days']+'d'
card:
type: picture-entity
entity: sensor.recycle_days
name: ${DAYS}
show_name: true
show_state: false
state_image:
'0': /local/garbage/plast_today.png
'1': /local/garbage/plast_tomorrow.png
'2': /local/garbage/plast_off.png