Waste Collection Schedule Framework

Hi Nicole, falls Du ics per url benutzt hast steht das einer eigenen Integration in nichts nach. Nur für den Fall dass Du File benutzt hast/benutzen musstest hast Du einen Nachteil, denn Du musst einmal pro Jahr eine neue Datei kopieren.

2 Likes

Perfect! Thanks

Hi together,
today I tried the waste collection schedule integration with source “Landkreis Erlangen-Höchstadt” which is part of the ingration (hacs_waste_collection_schedule/erlangen_hoechstadt_de.md at 1c5ed8c3774c3fa877be105687a55c2110d9a53c · mampfes/hacs_waste_collection_schedule · GitHub)
I think my config is ok but my calendar is empty and my entity card shows “Unknown”.

waste_collection_schedule:
  sources:
    - name: erlangen_hoechstadt_de
      args:
        city: Herzogenaurach
        street: OT Niederndorf

  - platform: waste_collection_schedule
    name: Muellabfuhrtermine
    count: 4

First i thought that fetching time could be the problem, cause default is “01:00”. I changed it to something nearby, but calendar is still empty.
Then I thought that maybe there is a problem with the street, but I tried anotherone (Kellergasse) and it also did not work .

Any ideas? Is the source maybe corrupt?

This source is fetching only data of the current year. Therefore your calendar is empty. I will try to improve this soon.

I saw you already fixed it. I updated in 2023, so I can´t say if the fix or the new year worked, but now the calender is filled.

Hey, I would like to set up the waste_collection_schedule for myself.
I have an ics file from my garbage disposal. It is the AWG Wuppertal.
However, the types of waste are summarized there under Summery.

For “Restmüll”, e.g. “Restmüll/Bio” and later also “Restmüll/Restmüll-50%/Gelb” or “Restmüll/Bio/Papier”

Is it possible to select only “Restmüll” as the type there?
Because there are different combinations for each type of waste.

There is an option to split waste types in the summary string: split_at. Please check the ICS source docu.

hey thank you I had read the hint in the readme, but I couldn’t find the file at first
no it works fine!

Could someone help me set this up for New Zealand? I have to be honest out of all the integrations ive set up this one looks the hardest.

Would appreciate the help!

Thanks

Any dieas?

Logger: homeassistant.setup
Source: custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py:196
Integration: waste_collection_schedule (documentation)
First occurred: 3:24:42 PM (1 occurrences)
Last logged: 3:24:42 PM

