Waste Collection Schedule Framework

Verified that this component works with Region of Waterloo Waste Management Services .ics file


Scroll down
Select My Schedule
Enter Address (needs to be in Kitchener, Waterloo or Cambridge Ontario. - or surrounding townships)
Then select Get A Calandar
Select Outlook
It will give you a link to a ICS calendar subscription.
Use this in the config.

Voilà.

Great component.

1 Like

I’ve been trying to view my rubbish collection dates for a few hours now.
I first installed HACS and then the waste_collection_schedule addon.
But no matter what I try, I can’t get it to work.

Link to my ical -> LINK

Here is my configuration.yaml

waste_collection_schedule:
  sources:
    - name: ics
      args:
        file: "/local/abfallkalender.ics"
      customize:
        - type: Restmuelltonne
          alias: Restmülltonne
        - type: Papiertonne
          alias: Altpapiertonne
        - type: Biotonne
          alias: Biotonne
        - type: Gelber Sack
          alias: Gelber Sack

and here my sensor.yaml

- platform: waste_collection_schedule
  name: Restmuell_date
  value_template: '{{value.date.strftime("%d.%m.%Y")}}'
  types:
    - Restmuelltonne
- platform: waste_collection_schedule
  name: Restmuell_collection
  value_template: '{{value.daysTo}}'
  types:
    - Restmuelltonne
- platform: waste_collection_schedule
  name: Papier_Date
  value_template: '{{value.date.strftime("%d.%m.%Y")}}'
  types:
    - Papiertonne
- platform: waste_collection_schedule
  name: Papier_collection
  value_template: '{{value.daysTo}}'
  types:
    - Papiertonne
- platform: waste_collection_schedule
  name: bio_date
  value_template: '{{value.date.strftime("%d.%m.%Y")}}'
  types:
    - Biotonne
- platform: waste_collection_schedule
  name: bio_collection
  value_template: '{{value.daysTo}}'
  types:
    - Biotonne
- platform: waste_collection_schedule
  name: plastik_date
  value_template: '{{value.date.strftime("%d.%m.%Y")}}'
  types:
    - Gelber Sack
- platform: waste_collection_schedule
  name: plastik_collection
  value_template: '{{value.daysTo}}'
  types:
    - Gelber Sack

Hi, what is your actual problem? Did you check the log?

Anyhow, I tried the following configuration with your data and it worked out-of-the-box:

configuration.yaml:

waste_collection_schedule:
  sources:
    - name: ics
      args:
        url: "https://www.wetzlar.de/leben-in-wetzlar/abfall-und-entsorgung/abfuhrtermine-{%Y}.php?sp_garbagecalendar_location=Altenberger+Stra%C3%9Fe+bis+Nr.+34%2F63+%28Wetzlar%29&sp_garbagecalendar_view=categoryView&sp_garbagecalendar_garbageTypes%5B%5D=waste&sp_garbagecalendar_garbageTypes%5B%5D=bio&sp_garbagecalendar_garbageTypes%5B%5D=recycle&sp_garbagecalendar_garbageTypes%5B%5D=paper&sp_garbagecalendar_dateSelect_month=2&sp_garbagecalender_icalDownload=true"

Please note that I used the url instead of a local file and replaced the current year with {%Y}. Both ensures that you don’t have to worry about future updates of the ICS file anymore.

sensor.yaml:

- platform: waste_collection_schedule
  name: Abfall
  details_format: "upcoming"

First of all, I can’t find any logs from the waste_collection plugin, or I’m looking in the wrong place.
I can’t find any entries for it under Supervisor->System->Logs-Core.
And the problem is that I don’t get any values displayed, neither date nor remaining days.

Okay, now it works too.
I think the problem was the ics-File.
Thx.

But one more question:
Is there a way to install the addon manually, without HACS?

Hi all,
So i installed framework waste_collection_schedule via HACS and configured it. Problem is, I don’t get any values for the sensors.

Here is my configuration.yaml:

waste_collection_schedule:
sources:
- name: ics
args:
url: “https://calendar.google.com/calendar/ical/hd8jmkfnimdhidq8m1sqqdt7so%40group.calendar.google.com/public/basic.ics

sensors.yaml:

  • platform: waste_collection_schedule
    name: Restmuelltone_datum
    value_template: ‘{{value.date.strftime("%d.%m.%Y")}}’
    types:
    • Restmülltonne
  • platform: waste_collection_schedule
    name: Restmuelltone_abholung
    value_template: ‘{{value.daysTo}}’
    types:
    • Restmülltonne

Sorry for wrong formating. I have no idea, how I can format the code.
I hope you guys can help me to fix this issue.

Hi, the waste type Restmülltonne doesn’t match the description in the ics file Restmüll bis 240 Liter-Tonnen in Stadt Regensburg: Luise-Giese-Straße (PLZ: 93055). Use can add alias’ to get shorter (and matching) waste types:

waste_collection_schedule:
  sources:
    - name: ics
      args:
        url: 'https://calendar.google.com/calendar/ical/hd8jmkfnimdhidq8m1sqqdt7so%40group.calendar.google.com/public/basic.ics'
      customize:
        - type: 'Wertstoffsäcke in Stadt Regensburg: Luise-Giese-Straße (PLZ: 93055)'
          alias: Wertstoffsack
        - type: 'Restmüll bis 240 Liter-Tonnen in Stadt Regensburg: Luise-Giese-Straße (PLZ: 93055)'
          alias: Restmülltonne
        - type: 'Papiertonne in Stadt Regensburg: Luise-Giese-Straße (PLZ: 93055)'
          alias: Papiertonne

Now it works!
Thank you for your support and component!

Hi comunity… I have a question…

I implemented already the platform and it works fine… But now I need to implemet a secon location with a second Ics. In general it works and I have all the sensors. but now I need to define the next collection dates and the Button card sensors.

Here my try, but it is not based on the ics. All sensors together will be shown in lovelace.

- platform: waste_collection_schedule
  name: leiferde_next_waste_collection_daysto
  details_format: upcoming
  value_template: '{{value.types|join(", ")}} in {{value.daysTo}} Tagen'

- platform: waste_collection_schedule
  name: wehnsen_next_waste_collection_daysto
  details_format: upcoming
  value_template: '{{value.types|join(", ")}} in {{value.daysTo}} Tagen'
#button-card#
- platform: waste_collection_schedule
  name: leiferde-MyButtonCardSensor
  value_template: '{{value.types|join(", ")}}|{{value.daysTo}}|{{value.date.strftime("%d.%m.%Y")}}|{{value.date.strftime("%a")}}'
- platform: waste_collection_schedule
  name: wehnsen-MyButtonCardSensor
  value_template: '{{value.types|join(", ")}}|{{value.daysTo}}|{{value.date.strftime("%d.%m.%Y")}}|{{value.date.strftime("%a")}}'

And here my ics:

waste_collection_schedule:
  sources:
  - name: ics
    args:
      url: "https://calendar.google.com/calendar/ical/bmqsbfkr8val2rab0scilj9aes%40group.calendar.google.com/private-34c6c6fd3d5f4492f41f815e8fbe9492/basic.ics"         
    customize:
      - type: Restmüll
        alias: Leiferde-Restmüll
      - type: Altpapier
        alias: Leiferde Altpapier
      - type: Gelber Sack
        alias: Leiferde Gelber Sack
      - type: Sperrmüll
        alias: Leiferde Sperrmüll

  - name: Wehnsen
    args:
      url: "https://calendar.google.com/calendar/ical/8da7l5inaaegds3sjkkec6tvjo%40group.calendar.google.com/private-77ad3bf4914112641e40c0b01b46b05f/basic.ics"
    customize:
      - type: Altpapiertonne
        alias: Altpapier
      - type: Restmülltonne
        alias: Restmüll

Did anybody see a solution here?

Hi I already found the solution…

there needs to be implement the source_index too.

THX

Hi,

someone has problems with abfall.io? Since yesterday I suddenly do not get any data. Nothing changed, as well nothing strange in logs.

Did a fast check with postman and receiving 404. Can anyone confirm? Right now on work and not enough time to dig into it deeper :smiley:

