Waste Collection Schedule Framework

Remove the dashes before alias and picture in line 20 and 21.

Thank you, no idea why I didn’t see that!
Adjusted and works.
I have an issue where the calender isn’t showing anything for the next collection and I think it’s causing the sensor to say unknown.

Does anybody know how to automate the year? In the URL there is a year “jahr=2021”. It would be nice to have this changed dynamically since the rest of the url will not change.

Thanks

If the original url contains the current year (4 digits including century), this can be replaced by the wildcard {%Y} (see example below).

https://github.com/mampfes/hacs_waste_collection_schedule/blob/a154769504e3ae79ddc84f7dd5c66dd27c2945c5/doc/source/ics.md

I checked the documentation but was not sure how it should look like.

From what I understood it should look like this:
url: “https://gwa-abfuhrkalender.de/ical.html?jahr={%Y}&kommune=7&bezirk=56&filter=3,6,2,1,13

Hi,

i entered the following in configuration.yaml, but in the calendar the schedules don’t appear.
Any idea?

waste_collection_schedule:
  sources:
    - name: abfallnavi_de
      args:
        service: aw-bg12
        ort: Bergisch Gladbach
        strasse: Voiswinkeler Straße

I would like to contribute to this project for Avondale AZ but I am running into a couple issues:

  1. Trash, Recycling, Bulk & Green Waste | City of Avondale (avondaleaz.gov) does not support ANY iCAL/ICS formatting. I would like to create the schedule accordingly “statically”
  2. We have Trash, Recycle and Bulk and each are divided into different Zones. How could I account for this in the framework?
  3. There is observance of (3) holidays that need to move the schedule a day ahead. How would you account for this?

Appreciate any help so I may contribute accordingly.

Hi there,

I tried to config this integration for the german abfall_io.

I got the parameters from the browser.

And add the parameters in the config-yaml.

After the restart of HA, the calendar is still empty.

See screenshots of FormData, config-yaml and empty cal here:

I don’t have an idea anymore… Maybe someone else?

Have you tried the wizard?

Simple Variant: Use wizard script

There is a script with an interactive command line interface which generates the required source configuration:

https://github.com/mampfes/hacs_waste_collection_schedule/blob/a79b0aed17a7e6cc00f4174d895788b810e49350/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/abfall_io.py.

First, install the Python module inquirer. Then run this script from a shell and answer the questions.

This works like a charm. It seems my ids have changed since I did this initially. However … as of now I dont get infors for “Schwarze Tonne”. Everything else works.

Sincerely.
Ralf

1 Like

Can anybody help? Many, many thanks.

Hallo hast du das mit der AWG hinbekommen, komme auch aus Wuppertal und würdes das ger e Umsetzten Gruß Thomas

Is there a best practice regarding turn of the year?
Cause if I use an ical with %Y some of my sensors switched to ‘unknown’. Which makes sense cause the next dates for this kind of waste is in 2024 and this dates are not part of the 2023 calendar :-/
But can I somehow fix this?

It looks like the Problem solved itself in 2024. It is now working!

Hi there. I have a problem and can’t find the error. I am only getting one entry in my calendar and that one is from yesterday.

I stripped the whole config of everything custom:

waste_collection_schedule:
  sources:
  - name: abfall_lippe_de
    args:
      gemeinde: Bad Salzuflen
      bezirk: BC
    calendar_title: Müllkalender

I am still just getting this one entry after a restart of HA. At first I thought that maybe it’s just loading the current year, but then I should have a history of past waste entrys in the calender, shouldn’t I?

The Sensor is working fine for the one entry I have…

Thanks!

Hi,
just tried this integration and it seems to work.
But: for “Wolfsburger Abfallwirtschaft und Straßenreinigung” only “Gelber Sack” is working, after multiple tries and reboots with different locations it’s always the same. The missing data is obviously not in the calendar, all entities show “unvailable”.
Current configuration.yaml

waste_collection_schedule:
  sources:
    - name: was_wolfsburg_de
      args:
        street: Jagdhaus
        city: Stadtmitte

States:

What to do?

I have Refuse and Recycling collection on the same day, however only the Refuse (waste) sensor seems to work, and the Recycling sensor just shows ‘Unknown’ for some reason. The council calendar integration works fine, just one of the sensor doesn’t show.

# next refuse collection
- platform: waste_collection_schedule
  name: Refuse Collection
  source_index: 0
  details_format: upcoming
  add_days_to: true
  value_template: "{{ value.daysTo }}"
  types:
    - Refuse

# next recycle_collection
- platform: waste_collection_schedule
  name: Recycling Collection
  source_index: 1
  details_format: upcoming
  add_days_to: true
  value_template: "{{ value.daysTo }}"
  types:
    - Recycle

I tried editing the source_index: number to match, but that didn’t make any difference.

Any ideas? Thanks