Error during setup of component waste_collection_schedule
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 253, in _async_setup_component
    result = await task
  File "/config/custom_components/waste_collection_schedule/__init__.py", line 109, in async_setup
    api.add_source_shell(
  File "/config/custom_components/waste_collection_schedule/__init__.py", line 200, in add_source_shell
    SourceShell.create(
  File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py", line 196, in create
    source = source_module.Source(**source_args)  # type: ignore
TypeError: Source.__init__() got an unexpected keyword argument 'street_address'
Logger: homeassistant.setup
Source: setup.py:359
First occurred: 3:24:42 PM (1 occurrences)
Last logged: 3:24:42 PM

Unable to prepare setup for platform waste_collection_schedule.sensor: Unable to set up component.

Which source are you using? Please share your configuration.

Sorry I think I got it, I was using the wrong argument. I was using postcode but needed to use area_number instead.

I did not see links under your country and city which gave all the options. That helps!

One question though, my provider does not provide dates for rubbish, only recycling.

Can I create a manual one myself as rubbish is every week anyway.

Just like a static entry.

Thanks

Yes, you can: hacs_waste_collection_schedule/static.md at c636eda842a6aa856e7c89d99ad939081050f28b · mampfes/hacs_waste_collection_schedule · GitHub

Thanks,

How can I define multiple sources?

waste_collection_schedule:
  sources:
    - name: xxx_nz
      args:
        xxx: xxx
    - name: static
      args:
        xxx: xxx

Damn, im really struggling with this.

waste_collection_schedule:
  sources:
    - name: aucklandcouncil_govt_nz
      args:
        area_number: ########
      customize:
        - type: rubbish
          alias: rubbish
          show: true
          icon: mdi:bin
          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"

Does not like my config.

A fresh install, i’ve configured my source. I’ve tried running a test but I get the following error.

waste_collection_schedule:
  sources:
    - name: chesterfield_gov_uk
      args:
        uprn: 1234567890
Testing source chesterfield_gov_uk ...
Traceback (most recent call last):
  File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/test/test_sources.py", line 153, in <module>
    main()
  File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/test/test_sources.py", line 65, in main
    module = importlib.import_module(f"waste_collection_schedule.source.{f}")
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/chesterfield_gov_uk.py", line 3, in <module>
    import requests
ModuleNotFoundError: No module named 'requests'
➜  test 

Hello together.

The waste collection worked fine but now its strange and i have some problems with the icon/pictures. There ist a line with “picture” but the sensore has the normal trash icon. Any suggestions?

waste_collection_schedule:
  sources:
    - name: jumomind_de
      args:
        service_id: mymuell
        city_id: xxxx
        area_id: xxxx
      customize:
        - type: Resteabfall
          alias: Restmüll
          picture: https://medusaleiche.duckdns.org:8123/local/img/icon_trash_grey.png
        - type: Glasverpackungen
          alias: Glas
          picture: https://medusaleiche.duckdns.org:8123/local/img/icon_trash_glas.png
        - type: Leichtverpackungen
          alias: Gelber Sack
          picture: https://medusaleiche.duckdns.org:8123/local/img/icon_trash_yellow.png
        - type: Altpapier
          alias: Papier
          picture: https://medusaleiche.duckdns.org:8123/local/img/icon_trash_blue.png
        - type: pflanzliche Gartenabfälle
          alias: Gartenabfälle
          picture: https://medusaleiche.duckdns.org:8123/local/img/icon_trash_green.png

sensor:
  # ------- Garbage Collection ------- 
  # next collection
  - platform: waste_collection_schedule
    name: "Nächste Abholung"
    date_template: '{{value.date.strftime("%a, %d.%m.")}}'
    value_template: '{{value.types|join(", ")}}{% if value.daysTo == 0 %} Heute{% elif value.daysTo == 1 %} Morgen{% else %} in {{value.daysTo}} Tagen{% endif %}'
  # Nächste Restmüll-Abholung
  - platform: waste_collection_schedule
    name: "Restmüll"
    date_template: '{{value.date.strftime("%a, %d.%m.")}}'
    value_template: '{{value.types|join(", ")}}{% if value.daysTo == 0 %} Heute{% elif value.daysTo == 1 %} Morgen{% else %} in {{value.daysTo}} Tagen{% endif %}'
    types:
      - Restabfall
  # Nächste Glas Abholung
  - platform: waste_collection_schedule
    name: "Glas"
    date_template: '{{value.date.strftime("%a, %d.%m.")}}'
    value_template: '{{value.types|join(", ")}}{% if value.daysTo == 0 %} Heute{% elif value.daysTo == 1 %} Morgen{% else %} in {{value.daysTo}} Tagen{% endif %}'
    types:
      - Glasverpackungen
  # Nächste gelber-Sack Abholung
  - platform: waste_collection_schedule
    name: "Gelber Sack"
    date_template: '{{value.date.strftime("%a, %d.%m.")}}'
    value_template: '{{value.types|join(", ")}}{% if value.daysTo == 0 %} Heute{% elif value.daysTo == 1 %} Morgen{% else %} in {{value.daysTo}} Tagen{% endif %}'
    types:
      - Leichtverpackungen
  # Nächste Papiermüll Abholung
  - platform: waste_collection_schedule
    name: "Papier"
    date_template: '{{value.date.strftime("%a, %d.%m.")}}'
    value_template: '{{value.types|join(", ")}}{% if value.daysTo == 0 %} Heute{% elif value.daysTo == 1 %} Morgen{% else %} in {{value.daysTo}} Tagen{% endif %}'
    types:
      - Altpapier
 # Nächste Gartenabfälle Abholung
  - platform: waste_collection_schedule
    name: "Gartenabfälle"
    date_template: '{{value.date.strftime("%a, %d.%m.")}}'
    value_template: '{{value.types|join(", ")}}{% if value.daysTo == 0 %} Heute{% elif value.daysTo == 1 %} Morgen{% else %} in {{value.daysTo}} Tagen{% endif %}'
    types:
      - pflanzliche Gartenabfälle
 # Nächste Schadstoffe Abholung
  - platform: waste_collection_schedule
    name: "Schadstoffe"
    value_template: '{{value.types|join(", ")}}{% if value.daysTo == 0 %} Heute{% elif value.daysTo == 1 %} Morgen{% else %} in {{value.daysTo}} Tagen{% endif %}'
    types:
      - Schadstoffe


The Python package requests (and probably some more) are missing. How did you install waste_collection_schedule? The easiest way is to use HACS, because it should automatically installs all required packages.
The manual procedure is: pip3 install requests

Indentation is wrong. Try (not tested):

waste_collection_schedule:
  sources:
    - name: aucklandcouncil_govt_nz
      args:
        area_number: ########
      customize:
        - type: rubbish
          alias: rubbish
          show: true
          icon: mdi:bin
          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"