Thanks and regards,

Lars

Confirmed. :+1:

Thanks for confirmation. Will try to look into it this evening to see what they have changed on the api endpoint.
Generally the api endpoint still works (schoenemakers.de can still use it)

@mampfes

Just checked with postman what is missing.

Strange thing…I need to set another full user-agent and add another formdata arg. See attached Screenshot. Only way for me to do not get a 404

Will add it in your python code this evening to verify



Hi,

figured it out.

We need to send an init request first. In this response we get a hidden input field.

Name and value from the input field have to be sent on export_csv request on body formdata as key value pair.

Pretty lame :confused: We need to parse the html response from the init request

@mampfes any suggestions?

EDIT:

name and value of the input field seems to be a constant depending on the user-agent which is sending the request.

For

Mozilla/5.0 (Windows NT 10.0; Win64; x64)

I always get as

name 776eeeb7e8423de0e1891742f71bad5d

and value b351047c9b31d29e12eb10affd5da957

As soon I use another user-agent the name value pair is changing.

Not sure if they are really constants (would be nice to prevent parsing the html elements)…I hardcoded it as args key value pair and it is working again

1 Like

@greiss.lars Thanks for your pre-work.

I fixed the issue by adding a init-request and parsing the hidden input field from the response.

Please update to version 1.1.0.

Regards

Steffen

2 Likes

@mampfes

Thanks for the fast fix! Working as expected

regards

Lars

1 Like

hi everyone,

i installed the integration via hacs and tried several ways to edit the config.yaml without any success. Every time I hit “check config” nothing happens - the wheel turns endless. As soon as I remove the part of the waste_collection_schedule it works. Can someone give me a hint please?

waste_collection_schedule:
  sources:
    - name: ics
      args:
        url: "https://calendar.google.com/calendar/ical/................calendar.google.com/public/basic.ics"

sensor:
  - platform: waste_collection_schedule
    name: gelbersack_date
    value_template: '{{value.date.strftime("%d.%m.%Y")}}'
    types:
      - Gelber Sack
  - platform: waste_collection_schedule
    name: gelbersack_collection
    value_template: "{{value.daysTo}}"
    types:
      - Gelber Sack

Strange! Your config looks good from what I see.

Did you check the log?

Hi everybody,

I have a problem. I can’t get any values from the waste calendar. Have I done something wrong? An error in the configuration is not displayed.

Here is my code:

waste_collection_schedule:
  sources:
    - name: ics
      args:
        file: "/local/Abfallkalender.ics"
      customize:
        - type: Biotonne
          alias: bio
          icon: mdi:trash-can
        - type: Glas
          alias: Glas
          icon: mdi:trash-can
        - type: Wertstofftonne
          alias: Wertstofftonne
          icon: mdi:recycle
        - type: Papiertonne
          alias: Papiertonne
          icon: mdi:trash-can
        - type: Restmuell 2-wchtl.
          alias: Restmuell 2-wchtl.
          icon: mdi:trash-can
  fetch_time: "04:00"
  day_switch_time: "11:00"

sensor:
- platform: waste_collection_schedule
  name: Biotonne
  details_format: "upcoming"
  value_template: '{{value.daysTo}}'
  types:
   -Biotonne
- platform: waste_collection_schedule
  name: Glas
  details_format: "upcoming"
  value_template: '{{value.daysTo}}'
  types:
   -Glas
- platform: waste_collection_schedule
  name: Wertstofftonne
  details_format: "upcoming"
  value_template: '{{value.daysTo}}'
  types:
   -Wertstofftonne
- platform: waste_collection_schedule
  name: Papiertonne
  details_format: "upcoming"
  value_template: '{{value.daysTo}}'
  types:
   -Papiertonne
- platform: waste_collection_schedule
  name: Restmuell 2-wchtl.
  details_format: "upcoming"
  value_template: '{{value.daysTo}}'
  types:
   -Restmuell 2-wchtl.

Here is the link to the ics:
https://gwa-abfuhrkalender.de/ical.html?jahr=2021&kommune=7&bezirk=56&filter=3,6,2,1,13

Could you help me with this?