Waste Collection Schedule Framework

Strange. I installed it via HACS automatically.

I’ve run pip3 install requests and that has resolved the problem thanks.

Hi,
I also instatted waste collection schedule. The guide provided by helped me a lot.
I mostly worked with the following guide.
waste collection on github
I have 2 issues - How do I manage to extract the waste items I do not need (Biomüll is not collected, but it is still shown in the next date view:

  - entity: sensor.mybuttoncardsensor
    type: custom:button-card
    layout: icon_name_state2nd
    show_label: true
    label: |
      [[[
       var days_to = entity.state.split("|")[1]
       if (days_to == 0)
       { return "Heute" }
       else if (days_to == 1)
       { return "Morgen" }
       else
       { return "in " + days_to + " Tagen" }
      ]]]
    show_name: true
    name: |
      [[[
        return entity.state.split("|")[0]
      ]]]
    state:
      - color: red
        operator: template
        value: '[[[ return entity.state.split("|")[1] == 0 ]]]'
      - color: orange
        operator: template
        value: '[[[ return entity.state.split("|")[1] == 1 ]]]'
      - value: default
show_header_toggle: true

Can I somehow exclude the Biomüll there?
I would alsos lke to create an automation. Something like the Lightin the kitchen willl light up blue when Paper is collected on the next day, and yellow when the Verpackung is collected on the next day.
Thank you for tips and hints.
Sascha

You can filter the waste being returned by using the types parameter when configuring the sensor.

You can also hide waste types if you set show: False in the customize section.

Thank you!

Would I need to create another Sensor for that source? 2 sources = 2 sensors?

Sorry im not sure why this is really confusing me.

If I create 2 sources, how are the sensors linked to the sources?

I just want 2 entities to show,

1 for recycling which uses the aucklandcouncil_govt_nz source and one for rubbish which uses the static source.

Here is what I have

waste_collection_schedule:
  sources:
    - name: aucklandcouncil_govt_nz
      args:
        area_number: 12340156011
      customize:
        - type: recycling
          alias: recycling
          show: true
          icon: mdi:recycle
          picture: false
    - name: static
      args:
        type: rubbish
        icon: mdi:bin
        frequency: WEEKLY
        interval: 4
        start: '2023-01-01'
        until: '2025-01-14'
  fetch_time: "12:00"
  day_switch_time: "08:00"

sensor:
  - platform: waste_collection_schedule
#    source_index: SOURCE_INDEX
    name: recycling
    details_format: generic
#    details_format: DETAILS_FORMAT
#    count: COUNT
#    leadtime: LEADTIME
#    value_template: VALUE_TEMPLATE
#    date_template: DATE_TEMPLATE
#    add_days_to: ADD_DAYS_TO
    types:
      - recycling
      - rubbish

You have two sources, so you can use the sensor source_index parameter to assign the results to sensors. In your config, aucklandcouncil is source_index = 0, and static is source_index = 1.

If you want a sensor for each source, then do some thing like this:

- platform: waste_collection_schedule
  source_index: 0
  name: Recycling
  details_format: appointment_types
  add_days_to: true

- platform: waste_collection_schedule
  source_index: 1
  name: Rubbish
  details_format: appointment_types
  add_days_to: true

If you just want a single sensor that covers both waste types, then something like this:

- platform: waste_collection_schedule
  source_index: [0, 1]
  name: All_Waste
  details_format: appointment_types
  add_days_to: true

Thanks, here is what I have.

waste_collection_schedule:
  sources:
    - name: aucklandcouncil_govt_nz
      args:
        area_number: 12340156011
      customize:
        - type: rubbish
          alias: rubbish
          show: true
          icon: mdi:recycle
          picture: false
    - name: static
      args:
        type: rubbish
        frequency: WEEKLY
        interval: 4
        start: '2022-01-14'
        until: '2022-01-14'
  fetch_time: "12:00"
  day_switch_time: "08:00"
  
sensor:
  - platform: waste_collection_schedule
#    source_index: 0
    name: recycling
    details_format: appointment_types
    add_days_to: true
  - platform: waste_collection_schedule
#    source_index: 1
    name: rubbish
    details_format: appointment_types
    add_days_to: true

But still, the static rubbish sensor returns state “unknown”

Also, the recycling source has a icon set of recycle, but still it shows a bin?

With this config, both sensors will show the same data - because they only differ in the name. If you want to show different data, you have to set the source_index or add types or both - exactly as described by @ megadyptes.

I checked the aucklandcouncil_govt_nz source. This source already returns rubbish and recycle, so I think you don’t need the 2nd source (static).
image

waste_collection_schedule:
  sources:
    - name: aucklandcouncil_govt_nz
      args:
        area_number: ########
      customize:
        - type: rubbish
          icon: mdi:bin
        - type: recycle
          icon: mdi:recycle

sensor:
  - platform: waste_collection_schedule
    name: all_waste_types

  - platform: waste_collection_schedule
    name: recycle
    types:
      - recycle

  - platform: waste_collection_schedule
    name: rubbish
    types:
      - rubbish


Thanks for this, I tried with this config and its works well, much cleaner.

However, rubbish is still returning a value of “unknown”.

I am wondering though as I am rural, and on the website it does say that rubbish collections are provided by a different company.

Maybe you could run your test on my address to confirm?

Thanks

OK, I will test it with your address later. In advance: Do you see rubbish in the Home Assistant calendar?

No I dont see it. I do however have the entity that is unknown.

Hence why a test on my address may shed further light.

Ok, you’re right: Rubbish is missing for your address. Then try the following config:

waste_collection_schedule:
  sources:
    - name: aucklandcouncil_govt_nz
      args:
        area_number: 12340156011
      customize:
        - type: recycle
          icon: mdi:recycle
    - name: static
      args:
        type: rubbish
        frequency: WEEKLY
        interval: 4
        start: '2023-01-14'
        until: '2024-01-14'
      customize:
        - type: rubbish
          icon: mdi:bin

sensor:
  - platform: waste_collection_schedule
    name: all_waste_types
    source_index: [0, 1]

  - platform: waste_collection_schedule
    name: recycle
    source_index: 0
    types:
      - recycle

  - platform: waste_collection_schedule
    name: rubbish
    source_index: 1
    types:
      - rubbish

Hello @mampfes ,

thx for your nice work with this Plugin! I am using it for a few month now, sadly it wont work anymore. For a few weeks now all of my sensors are undefined:

I am Working with an .ics file from my google calendar since our garbage provider is not yet listed. That ics is also imported correctly, since i can see the entries in the “calendar.ics_2” calendar.

My suggestion would be that the sensors try to get information from “calendar.ics”, since the name of the name of the source is “ics” and not “ics_2”, but if i change the source name in my config to ics_2 it won´t create any calendar at all.

Removing all additional sensor configuration will not fix anything, so the error should be something more basic…

Can someone please tell me where the bug is? Been searching for a while now… The logs also are blank regarding waste_collection_schedule. Only Entry is the usual HACS warning…

Hey everyone,

I developed müll.io currently. It should be a clean API for access garbage collection dates from different provider in the future. Currently, I documented a openHAB integration, but need some help for a Home Assistant integration. Could someone help me to create a short integration guide like this: müll.io Please get in contact via PM with me (I would add your provider shortly). Lets keep the planet clean!!

Regards,
Tim

Hallo @tim.l @mampfes
I found this page via an article in c’t and would also like to collaborate on a scheme to retrieve garbage schedules for any address (at least in Germany).
I have developed an Alexa Skill “abfallkalender” which got quite popular in Germany.
It is currently configured via a web page by uploading an ICS file or providing a webcal URL from your garbage company. For that purpose I have collected a database covering all German zip codes and a few providers in Austria and Switzerland. It would be great to allow users to enter their address directly from the configuration page.
If you are interested in collaboration please pm me.

Thank you guys for creating such a great addonn. After some trying it really works well.
In my next step I would love ta create an automation that at Time 1700 it checks for upcoming garbage and if say, tomorrow the Altpapier is due, the Hue light strip in the kitchen will light up blue.
The best bet I guess is the

sensor.mybuttoncardsensor
which is defined as:

value_template: '{{value.types|join(", ")}}|{{value.daysTo}}|{{value.date.strftime("%d.%m.%Y")}}|> {{value.date.strftime("%a")}}'
in the configuration. So if the value Altpapier=morgen the light will be blue.

I have no idea how to code that properly.

Thanks for any tips

Check out youtube, there are already videos with instructions.

Try calendar automations: Calendar - Home Assistant