Abfallkalender in Home Assistant

Beispiel AWB Oldenburg

in der configuration.yaml:

waste_collection_schedule:
  sources:
    - name: awb_oldenburg_de
      args:
        street: 'Escherweg'
        house_number: '1'
#      customize:
#        - type: Restabfall
#          alias: Restabfall
#          icon: mdi:trash-can
#        - type: Gelber Sack/Tonne
#          alias: GelbeTonne
#          icon: mdi:recycle
#        - type: Altpapier
#          alias: Altpapier
#          icon: mdi:trash-can
#        - type: Bioabfall
#          alias: Bioabfall
#          icon: mdi:trash-can
  fetch_time: "04:00"
  day_switch_time: "11:00"

sensor:
  - platform: waste_collection_schedule
    name: AbfallRestabfall
    details_format: "upcoming"
    value_template: "{{ value.daysTo }}"
    types:
      - Restabfall

  - platform: waste_collection_schedule
    name: AbfallGelbeTonne
    details_format: "upcoming"
    value_template: "{{ value.daysTo }}"
    types:
      - Gelber Sack/Tonne

  - platform: waste_collection_schedule
    name: AbfallAltpapier
    details_format: "upcoming"
    value_template: "{{ value.daysTo }}"
    types:
      - Altpapier

  - platform: waste_collection_schedule
    name: AbfallBioabfall
    details_format: "upcoming"
    value_template: "{{ value.daysTo }}"
    types:
      - Bioabfall

  - platform: waste_collection_schedule
    name: AbfallNachster
    details_format: "upcoming"
    value_template: "{{ value.daysTo }}"

Wie man sehen kann, ist der „customize“-Block auskommentiert. Das liegt am Typ „Gelber Sack/Tonne“ – sobald das enthalten ist, landen die Zeiten der gelben Tonne nicht in der Entität. Ich tippe auf das „/“ als Störfaktor, es geht aber auch so.

Karte in der Übersicht

So sieht meine tile card aus:

- type: tile
                    entity: sensor.abfallnachster
                    name: Abfall - Nächste Leerung
                    tap_action:
                      action: navigate
                      navigation_path: abfall
                  - type: markdown
                    content: >
                      #### {{ states.sensor.abfallnachster.attributes.values() |
                      first }}:{{ states.sensor.abfallnachster.attributes |
                      first | as_timestamp | timestamp_custom(" %d.%m.%Y") }}

Und so die Karte mit den Details für alle Leerungen:

  - theme: Backend-selected
    subview: true
    path: abfall
    title: Abfall
    icon: mdi:trash-can
    type: sidebar
    badges: []
    cards:
      - type: grid
        square: false
        columns: 2
        cards:
          - type: entities
            entities:
              - entity: sensor.abfallnachster
                name: Nächster Abfall
                secondary_info: last-changed
              - entity: sensor.abfallrestabfall
              - entity: sensor.abfallbioabfall
              - entity: sensor.abfallgelbetonne
                icon: mdi:recycle
              - entity: sensor.abfallaltpapier
          - type: markdown
            content: >-

              ***

              ### Nächste Leerung 

              ### {{ states.sensor.abfallnachster.attributes.values() | first
              }}:{{ states.sensor.abfallnachster.attributes | first |
              as_timestamp | timestamp_custom(" %d.%m.%Y") }}


              ***

              Abfall | Tag
                :---|:---
              {{ states.sensor.abfallrestabfall.attributes.values() | first }}:
                 | {{ states.sensor.abfallrestabfall.attributes |
              first | as_timestamp | timestamp_custom(" %d.%m.%Y") }}

              {{ states.sensor.abfallbioabfall.attributes.values() | first }}:
                 | {{ states.sensor.abfallbioabfall.attributes | first
              | as_timestamp | timestamp_custom(" %d.%m.%Y") }}

              {{ states.sensor.abfallgelbetonne.attributes.values() | first }}:
                 | {{ states.sensor.abfallgelbetonne.attributes |
              first | as_timestamp | timestamp_custom(" %d.%m.%Y") }}

              {{ states.sensor.abfallaltpapier.attributes.values() | first }}: 
                  |  {{ states.sensor.abfallaltpapier.attributes |
              first | as_timestamp | timestamp_custom(" %d.%m.%Y") }}
            title: Abfall

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert