Hallo,
I am currently working on my Waste-Collection calendar integration.
Calendar and dates are all integrated, Config and sensors created.
Configuration.yaml
sources:
- name: jumomind_de
args:
service_id: mymuell
city_id: 39764
area_id: 349
customize:
- type: Braune Biotonne
alias: braun
icon: mdi:trash-can-outline
- type: Gelbe Tonne / Container
alias: gelb
icon: mdi:trash-can
- type: Restmüll - 2 wöchentlich
alias: schwarz
icon: mdi:delete-cwaste_collection_schedule:ircle
- type: Blaue Tonne / Container
alias: blau
icon: mdi:delete-circle-outline
fetch_time: "04:00"
day_switch_time: "11:00"
sensors.yaml:
# ABFALL Sensoren
- platform: waste_collection_schedule
name: AbfallPlastik
details_format: "upcoming"
value_template: '{{ value.daysTo }}'
types:
- gelb
- platform: waste_collection_schedule
name: AbfallBio
details_format: "upcoming"
value_template: '{{ value.daysTo }}'
types:
- braun
- platform: waste_collection_schedule
name: AbfallRestmuell
details_format: "upcoming"
value_template: '{{ value.daysTo }}'
types:
- schwarz
- platform: waste_collection_schedule
name: AbfallPapier
details_format: "upcoming"
value_template: '{{ value.daysTo }}'
types:
- blau
- platform: waste_collection_schedule
name: AbfallNaechster
details_format: "upcoming"
value_template: ' {% if value.daysTo == 0 %} Heute{% elif value.daysTo == 1 %} Morgen{% else %} in {{value.daysTo}} tagen{% endif %}'
My Dashboard card is currently a markdown card:
type: markdown
content: >
### {{ states.sensor.abfallnaechster.attributes.values() | first }}
##### {{ states.sensor.abfallnaechster.attributes | first | as_timestamp |
timestamp_custom("%d.%m.%y") }}
###### {{ states.sensor.abfallnaechster.state }}
card_mod:
style: |
ha-card {
color: black;
font-size: 18px;
background-color: rgba(0 ,0 ,25, 0.0);
border-width: 1px;
border-radius: 3px;
}
The above code shows sth like this:
- gelb (which is the sensor type)
- Date of next collection
- Days till next collection
However, I would like to show an icon instead of the name/type, depending on the kind of trash (I have 4 sensors) that is next.
I dont have any idea how to do that.
I am thinking of some if else line (if next trash is yellow, show this icon, else if trash ist black show the other icon, etc…
Any idea how to do that?
As you can see I have added an icon in my sensors, but it is not catched here.
Also, I would prefer an uploaded icon (*-png) but that would be my second step.
Also one question regarding formatting: Any option to decrease the distance between each paragraph, so that my card will be not as large as it is now? And how could I center the text within the Markdown card?
I guess you notice that I am quite new to HA and I have not much knowledge in CSS.
Thx a lot
Thorsten