I haven’t read the whole topic, but is there a way to localise the “unit”, i.e. days?

@mampfes Thanks for your plugin. I use the ICS source that is supplied by a Recollect URL. All the waste types come from the source joined in a single string in a way that strongly depends on the collection date and may significantly differ from one week to another. I am trying to use a combination of split_at / regex source parameters but I am struggling to find a good combination so far. split_at seems to work as expected but the regex does not. Also, it seems to me that you apply the split_at first and then regex. If that is true I would like to suggest reverting the order so that the regex applies first to the entire summary and after a split happens.

Here is my current configuration:

waste_collection_schedule:
  sources:
    - name: ics
      args:
        url: 'webcal://recollect.a.ssl.fastly.net/api/places/30CF7566-7736-11E3-AB70-09EF8BE95184/services/224/events.en.ics?client_id=71B5291C-A9C2-11EE-851F-AEC3A0C91833'
        split_at: ','
        regex: '(\band\b)|(\([^)]*\))|\s'
      calendar_title: Waste Collection
      customize:
        - type: 'Garbage'
          alias: Garbage
          icon: mdi:trash-can
        - type: 'bulkwaste'
          alias: Bulk
          icon: mdi:sofa-single
        - type: 'bluebox'
          alias: Recycle
          icon: mdi:recycle
        - type: 'greencart'
          alias: Food
          icon: mdi:compost

This is an example of what is received from the source:

Garbage (Six Bags Maximum, No Tags Required), Blue Box, Green Cart, And Bulk Waste (3 Items Max) in 1 days

And this is how the calendar with my current configuration:

It’s visible that split_at is wrong when the comma is inside the brackets and is not applicable when there is no comma at all but they use “and”. It’s also visible that regex does not work at all as opposed to testing on regex101.com:

It’s challenging to debug both split_at and regex in a live instance of HAss and I was not able to find where in the code the split and clean-up occur. A reference will be appreciated very much. Also, if any specific conditions in the regex execution prevent expressions tested on regex101 from working.

I’d appreciate any help and advice with this configuration very much. Thanks in advance.

An update for the split_at and regex regular expression parameters of the ICS source. The updated split_at now correctly splits by commas or ‘and’ if there are no commas (compare with the screenshot in the previous post), but the regex still does not work despite of being thoroughly tested on regex101:

split_at: ',(?![^\(]*\))|(?<!,\s)\band\b'
regex: '\band\b|\([^)]*\)'

The split_at expression above matches a comma except when it’s inside the brackets ‘()’ and the ‘and’ word if there is no comma before it.

The regex expression above matches the ‘and’ word and all content in the brackets. My understanding from the docs is what was matched should be removed but it does not happen.

For the time being, I cannot diagnose the issue myself as I did not find in the code how either regular expression is executed, and I don’t see any errors in the log related to the waste-collection add-on.

One thing I noticed while debugging, using groups () in any regular expression was causing the log errors and the calendar not populated, so I don’t use them anymore. I figured out a working version for split_at but why the regex does not work is still a mystery. If anyone can shed more light I’d appreciate it very much.

Hello, i’m trying this integration out for the first time. and im stuck, i can’t figerout how to seperate the sensor for bin one and bin two. right know it just says ¨Kärl 1, kärl 370.0l, Kärl 2, kärl 370.0l¨ and i want to chage it to two sensors like
¨kärl 1¨ and ¨kärl 2¨.

This is the code i have. thanks

waste_collection_schedule:
  sources:
    - name: ssam_se
      args:
        street_address: MY_ADRESS


sensor:
  # next collection
  - platform: waste_collection_schedule
    name: next_collection

Hey guys,
since today my waste collection schedule doesn’t work anymore. i see the following in the logs

Logger: waste_collection_schedule.source_shell
Source: custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py:136
Integration: waste_collection_schedule (documentation)
First occurred: 8:09:40 PM (1 occurrences)
Last logged: 8:09:40 PM
fetch failed for source Apps by Abfall+: Traceback (most recent call last): File “/config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py”, line 134, in fetch entries = self._source.fetch() ^^^^^^^^^^^^^^^^^^^^ File “/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/app_abfallplus_de.py”, line 124, in fetch for d in self._app.generate_calendar(): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File “/config/custom_components/waste_collection_schedule/waste_collection_schedule/service/AppAbfallplusDe.py”, line 744, in generate_calendar self.init_connection() File “/config/custom_components/waste_collection_schedule/waste_collection_schedule/service/AppAbfallplusDe.py”, line 375, in init_connection self._request(“config.xml”, base=API_BASE, data=data).raise_for_status() File “/usr/local/lib/python3.11/site-packages/requests/models.py”, line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 503 Server Error: Service Unavailable for url: https://app.abfallplus.de/config.xml

A friend of mine who uses the same app has no problems. i dont understand what is going on.

And sorry, i dont find the button for proper formatting the code