Thanks!
My “setup” is as follows:
In waste collection schedule I generate a “next pickup” sensor. I use that sensor to display in the Dashboard a markdown card that says “next pickup is ‘garbage type’ on ‘day of week’, ‘month’, ‘day’, ‘year’ (‘in X days’)”.
The problem (from what I understand) is that this only works using one sensor. At least I haven’t figured out how to pull in data from two sensors. And within waste collection schedule I can’t generate a “next pickup” sensor using two sources of waste pickup (two companies, different data sources).
My YAML looks as follows (private information excluded using “XXX”)
config.yaml
waste_collection_schedule:
sources:
- name: bsr_de
args:
abf_strasse: "XXX"
abf_hausnr: XXX
customize:
- type: "Abholung Hausmüll"
alias: Hausabfall
icon: mdi:trash-can
- type: "Abholung Biogut"
alias: Biogut
icon: mdi:recycle
- name: abfall_io
args:
key: "9583a2fa1df97ed95363382c73b41b1b"
f_id_kommune: 3227
f_id_strasse: XXX
f_id_strasse_hnr: XXX
f_abfallarten:
- 127
customize:
- type: "127"
alias: Wertstofftonne
icon: mdi:recycle-variant
fetch_time: "04:00"
day_switch_time: "08:00"
sensor:
# the first three sensors ("XXX_next") only generate the number of days until the next pickup with this type of waste. Intention: Use this to figure out what waste is being picked up next.
- platform: waste_collection_schedule
source_index: 1
name: Wertstoff_next
details_format: "upcoming"
value_template: "{{value.daysTo}}"
types:
- Wertstofftonne
- platform: waste_collection_schedule
source_index: 0
name: Restmuell_next
details_format: "upcoming"
value_template: "{{value.daysTo}}"
types:
- Hausabfall
- platform: waste_collection_schedule
source_index: 0
name: Biomuell_next
details_format: "upcoming"
value_template: "{{value.daysTo}}"
types:
- Biogut
- platform: waste_collection_schedule
source_index: 1
name: Wertstoff
details_format: "upcoming"
value_template: >-
{% if value.daysTo == 0 %}
HEUTE
{% elif value.daysTo == 1 %}
MORGEN
{% else %}
in {{value.daysTo}} Tagen
{% endif %}
types:
- Wertstofftonne
- platform: waste_collection_schedule
source_index: 0
name: Restmuell
details_format: "upcoming"
value_template: >-
{% if value.daysTo == 0 %}
HEUTE
{% elif value.daysTo == 1 %}
MORGEN
{% else %}
in {{value.daysTo}} Tagen
{% endif %}
types:
- Hausabfall
- platform: waste_collection_schedule
source_index: 0
name: Biomuell
details_format: "upcoming"
{% if value.daysTo == 0 %}
HEUTE
{% elif value.daysTo == 1 %}
MORGEN
{% else %}
in {{value.daysTo}} Tagen
{% endif %}
types:
- Biogut
# This is the "next pickup" sensor. Right now it's pulling data from index source 0 (bsr).
- 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 %}
Markdown code in Lovelace/Dashboard
type: entities
entities:
- type: custom:hui-element
label: Muellabholung
card_type: vertical-stack
cards:
- type: markdown
content: >-
## <ha-icon icon="mdi:trash-can"></ha-icon> Müllabholung
Die nächste Abholung ist der <b>{{
states.sensor.abfallnaechster_2.attributes.values() | first |
replace("Hausabfall", "Restmüll") | replace("Biomuell", "Biomüll") |
replace("Biogut", "Biomüll") }}</b>, am <b>{{
states.sensor.abfallnaechster_2.attributes | first | as_timestamp |
timestamp_custom("%A</b>, den %d. %b. %Y") | replace("Monday",
"Montag") | replace("Tuesday", "Dienstag") | replace("Wednesday",
"Mittwoch") | replace("Thursday", "Donnerstag") | replace("Friday",
"Freitag") | replace("Saturday", "Samstag") | replace("Sunday",
"Sonntag") | replace("Mar", "Mrz") | replace("May", "Mai") |
replace("Oct", "Okt") | replace("Dec", "Dez") }} ({{
states("sensor.abfallnaechster_2")}}).
- type: custom:collapsable-cards
title: Weitere Abholungen
cards:
- type: entities
entities:
- entity: sensor.restmuell
- entity: sensor.biomuell
- entity: sensor.wertstoff
show_header_toggle: false
state_color: false
Here’s what that then looks like. In theory it works, just in a limited fashion. Specifically, the “Wertstoff”-waste type is only listed in the entity list but would not be included in the markdown text (the sentence) if it were the next waste type to be picked up.
I hope this makes sense? Thanks for your help!!