├── custom_components
└── waste_collection_schedule
│ ├── waste_collection_schedule
│ ├── wizard
│ │ ├── __init__.py
│ │ ├── stuttgart_de.py
│ │ ├── awbkoeln_de.py
│ │ └── bsr_de.py
│ ├── service
│ │ └── __init__.py
│ ├── __init__.py
│ ├── source
│ │ ├── example.py
│ │ ├── stadtreinigung_hamburg.py
│ │ ├── lrasha_de.py
│ │ ├── data_umweltprofis_at.py
│ │ ├── abfalltermine_forchheim_de.py
│ │ ├── awbkoeln_de.py
│ │ ├── jumomind_de.py
│ │ ├── abfallnavi_de.py
│ │ ├── erlangen_hoechstadt_de.py
│ │ ├── stadtreinigung_dresden_de.py
│ │ ├── richmondshire_gov_uk.py
│ │ ├── was_wolfsburg_de.py
│ │ ├── york_gov_uk.py
│ │ ├── huntingdonshire_gov_uk.py
│ │ ├── awb_bad_kreuznach_de.py
│ │ ├── kwb_goslar_de.py
│ │ ├── c_trace_de.py
│ │ ├── sysav_se.py
│ │ ├── wiltshire_gov_uk.py
│ │ ├── awb_oldenburg_de.py
│ │ ├── awb_es_de.py
│ │ ├── vasyd_se.py
│ │ ├── lindau_ch.py
│ │ ├── stadtreinigung_leipzig_de.py
│ │ ├── landkreis_rhoen_grabfeld.py
│ │ ├── lerum_se.py
│ │ ├── republicservices_com.py
│ │ ├── ccc_govt_nz.py
│ │ ├── hygea_be.py
│ │ ├── belmont_wa_gov_au.py
│ │ ├── recyclesmart_com.py
│ │ ├── cambridge_gov_uk.py
│ │ ├── rushmoor_gov_uk.py
│ │ └── cochem_zell_online_de.py
│ ├── test
│ │ └── recurring.ics
│ └── collection.py
│ ├── const.py
│ └── manifest.json
├── doc
├── source
│ ├── awb_lm_de.md
│ ├── oslokommune_no.md
│ ├── awsh_de.md
│ ├── awr_de.md
│ ├── minrenovasjon_no.md
│ ├── hvcgroep_nl.md
│ ├── recyclesmart_com.md
│ ├── berlin_recycling_de.md
│ ├── stadt_willich_de.md
│ ├── awb_es_de.md
│ ├── stadtreinigung_leipzig_de.md
│ ├── lrasha_de.md
│ ├── sector27_de.md
│ ├── awb_oldenburg_de.md
│ ├── erlangen_hoechstadt_de.md
│ ├── guildford_gov_uk.md
│ ├── lindau_ch.md
│ ├── cambridge_gov_uk.md
│ ├── avl_ludwigsburg_de.md
│ ├── kwu_de.md
│ ├── rushmoor_gov_uk.md
│ ├── republicservices_com.md
│ ├── waipa_nz.md
│ ├── cochem_zell_online_de.md
│ ├── scambs_gov_uk.md
│ ├── wastenet_org_nz.md
│ ├── ssam_se.md
│ ├── sysav_se.md
│ ├── maroondah_vic_gov_au.md
│ ├── melton_vic_gov_au.md
│ ├── lerum_se.md
│ ├── wyndham_vic_gov_au.md
│ ├── fccenvironment_co_uk.md
│ ├── chesterfield_gov_uk.md
│ ├── vasyd_se.md
│ ├── stevenage_gov_uk.md
│ ├── belmont_wa_gov_au.md
│ ├── muenchenstein_ch.md
│ ├── newcastle_gov_uk.md
│ ├── stonnington_vic_gov_au.md
│ ├── canterbury_gov_uk.md
│ ├── thehills_nsw_gov_au.md
│ ├── york_gov_uk.md
│ ├── manchester_uk.md
│ ├── c_trace_de.md
│ ├── data_umweltprofis_at.md
│ ├── ximmio_nl.md
│ ├── richmondshire_gov_uk.md
│ ├── stadtreinigung_hamburg.md
│ ├── mrsc_vic_gov_au.md
│ ├── recycleapp_be.md
│ ├── nottingham_city_gov_uk.md
│ ├── awb_bad_kreuznach_de.md
│ ├── huntingdonshire_gov_uk.md
│ ├── colchester_gov_uk.md
│ ├── bmv_at.md
│ ├── wiltshire_gov_uk.md
│ ├── pgh_st.md
│ ├── abfalltermine_forchheim_de.md
│ ├── ipswich_qld_gov_au.md
│ ├── stadtreinigung_dresden_de.md
│ ├── ccc_govt_nz.md
│ ├── cheshire_east_gov_uk.md
│ ├── bradford_gov_uk.md
│ ├── was_wolfsburg_de.md
│ ├── canadabay_nsw_gov_au.md
│ ├── alw_wf_de.md
│ ├── landkreis_wittmund_de.md
│ ├── innerwest_nsw_gov_au.md
│ ├── seattle_gov.md
│ ├── walsall_gov_uk.md
│ ├── cornwall_gov_uk.md
│ ├── aucklandcouncil_govt_nz.md
│ ├── brisbane_qld_gov_au.md
│ ├── bsr_de.md
│ ├── nsomerset_gov_uk.md
│ ├── stuttgart_de.md
│ ├── hygea_be.md
│ ├── awbkoeln_de.md
│ ├── kaev_niederlausitz_de.md
│ ├── miljoteknik_se.md
│ ├── westberks_gov_uk.md
│ ├── kuringgai_nsw_gov_au.md
│ ├── campbelltown_nsw_gov_au.md
│ ├── sheffield_gov_uk.md
│ ├── a_region_ch.md
│ ├── wuerzburg_de.md
│ ├── aw_harburg_de.md
│ ├── derby_gov_uk.md
│ ├── rh_entsorgung_de.md
│ ├── awn_de.md
│ ├── jumomind_de.md
│ ├── muellmax_de.md
│ ├── abfallnavi_de.md
│ ├── bielefeld_de.md
│ ├── sbazv_de.md
│ ├── landkreis_rhoen_grabfeld.md
│ ├── nawma_sa_gov_au.md
│ ├── south_norfolk_and_broadland_gov_uk.md
│ ├── kwb_goslar_de.md
│ ├── infeo_at.md
│ ├── grafikai_svara_lt.md
│ ├── warszawa19115_pl.md
│ ├── banyule_vic_gov_au.md
│ ├── lewisham_gov_uk.md
│ ├── peterborough_gov_uk.md
│ ├── egn_abfallkalender_de.md
│ ├── abfall_zollernalbkreis_de.md
│ └── static.md
├── calendar.png
├── button-cards.png
├── default-entity.png
├── upcoming_details.png
├── more-info-generic.png
├── more-info-upcoming.png
├── next-collection-type.png
├── date-of-next-collections.png
├── days-to-next-collections.png
├── more-info-appointment-types.png
├── next-collections-date-and-days.png
└── configuration.yaml
├── images
└── icon.png
├── hacs.json
├── requirements.txt
├── .gitignore
├── tests
└── bandit.yaml
├── .github
└── workflows
│ └── hassfest.yaml
├── .devcontainer
├── configuration.yaml
└── devcontainer.json
├── LICENSE
└── .pre-commit-config.yaml
/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/service/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/doc/source/awb_lm_de.md:
--------------------------------------------------------------------------------
1 | # AWB Limburg-Weilburg
2 |
3 | Please use the [abfall.io source](abfall_io.md).
--------------------------------------------------------------------------------
/doc/calendar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/crash/hacs_waste_collection_schedule/master/doc/calendar.png
--------------------------------------------------------------------------------
/images/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/crash/hacs_waste_collection_schedule/master/images/icon.png
--------------------------------------------------------------------------------
/doc/button-cards.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/crash/hacs_waste_collection_schedule/master/doc/button-cards.png
--------------------------------------------------------------------------------
/doc/default-entity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/crash/hacs_waste_collection_schedule/master/doc/default-entity.png
--------------------------------------------------------------------------------
/doc/upcoming_details.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/crash/hacs_waste_collection_schedule/master/doc/upcoming_details.png
--------------------------------------------------------------------------------
/doc/more-info-generic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/crash/hacs_waste_collection_schedule/master/doc/more-info-generic.png
--------------------------------------------------------------------------------
/doc/more-info-upcoming.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/crash/hacs_waste_collection_schedule/master/doc/more-info-upcoming.png
--------------------------------------------------------------------------------
/hacs.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Waste Collection Schedule",
3 | "domains": ["sensor"],
4 | "iot_class": "cloud_polling"
5 | }
6 |
--------------------------------------------------------------------------------
/doc/next-collection-type.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/crash/hacs_waste_collection_schedule/master/doc/next-collection-type.png
--------------------------------------------------------------------------------
/doc/date-of-next-collections.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/crash/hacs_waste_collection_schedule/master/doc/date-of-next-collections.png
--------------------------------------------------------------------------------
/doc/days-to-next-collections.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/crash/hacs_waste_collection_schedule/master/doc/days-to-next-collections.png
--------------------------------------------------------------------------------
/doc/more-info-appointment-types.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/crash/hacs_waste_collection_schedule/master/doc/more-info-appointment-types.png
--------------------------------------------------------------------------------
/doc/next-collections-date-and-days.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/crash/hacs_waste_collection_schedule/master/doc/next-collections-date-and-days.png
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | beautifulsoup4==4.11.1
2 | icalendar==4.0.9
3 | icalevents==0.1.25
4 | recurring_ical_events==1.0.2b0
5 | requests==2.28.1
6 | urllib3==1.26.12
7 | PyYAML==6.0
8 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | __pycache__
2 | *.swp
3 | *.swo
4 | .vscode/
5 | .mypy_cache/
6 | venv/
7 | custom_components/waste_collection_schedule/waste_collection_schedule/test/secrets.yaml
8 | .DS_Store
9 | .venv/
10 | .idea/
11 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/__init__.py:
--------------------------------------------------------------------------------
1 | from .collection import Collection, CollectionBase, CollectionGroup # type: ignore # isort:skip # noqa: F401
2 | from .scraper import Customize, Scraper # noqa: F401
3 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/const.py:
--------------------------------------------------------------------------------
1 | """Constants for the Waste Collection Schedule component."""
2 |
3 | # Component domain, used to store component data in hass data.
4 | DOMAIN = "waste_collection_schedule"
5 |
6 | UPDATE_SENSORS_SIGNAL = "wcs_update_sensors_signal"
7 |
--------------------------------------------------------------------------------
/tests/bandit.yaml:
--------------------------------------------------------------------------------
1 | # https://bandit.readthedocs.io/en/latest/config.html
2 |
3 | tests:
4 | - B108
5 | - B306
6 | - B307
7 | - B313
8 | - B314
9 | - B315
10 | - B316
11 | - B317
12 | - B318
13 | - B319
14 | - B320
15 | - B325
16 | - B602
17 | - B604
18 |
--------------------------------------------------------------------------------
/.github/workflows/hassfest.yaml:
--------------------------------------------------------------------------------
1 | name: Validate with hassfest
2 |
3 | on:
4 | push:
5 | pull_request:
6 | schedule:
7 | - cron: "0 0 * * *"
8 |
9 | jobs:
10 | validate:
11 | runs-on: "ubuntu-latest"
12 | steps:
13 | - uses: "actions/checkout@v2"
14 | - uses: home-assistant/actions/hassfest@master
15 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "domain": "waste_collection_schedule",
3 | "name": "waste_collection_schedule",
4 | "documentation": "https://github.com/mampfes/hacs_waste_collection_schedule#readme",
5 | "requirements": ["icalendar", "recurring_ical_events", "icalevents", "bs4"],
6 | "dependencies": [],
7 | "codeowners": ["@mampfes"],
8 | "iot_class": "cloud_polling",
9 | "version": "1.27.0"
10 | }
11 |
--------------------------------------------------------------------------------
/.devcontainer/configuration.yaml:
--------------------------------------------------------------------------------
1 | default_config:
2 |
3 | logger:
4 | default: info
5 | logs:
6 | custom_components.waste_collection_schedule: debug
7 |
8 | # Change these config to your needs
9 | waste_collection_schedule:
10 | sources:
11 | - name: muellmax_de
12 | args:
13 | service: Rsa
14 | mm_frm_ort_sel: Alfter
15 | mm_frm_str_sel: Ahrweg (105-Ende/94-Ende)
16 |
17 | # If you need to debug uncomment the line below (doc: https://www.home-assistant.io/integrations/debugpy/)
18 | #debugpy:
19 |
--------------------------------------------------------------------------------
/doc/source/oslokommune_no.md:
--------------------------------------------------------------------------------
1 | # Oslo Kommune
2 |
3 | `street_id` needs to be looked up at kartverket:
4 |
5 | - Webgui: https://ws.geonorge.no/adresser/v1/#/default/get_sok
6 | - API: https://ws.geonorge.no/adresser/v1/sok?sok=Min%20Gate%2012
7 |
8 | `street_code` equals to `adressekode` and `county_id` equals to `kommunenummer`.
9 |
10 | ```yaml
11 | waste_collection_schedule:
12 | sources:
13 | - name: oslokommune_no
14 | args:
15 | street_name: ""
16 | house_number: ""
17 | house_letter: ""
18 | street_id: ""
19 | ```
20 |
--------------------------------------------------------------------------------
/doc/source/awsh_de.md:
--------------------------------------------------------------------------------
1 | # AWSH
2 |
3 | Support for schedules provided by [AWSH](https://www.awsh.de)
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: awsh_de
11 | args:
12 | city: CITY
13 | street: STREET
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **city**
19 | *(string) (required)*
20 |
21 | **street**
22 | *(string) (required)*
23 |
24 | ## Example
25 |
26 | ```yaml
27 | waste_collection_schedule:
28 | sources:
29 | - name: awsh_de
30 | args:
31 | city: Reinbek
32 | street: Ahornweg
33 | ```
34 |
--------------------------------------------------------------------------------
/doc/source/awr_de.md:
--------------------------------------------------------------------------------
1 | # AWR
2 |
3 | Support for schedules provided by [AWR](https://www.awr.de)
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: awr_de
11 | args:
12 | city: CITY
13 | street: STREET
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **city**
19 | *(string) (required)*
20 |
21 | **street**
22 | *(string) (required)*
23 |
24 | ## Example
25 |
26 | ```yaml
27 | waste_collection_schedule:
28 | sources:
29 | - name: awr_de
30 | args:
31 | city: Rendsburg
32 | street: Hindenburgstraße
33 | ```
34 |
--------------------------------------------------------------------------------
/doc/source/minrenovasjon_no.md:
--------------------------------------------------------------------------------
1 | # Min Renovasjon
2 |
3 | This plugin is based on https://github.com/Danielhiversen/home_assistant_min_renovasjon
4 |
5 | `street_code` and `county_id` needs to be looked up at kartverket:
6 |
7 | - Webgui: https://ws.geonorge.no/adresser/v1/#/default/get_sok
8 | - API: https://ws.geonorge.no/adresser/v1/sok?sok=Min%20Gate%2012
9 |
10 | `street_code` equals to `adressekode` and `county_id` equals to `kommunenummer`.
11 |
12 | ```yaml
13 | waste_collection_schedule:
14 | sources:
15 | - name: minrenovasjon_no
16 | args:
17 | street_name: "Rådhustorget"
18 | house_number: "2"
19 | street_code: "2469"
20 | county_id: "3024"
21 | ```
22 |
--------------------------------------------------------------------------------
/doc/source/hvcgroep_nl.md:
--------------------------------------------------------------------------------
1 | # HVCGroep
2 |
3 | Support for schedules provided by [hvcgroep.nl](https://www.hvcgroep.nl/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: hvcgroep_nl
11 | args:
12 | postal_code: POSTAL_CODE
13 | house_number: HOUSE_NUMBER
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **postal_code**
19 | *(string) (required)*
20 |
21 | **house_number**
22 | *(string) (required)*
23 |
24 | ## Example
25 |
26 | ```yaml
27 | waste_collection_schedule:
28 | sources:
29 | - name: hvcgroep_nl
30 | args:
31 | postal_code: 1713VM
32 | house_number: 1
33 | ```
34 |
--------------------------------------------------------------------------------
/doc/source/recyclesmart_com.md:
--------------------------------------------------------------------------------
1 | # RecycleSmart
2 |
3 | Support for schedules povided by [RecycleSmart](https://www.recyclesmart.com/)
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: recyclesmart_com
11 | args:
12 | email: EMAIL
13 | password: PASSWORD
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **email**
19 | *(string) (required)*
20 |
21 | **password**
22 | *(string) (required)*
23 |
24 | ## Example
25 |
26 | ```yaml
27 | waste_collection_schedule:
28 | sources:
29 | - name: recyclesmart_com
30 | args:
31 | email: abc@example.com
32 | password: 8WdpR%TZPPdM$n5*$FiRz
33 | ```
34 |
--------------------------------------------------------------------------------
/doc/source/berlin_recycling_de.md:
--------------------------------------------------------------------------------
1 | # Berlin Recycling
2 |
3 | Support for schedules provided by [berlin-recycling.de](https://www.berlin-recycling.de/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: berlin_recycling_de
11 | args:
12 | username: USERNAME
13 | password: PASSWORD
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **username**
19 | *(string) (required)*
20 |
21 | **password**
22 | *(string) (required)*
23 |
24 | ## Example
25 |
26 | ```yaml
27 | waste_collection_schedule:
28 | sources:
29 | - name: bsr_de
30 | args:
31 | username: My User Name
32 | password: My Password
33 | ```
34 |
--------------------------------------------------------------------------------
/doc/source/stadt_willich_de.md:
--------------------------------------------------------------------------------
1 | # GBW Gemeinschaftsbetrieb Willich
2 |
3 | Support for schedules provided by [stadt-willich.de](https://www.stadt-willich.de) located in NRW, Germany.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: stadt_willich_de
11 | args:
12 | street: Zum Schickerhof
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **street**
18 | *(string) (required)*
19 |
20 | ## How to get the source arguments
21 |
22 | Visit [stadt-willich.de](https://www.stadt-willich.de/de/dienstleistungen/abfallkalender-als-ical-datei/) and search for your address in the dropdown menu. The `street` argument should exactly match the result.
23 |
--------------------------------------------------------------------------------
/doc/source/awb_es_de.md:
--------------------------------------------------------------------------------
1 | # AWB Esslingen
2 |
3 | Support for schedules provided by [awb-es.de](https://www.awb-es.de) located in Baden Württemberg, Germany.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: awb_es_de
11 | args:
12 | city: Aichwald
13 | street: Alte Dorfstrasse
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **city**
19 | *(string) (required)*
20 |
21 | **street**
22 | *(string) (required)*
23 |
24 | ## How to get the source arguments
25 |
26 | Visit (Abfuhrtermine)[`https://www.awb-es.de/abfuhr/abfuhrtermine/__Abfuhrtermine.html`] and search for your address. The `city` and `street` argument should exactly match the autocomplete result.
27 |
--------------------------------------------------------------------------------
/doc/source/stadtreinigung_leipzig_de.md:
--------------------------------------------------------------------------------
1 | # HVCGroep
2 |
3 | Support for schedules provided by [stadtreinigung-leipzig.de](https://stadtreinigung-leipzig.de/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: stadtreinigung_leipzig_de
11 | args:
12 | street: STREET
13 | house_number: HOUSE_NUMBER
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **street**
19 | *(string) (required)*
20 |
21 | **house_number**
22 | *(string) (required)*
23 |
24 | ## Example
25 |
26 | ```yaml
27 | waste_collection_schedule:
28 | sources:
29 | - name: stadtreinigung_leipzig_de
30 | args:
31 | street: Bahnhofsallee
32 | house_number: 7
33 | ```
34 |
--------------------------------------------------------------------------------
/doc/source/lrasha_de.md:
--------------------------------------------------------------------------------
1 | # Landkreis Schwäbisch Hall
2 |
3 | Support for schedules provided by [Landkreis Schwäbisch Hall](https://www.lrasha.de) located in Baden-Württemberg, Germany.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: lrasha_de
11 | args:
12 | location: "97"
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **location**
18 | *(string) (required)*
19 |
20 | ## How to get the source arguments
21 |
22 | Visit [Abfallkalender](https://www.lrasha.de/de/buergerservice/abfallwirtschaft/abfallkalender), select your location and click on search. Now copy the download link and paste it somewhere to see it. The number after `location=` has to be entered in the configuration.
23 |
--------------------------------------------------------------------------------
/doc/source/sector27_de.md:
--------------------------------------------------------------------------------
1 | # Sector27.de
2 |
3 | Support for schedules provided by [Sector27.de](https://muellkalender.sector27.de). This service is used by the following cities:
4 |
5 | - Datteln
6 | - Marl
7 | - Oer-Erkenschwick
8 |
9 | ## Configuration via configuration.yaml
10 |
11 | ```yaml
12 | waste_collection_schedule:
13 | sources:
14 | - name: sector27_de
15 | args:
16 | city: CITY
17 | street: STREET
18 | ```
19 |
20 | ### Configuration Variables
21 |
22 | **city**
23 | *(string) (required)*
24 |
25 | **street**
26 | *(string) (required)*
27 |
28 | ## Example
29 |
30 | ```yaml
31 | waste_collection_schedule:
32 | sources:
33 | - name: sector27_de
34 | args:
35 | city: Marl
36 | street: Ahornweg
37 | ```
38 |
--------------------------------------------------------------------------------
/doc/source/awb_oldenburg_de.md:
--------------------------------------------------------------------------------
1 | # Abfallwirtschaftsbetrieb Stadt Oldenburg (Oldb)
2 |
3 | Support for schedules provided by [services.oldenburg.de](https://services.oldenburg.de/index.php?id=430).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: awb_oldenburg_de
11 | args:
12 | street: STREET
13 | house_number: HOUSE_NUMBER
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **street**
19 | *(string) (required)*
20 |
21 | **house_number**
22 | *(string) (required)*
23 |
24 | ## Example
25 |
26 | ```yaml
27 | waste_collection_schedule:
28 | sources:
29 | - name: awb_oldenburg_de
30 | args:
31 | street: 'Friedhofsweg'
32 | house_number: '30'
33 | ```
34 |
--------------------------------------------------------------------------------
/doc/source/erlangen_hoechstadt_de.md:
--------------------------------------------------------------------------------
1 | # Erlangen-Höchstadt
2 | Support for Landkreis [Erlangen-Höchstadt]() located in Bavaria, Germany.
3 |
4 | ## Configuration via configuration.yaml
5 |
6 | ```yaml
7 | waste_collection_schedule:
8 | sources:
9 | - name: erlangen_hoechstadt_de
10 | args:
11 | city: CITY
12 | street: STREET
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **city**
18 | *(string) (required)*
19 |
20 | **street**
21 | *(string) (required)*
22 |
23 | ### How to get the source arguments
24 |
25 | Visit [erlangen-hoechstadt.de](https://www.erlangen-hoechstadt.de/aktuelles/abfallkalender/) and search for your area. Use the value from the "Ort" dropdown as `city` argument and the one from "Ortsteil/Straße" as `street`. `street` is case sensitive!
--------------------------------------------------------------------------------
/doc/source/guildford_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Guildford Borough Council
2 |
3 | Support for schedules provided by [Guildord Borough Council](https://my.guildford.gov.uk/customers/s/view-bin-collections), serving Guildford, UK.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: guildford_gov_uk
11 | args:
12 | uprn: UPRN_CODE
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **uprn**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: guildford_gov_uk
26 | args:
27 | uprn: "10007060305"
28 | ```
29 |
30 | ## How to get the source argument
31 | # Find the UPRN of your address using https://www.findmyaddress.co.uk/search
32 |
--------------------------------------------------------------------------------
/doc/configuration.yaml:
--------------------------------------------------------------------------------
1 | waste_collection_schedule:
2 | sources:
3 | - name: muellmax_de
4 | args:
5 | service: His
6 | mm_frm_str_sel:
7 | customize:
8 | - type: brown bin
9 | show: no
10 | - type: green bin
11 | alias: Yard Waste
12 | - type: black bin
13 | alias: Garbage
14 |
15 | sensor:
16 | # next collection
17 | - platform: waste_collection_schedule
18 | name: next_collection
19 |
20 | # next yard waste collection
21 | - platform: waste_collection_schedule
22 | name: next_yard_collection
23 | types:
24 | - Yard Waste
25 |
26 | # next garbage collection
27 | - platform: waste_collection_schedule
28 | name: next_garbage_collection
29 | types:
30 | - Garbage
31 |
--------------------------------------------------------------------------------
/doc/source/lindau_ch.md:
--------------------------------------------------------------------------------
1 | # Abfallwirtschaft Zollernalbkreis
2 |
3 | Support for schedules provided by [https://www.lindau.ch/abfalldaten](https://www.lindau.ch/abfalldaten).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: lindau_ch
11 | args:
12 | city: Tagelswangen
13 |
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **city**
19 | *(string) (required)*
20 |
21 | Choose one of the following list:
22 |
23 | - Grafstal
24 | - Lindau
25 | - Tagelswangen
26 | - Winterberg
27 |
28 | or use one the following IDs: 190, 191, 192, 193
29 |
30 | ## Example
31 |
32 | ```yaml
33 | waste_collection_schedule:
34 | sources:
35 | - name: lindau_ch
36 | args:
37 | city: Tagelswangen
38 |
39 | ```
40 |
--------------------------------------------------------------------------------
/doc/source/cambridge_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Cambridge City Council
2 |
3 | Support for schedules provided by [Cambridge City Council](https://www.cambridge.gov.uk/check-when-your-bin-will-be-emptied), serving Cambridge (UK) and part of Cambridgeshire.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: cambridge_gov_uk
11 | args:
12 | post_code: POST_CODE
13 | number: NUMBER
14 |
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **POST_CODE**
20 | *(string) (required)*
21 |
22 | **NUMBER**
23 | *(string) (required)*
24 |
25 |
26 | ## Example
27 |
28 | ```yaml
29 | waste_collection_schedule:
30 | sources:
31 | - name: cambridge_gov_uk
32 | args:
33 | post_code: "CB13JD"
34 | number: "37"
35 | ```
36 |
--------------------------------------------------------------------------------
/doc/source/avl_ludwigsburg_de.md:
--------------------------------------------------------------------------------
1 | # AVL Ludwigsburg
2 |
3 | Support for schedules provided by [avl-ludwigsburg.de](https://www.avl-ludwigsburg.de) located in Baden Württemberg, Germany.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: avl_ludwigsburg_de
11 | args:
12 | city: Ludwigsburg
13 | street: Bahnhofstraße
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **city**
19 | *(string) (required)*
20 |
21 | **street**
22 | *(string) (optional - depending on city)*
23 |
24 | ## How to get the source arguments
25 |
26 | Check [avl-ludwigsburg.de Abfallkalender](https://www.avl-ludwigsburg.de/privatkunden/termine/abfallkalender/) if you only need the city e.g. Möglingen or if you need an additional street name e.g. in Ludwigsburg.
--------------------------------------------------------------------------------
/doc/source/kwu_de.md:
--------------------------------------------------------------------------------
1 | # KWU Entsorgung
2 |
3 | Support for schedules provided by [kwu-entsorgung.de](https://www.kwu-entsorgung.de/) located Landkreis Oder-Spree, Germany.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: kwu_de
11 | args:
12 | city: Bad Saarow
13 | street: Ahornallee
14 | number: 1
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **city**
20 | *(string) (required)*
21 |
22 | **street**
23 | *(string) (required)*
24 |
25 | **number**
26 | *(string) (required)*
27 |
28 | ## How to get the source arguments
29 |
30 | Visit (Entsorgungskalender)[`https://www.kwu-entsorgung.de/?page_id=337`] and search for your address. The `city`, `street` and `number` argument should exactly match the autocomplete result.
31 |
--------------------------------------------------------------------------------
/doc/source/rushmoor_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Rushmoor Borough Council
2 |
3 | Support for schedules provided by [Rushmoor Borough Council](https://www.rushmoor.gov.uk/recycling-rubbish-and-environment/bins-and-recycling/bin-collection-day-finder/), serving Rushmoor, UK.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: rushmoor_gov_uk
11 | args:
12 | uprn: UPRN_CODE
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **uprn**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: rushmoor_gov_uk
26 | args:
27 | uprn: "100060551749"
28 | ```
29 |
30 | ## How to get the source argument
31 | # Find the UPRN of your address using https://www.findmyaddress.co.uk/search
32 |
--------------------------------------------------------------------------------
/doc/source/republicservices_com.md:
--------------------------------------------------------------------------------
1 | # Republic Services
2 |
3 | Support for schedules provided by [Republic Services](https://republicservices.com), serving the municipality all over the United States of America.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: republicservices_com
11 | args:
12 | street_address: STREET_ADDRESS
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **street_address**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: republicservices_com
26 | args:
27 | street_address: "101 E Main St, Georgetown, KY 40324"
28 | ```
29 |
30 | ## How to check the street address
31 |
32 | The street address can be tested [here](https://republicservices.com).
--------------------------------------------------------------------------------
/doc/source/waipa_nz.md:
--------------------------------------------------------------------------------
1 | # Waipa District Council
2 |
3 | Support for schedules provided by [Waipa District Council](https://aucklandcouncil.govt.nz/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: waipa_nz
11 | args:
12 | address: ADDRESS # see 'How to get the source argument below'
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **address**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: waipa_nz
26 | args:
27 | address: 1 Acacia Avenue
28 | ```
29 |
30 | ## How to get the source argument
31 |
32 | Simply enter your street number and name as if you're searching on the online tool. Note that the first result will be selected if there are multiple search results.
33 |
--------------------------------------------------------------------------------
/doc/source/cochem_zell_online_de.md:
--------------------------------------------------------------------------------
1 | # Cochem-Zell
2 |
3 | Support for schedules provided by .
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: cochem_zell_online_de
11 | args:
12 | district: DISTRICT
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **district**
18 | _(string) (required)_
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: cochem_zell_online_de
26 | args:
27 | district: "Zell-Stadt"
28 | ```
29 |
30 | ## How to get the source arguments
31 |
32 | 1. Open .
33 | 2. Click on the selection field named `Ortsteil`.
34 | 3. Enter the name _with correct capitalization_ in the argument `district`.
35 |
--------------------------------------------------------------------------------
/doc/source/scambs_gov_uk.md:
--------------------------------------------------------------------------------
1 | # South Cambridgeshire District Council
2 |
3 | Support for schedules provided by [South Cambridgeshire District Council](https://www.scambs.gov.uk/recycling-and-bins/find-your-household-bin-collection-day/), serving South Cambridgeshire, UK.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: scambs_gov_uk
11 | args:
12 | post_code: POST_CODE
13 | number: NUMBER
14 | version: 2
15 |
16 | ```
17 |
18 | ### Configuration Variables
19 |
20 | **POST_CODE**
21 | *(string) (required)*
22 |
23 | **NUMBER**
24 | *(string) (required)*
25 |
26 | ## Example
27 |
28 | ```yaml
29 | waste_collection_schedule:
30 | sources:
31 | - name: scambs_gov_uk
32 | args:
33 | post_code: "CB236GZ"
34 | number: "53"
35 | ```
36 |
--------------------------------------------------------------------------------
/doc/source/wastenet_org_nz.md:
--------------------------------------------------------------------------------
1 | # WasteNet Southland
2 |
3 | Support for schedules provided by [WasteNet Southland](http://wastenet.org.nz/), serving the Gore District Council, Invercargill City Council and Southland District Council.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: wastenet_org_nz
11 | args:
12 | address: ADDRESS
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **address**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: wastenet_org_nz
26 | args:
27 | address: "31 Conyers Street INVERCARGILL"
28 | ```
29 |
30 | ## How to get the source argument
31 |
32 | The source argument is simply the full house mailing address as displayed in the web form, but without the comma.
33 |
--------------------------------------------------------------------------------
/doc/source/ssam_se.md:
--------------------------------------------------------------------------------
1 | # Sysav Sophämtning
2 |
3 | Support for schedules provided by [SSAM](https://ssam.se/mitt-ssam/hamtdagar.html), serving the municipality of Lessebo, Tingsryd, Älmhult, Markaryd and Växjö Sweden.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: ssam_se
11 | args:
12 | street_address: STREET_ADDRESS
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **street_address**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: ssam_se
26 | args:
27 | street_address: Andvägen 3, Växjö
28 | ```
29 |
30 | ## How to get the source argument
31 |
32 | The source argument is the address to the house with waste collection. The address can be tested [here](https://ssam.se/mitt-ssam/hamtdagar.html).
33 |
--------------------------------------------------------------------------------
/doc/source/sysav_se.md:
--------------------------------------------------------------------------------
1 | # Sysav Sophämtning
2 |
3 | Support for schedules provided by [Sysav](https://www.sysav.se/Privat/min-sophamtning/), serving the municipality of Svedala, Kävlinge and Lomma, Sweden.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: sysav_se
11 | args:
12 | street_address: STREET_ADDRESS
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **street_address**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: sysav_se
26 | args:
27 | street_address: Sommargatan 1, Svedala
28 | ```
29 |
30 | ## How to get the source argument
31 |
32 | The source argument is the address to the house with waste collection. The address can be tested [here](https://www.sysav.se/Privat/min-sophamtning/).
33 |
--------------------------------------------------------------------------------
/doc/source/maroondah_vic_gov_au.md:
--------------------------------------------------------------------------------
1 | # Maroondah City Council
2 |
3 | Support for schedules provided by [Maroondah City Council](https://www.maroondah.vic.gov.au).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: maroondah_vic_gov_au
11 | args:
12 | address: ADDRESS # see 'How to get the source argument below'
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **address**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: maroondah_vic_gov_au
26 | args:
27 | address: 14 Main Street, CROYDON 3136
28 | ```
29 |
30 | ## How to get the source argument
31 |
32 | Simply enter your street number and name as if you're searching on the online tool. Note that the first result will be selected if there are multiple search results.
33 |
--------------------------------------------------------------------------------
/doc/source/melton_vic_gov_au.md:
--------------------------------------------------------------------------------
1 | # Melton City Council
2 |
3 | Support for schedules provided by [Melton City Council](https://www.melton.vic.gov.au/My-Area).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: melton_vic_gov_au
11 | args:
12 | street_address: STREET_ADDRESS
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **street_address**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: melton_vic_gov_au
26 | args:
27 | street_address: 23 PILBARA AVENUE BURNSIDE 3023
28 | ```
29 |
30 | ## How to get the source arguments
31 |
32 | Visit the [Melton City Council waste and recycling](https://www.melton.vic.gov.au/My-Area) page and search for your address. The arguments should exactly match the street address shown in the autocomplete result.
--------------------------------------------------------------------------------
/doc/source/lerum_se.md:
--------------------------------------------------------------------------------
1 | # Lerum Vatten och Avlopp
2 |
3 | Support for schedules provided by [Lerum Vatten och Avlopp](https://vatjanst.lerum.se/FutureWeb/SimpleWastePickup/SimpleWastePickup), serving the municipality of Lerum, Sweden.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: lerum_se
11 | args:
12 | street_address: STREET_ADDRESS
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **street_address**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: lerum_se
26 | args:
27 | street_address: Götebordsvägen 16, Lerum
28 | ```
29 |
30 | ## How to get the source argument
31 |
32 | The source argument is the address to the house with waste collection. The address can be tested [here](https://vatjanst.lerum.se/FutureWeb/SimpleWastePickup/SimpleWastePickup).
33 |
--------------------------------------------------------------------------------
/doc/source/wyndham_vic_gov_au.md:
--------------------------------------------------------------------------------
1 | # Wyndham City Council
2 |
3 | Support for schedules provided by [Wyndham City Council](https://digital.wyndham.vic.gov.au/myWyndham/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: wyndham_vic_gov_au
11 | args:
12 | street_address: STREET_ADDRESS
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **street_address**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: wyndham_vic_gov_au
26 | args:
27 | street_address: 300 SAYERS ROAD TRUGANINA 3029
28 | ```
29 |
30 | ## How to get the source arguments
31 |
32 | Visit the [Wyndham City Council waste and recycling](https://digital.wyndham.vic.gov.au/myWyndham/) page and search for your address. The arguments should exactly match the street address shown in the autocomplete result.
--------------------------------------------------------------------------------
/doc/source/fccenvironment_co_uk.md:
--------------------------------------------------------------------------------
1 | # FCC Environment
2 |
3 | Consolidated support for schedules provided by ~60 local authorities. Currently supports [Harborough District Council](www.harborough.gov.uk)
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: fccenvironment_co_uk
11 | args:
12 | uprn: UNIQUE_PROPERTY_REFERENCE_NUMBER
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **uprn**
18 | *(string) (required)*
19 |
20 | This is required to unambiguously identify the property.
21 |
22 | ## Example using UPRN
23 | ```yaml
24 | waste_collection_schedule:
25 | sources:
26 | - name: fccenvironment_co_uk
27 | args:
28 | uprn: 100030493289
29 | ```
30 |
31 | ## How to find your `UPRN`
32 |
33 | An easy way to find your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.
--------------------------------------------------------------------------------
/doc/source/chesterfield_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Chesterfield Borough Council
2 |
3 | Support for schedules provided by [Chesterfield Borough Council](https://www.chesterfield.gov.uk/bins-and-recycling/bin-collections/check-bin-collections.aspx)
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: chesterfield_gov_uk
11 | args:
12 | uprn: UNIQUE_PROPERTY_REFERENCE_NUMBER
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **uprn**
18 | *(string) (required)*
19 |
20 | This is required to unambiguously identify the property.
21 |
22 | ## Example using UPRN
23 | ```yaml
24 | waste_collection_schedule:
25 | sources:
26 | - name: chesterfield_gov_uk
27 | args:
28 | uprn: 74023685
29 | ```
30 |
31 | ## How to find your `UPRN`
32 |
33 | An easy way to find your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.
--------------------------------------------------------------------------------
/doc/source/vasyd_se.md:
--------------------------------------------------------------------------------
1 | # Sysav Sophämtning
2 |
3 | Support for schedules provided by [VA Syd](https://www.vasyd.se/Artiklar/Avfall-och-soptomning-privat/sopt%C3%B6mning-schema/), serving the municipality of Malmö, Lund, Lomma, Eslöv and Burlöv, Sweden.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: vasyd_se
11 | args:
12 | street_address: STREET_ADDRESS
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **street_address**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: vasyd_se
26 | args:
27 | street_address: Industrigatan 13, Malmö
28 | ```
29 |
30 | ## How to get the source argument
31 |
32 | The source argument is the address to the house with waste collection. The address can be tested [here](https://www.vasyd.se/Artiklar/Avfall-och-soptomning-privat/sopt%C3%B6mning-schema/).
33 |
--------------------------------------------------------------------------------
/doc/source/stevenage_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Stevenage Borough Council
2 |
3 | Support for schedules provided by [Stevenage Borough Council](https://www.stevenage.gov.uk/waste-and-recycling/your-bin-collections).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: stevenage_gov_uk
11 | args:
12 | postcode: POST_CODE
13 | road: ROAD
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **postcode**
19 | *(string) (required)*
20 |
21 | Postcode of property. This is required. Stevenage Borough Council API does not support UKPRN. Single space between 1st and 2nd part of postcode is optional.
22 |
23 | **road**
24 | *(string) (required)*
25 |
26 | Name of road property is in. This is required.
27 |
28 | ## Example
29 | ```yaml
30 | waste_collection_schedule:
31 | sources:
32 | - name: stevenage_gov_uk
33 | args:
34 | postcode: SG2 9TL
35 | road: Coopers Close
36 | ```
37 |
--------------------------------------------------------------------------------
/doc/source/belmont_wa_gov_au.md:
--------------------------------------------------------------------------------
1 | # Belmont City Council
2 |
3 | Support for schedules provided by [Belmont City Council Waste and Recycling](https://www.belmont.wa.gov.au/live/at-your-place/bins,-waste-and-recycling).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: belmont_wa_gov_au
11 | args:
12 | address: ADDRESS
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **address**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: belmont_wa_gov_au
26 | args:
27 | address: 196 Abernethy Road Belmont 6104
28 | ```
29 |
30 | ## How to get the source arguments
31 |
32 | Visit the [Belmont City Council Waste and Recycling](https://www.belmont.wa.gov.au/live/at-your-place/bins,-waste-and-recycling) page and search for your address. The arguments should exactly match the results of the property.
--------------------------------------------------------------------------------
/doc/source/muenchenstein_ch.md:
--------------------------------------------------------------------------------
1 | # Abfallsammlung Münchenstein, BL, Switzerland
2 |
3 | Support for schedules provided by [https://www.muenchenstein.ch/abfallsammlung](https://www.muenchenstein.ch/abfallsammlung).
4 |
5 | This source is just a slight modification of [@atrox06](https://github.com/atrox06)'s work for lindau_ch. So kudos to him.
6 |
7 | ## Configuration via configuration.yaml
8 |
9 | ```yaml
10 | waste_collection_schedule:
11 | sources:
12 | - name: muenchenstein_ch
13 | args:
14 | waste_district: DISTRICT
15 |
16 | ```
17 |
18 | ### Configuration Variables
19 |
20 | **waste_district**
21 | *(string) (required)*
22 |
23 | Valid options for waste_district:
24 | - Abfuhrkreis Ost
25 | - Abfuhrkreis West
26 |
27 | or use one the following IDs: 491 for "Ost", 492 for "West"
28 |
29 | ## Example
30 |
31 | ```yaml
32 | waste_collection_schedule:
33 | sources:
34 | - name: muenchenstein_ch
35 | args:
36 | waste_district: Abfuhrkreis West
37 |
38 | ```
39 |
--------------------------------------------------------------------------------
/doc/source/newcastle_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Newcastle City Council
2 |
3 | Support for schedules provided by [Newcastle City Council](https://community.newcastle.gov.uk/my-neighbourhood/)
4 |
5 | **Note**: Collection schedule will only show the next date, not all future dates
6 |
7 | ## Configuration via configuration.yaml
8 |
9 | ```yaml
10 | waste_collection_schedule:
11 | sources:
12 | - name: newcastle_gov_uk
13 | args:
14 | uprn: UNIQUE_PROPERTY_REFERENCE_NUMBER
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **uprn**
20 | *(string) (required)*
21 |
22 | This is required to unambiguously identify the property.
23 |
24 | ## Example using UPRN
25 | ```yaml
26 | waste_collection_schedule:
27 | sources:
28 | - name: newcastle_gov_uk
29 | args:
30 | uprn: 74023685
31 | ```
32 |
33 | ## How to find your `UPRN`
34 |
35 | An easy way to find your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.
--------------------------------------------------------------------------------
/doc/source/stonnington_vic_gov_au.md:
--------------------------------------------------------------------------------
1 | # Stonnington City Council
2 |
3 | Support for schedules provided by [Stonnington City Council](https://www.stonnington.vic.gov.au/Services/Waste-and-recycling).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: stonnington_vic_gov_au
11 | args:
12 | street_address: STREET_ADDRESS
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **street_address**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: stonnington_vic_gov_au
26 | args:
27 | street_address: 500 Chapel Street, South Yarra
28 | ```
29 |
30 | ## How to get the source arguments
31 |
32 | Visit the [Stonnington City Council waste and recycling](https://www.stonnington.vic.gov.au/Services/Waste-and-recycling) page and search for your address. The arguments should exactly match the street address shown in the autocomplete result.
33 |
--------------------------------------------------------------------------------
/doc/source/canterbury_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Canterbury City Council
2 |
3 | Support for schedules provided by [Canterbury City Council](https://www.canterbury.gov.uk/bins-and-waste/find-your-bin-collection-dates/), serving Canterbury (UK) and parts of Kent.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: canterbury_gov_uk
11 | args:
12 | post_code: POST_CODE
13 | number: NUMBER
14 |
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **POST_CODE**
20 | *(string) (required)*
21 |
22 | **NUMBER**
23 | *(string) (required)*
24 |
25 |
26 | ## Examples
27 |
28 | ```yaml
29 | waste_collection_schedule:
30 | sources:
31 | - name: canterbury_gov_uk
32 | args:
33 | post_code: "ct68ru"
34 | number: "63"
35 | ```
36 |
37 | ```yaml
38 | waste_collection_schedule:
39 | sources:
40 | - name: canterbury_gov_uk
41 | args:
42 | post_code: "ct68ru"
43 | number: "KOWLOON"
44 | ```
45 |
--------------------------------------------------------------------------------
/doc/source/thehills_nsw_gov_au.md:
--------------------------------------------------------------------------------
1 | # The Hills, Sydney's Garden Shire
2 |
3 | Support for schedules provided by [The Hills Council](https://www.thehills.nsw.gov.au/Home), serving the city of Sydney, Australia.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: thehills_nsw_gov_au
11 | args:
12 | suburb: SUBURB
13 | street: STREET
14 | houseNo: HOUSENO
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **suburb**
20 | *(string) (required)*
21 |
22 | **street**
23 | *(string) (required)*
24 |
25 | **houseNo**
26 | *(string) (required)*
27 |
28 | ## Example
29 |
30 | ```yaml
31 | waste_collection_schedule:
32 | sources:
33 | - name: thehills_nsw_gov_au
34 | args:
35 | suburb: ANNANGROVE
36 | street: Amanda Place
37 | houseNo: 10
38 | ```
39 |
40 | ## How to get the source arguments
41 |
42 | The source arguments are simply the values of the 3 selections from the web form.
43 |
--------------------------------------------------------------------------------
/doc/source/york_gov_uk.md:
--------------------------------------------------------------------------------
1 | # York Council
2 |
3 | Support for schedules provided by [York Council](https://myaccount.york.gov.uk/bin-collections), serving the city of York, UK.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: york_gov_uk
11 | args:
12 | uprn: UPRN_CODE
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **uprn**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: york_gov_uk
26 | args:
27 | uprn: "100050580641"
28 | ```
29 |
30 | ## How to get the source argument
31 |
32 | The UPRN code can be found in the network request when entering your postcode and selecting your address on the [York Waste Collection Calendar page](https://myaccount.york.gov.uk/bin-collections). You should look for a request like `https://waste-api.york.gov.uk/api/GetBinCollectionLocationForUprn/010093236548` the last segment is your UPRN code.
33 |
--------------------------------------------------------------------------------
/doc/source/manchester_uk.md:
--------------------------------------------------------------------------------
1 | # Manchester City Council
2 |
3 | Support for schedules provided by [Manchester City
4 | Council](https://www.manchester.gov.uk/bincollections/), serving the
5 | city of Manchester, UK.
6 |
7 | ## Configuration via configuration.yaml
8 |
9 | ```yaml
10 | waste_collection_schedule:
11 | sources:
12 | - name: manchester_uk
13 | args:
14 | uprn: UPRN_CODE
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **uprn**
20 | *(string) (required)*
21 |
22 | ## Example
23 |
24 | ```yaml
25 | waste_collection_schedule:
26 | sources:
27 | - name: manchester_uk
28 | args:
29 | uprn: "100031540175"
30 | ```
31 |
32 | ## How to get the source argument
33 |
34 | The UPRN code can be found in the page by entering your postcode on the
35 | [Manchester City Council Bin Collections page
36 | ](https://www.manchester.gov.uk/bincollections/). When on the address list,
37 | View the source code for the page, and look for your address, the uprn will be
38 | shown as the value.
39 |
--------------------------------------------------------------------------------
/doc/source/c_trace_de.md:
--------------------------------------------------------------------------------
1 | # C-Trace.de
2 |
3 | Support for schedules provided by [c-trace.de](https://www.c-trace.de).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: c_trace_de
11 | args:
12 | ort: ORT
13 | strasse: STRASSE
14 | hausnummer: HAUSNUMMER
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **ort**
20 | *(string) (required)*
21 |
22 | **strasse**
23 | *(string) (required)*
24 |
25 | **hausnummer**
26 | *(string) (required)*
27 |
28 | ## Example
29 |
30 | ```yaml
31 | waste_collection_schedule:
32 | sources:
33 | - name: c_trace_de
34 | args:
35 | ort: Bremen
36 | strasse: Abbentorstraße
37 | hausnummer: 5
38 | ```
39 |
40 | ## How to get the source arguments
41 |
42 | Visit the ```Abfallkalender``` page of your city or municipality to get the source arguments:
43 |
44 | - [Bremen](https://www.die-bremer-stadtreinigung.de/abfallwirtschaft/entsorgung/bremer-abfallkalender-23080)
45 |
--------------------------------------------------------------------------------
/doc/source/data_umweltprofis_at.md:
--------------------------------------------------------------------------------
1 | # Umweltprofis.at
2 |
3 | Support for schedules provided by [Umweltprofis.at](https://www.umweltprofis.at).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | You need to generate your personal iCal Link before you can start using this source. Go to [https://data.umweltprofis.at/opendata/AppointmentService/index.aspx](https://data.umweltprofis.at/opendata/AppointmentService/index.aspx) and fill out the form. At the end, you can generate an iCal link. Copy this link and paste it to configuration.yaml as seen below.
8 |
9 | ```yaml
10 | waste_collection_schedule:
11 | sources:
12 | - name: data_umweltprofis_at
13 | args:
14 | url: URL
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **URL**
20 | *(url) (required)*
21 |
22 | ## Example
23 |
24 | ```yaml
25 | waste_collection_schedule:
26 | sources:
27 | - name: data_umweltprofis_at
28 | args:
29 | url: https://data.umweltprofis.at/OpenData/AppointmentService/AppointmentService.asmx/GetIcalWastePickupCalendar?key=xxx
30 | ```
--------------------------------------------------------------------------------
/doc/source/ximmio_nl.md:
--------------------------------------------------------------------------------
1 | # Ximmio
2 |
3 | Support for schedules provided by [Ximmio.nl](https://www.ximmio.nl/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: ximmio_nl
11 | args:
12 | company: COMPANY
13 | post_code: POST_CODE
14 | house_number: HOUSE_NUMBER
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **company**
20 | *(string) (required)*
21 |
22 | Use one of the following codes as company code:
23 |
24 | - acv
25 | - almere
26 | - areareiniging
27 | - avri
28 | - bar
29 | - hellendoorn
30 | - meerlanden
31 | - meppel
32 | - rad
33 | - reinis
34 | - twentemilieu
35 | - waardlanden
36 | - ximmio
37 |
38 | **post_code**
39 | *(string) (required)*
40 |
41 | **house_number**
42 | *(integer) (required)*
43 |
44 | ## Example
45 |
46 | ```yaml
47 | waste_collection_schedule:
48 | sources:
49 | - name: ximmio_nl
50 | args:
51 | company: acv
52 | post_code: 6721MH
53 | house_number: 1
54 | ```
55 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/example.py:
--------------------------------------------------------------------------------
1 | import datetime
2 |
3 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
4 |
5 | TITLE = "Example Source"
6 | DESCRIPTION = "Source for example waste collection."
7 | URL = None
8 | TEST_CASES = {"Example": {"days": 10}}
9 |
10 |
11 | class Source:
12 | def __init__(self, days=20, per_day=2, types=5):
13 | self._days = days
14 | self._per_day = per_day
15 | self._types = types
16 |
17 | def fetch(self):
18 | now = datetime.datetime.now().date()
19 |
20 | entries = []
21 | ap_type = 0
22 |
23 | for day in range(self._days):
24 | for idx in range(self._per_day):
25 | entries.append(
26 | Collection(
27 | now + datetime.timedelta(days=day + 7),
28 | f"Type{(ap_type % self._types) + 1}",
29 | )
30 | )
31 | ap_type = ap_type + 1
32 |
33 | return entries
34 |
--------------------------------------------------------------------------------
/doc/source/richmondshire_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Richmondshire District Council
2 |
3 | Support for schedules provided by [Richmondshire District Council](https://www.richmondshire.gov.uk/bins-and-recycling/), serving North Yorkshire, UK.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: richmondshire_gov_uk
11 | args:
12 | uprn: UNIQUE_PROPERTY_IDENTIFICATION_NUMBER
13 |
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **UPRN**
19 | *(integer) (required)*
20 |
21 | ## Example
22 |
23 | ```yaml
24 | waste_collection_schedule:
25 | sources:
26 | - name: richmondshire_gov_uk
27 | args:
28 | uprn: 200001767082
29 | ```
30 |
31 | ## How to find your `UPRN`
32 |
33 | An easy way to find your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details. Or you can visit the Richmondshire page and use the address search. Right-click your entry in the house dropdown, choose Inspect, and copy the UPRN from the value
--------------------------------------------------------------------------------
/doc/source/stadtreinigung_hamburg.md:
--------------------------------------------------------------------------------
1 | # Stadtreinigung Hamburg
2 |
3 | Add support for schedules provided by [stadtreinigung.hamburg](https://www.stadtreinigung.hamburg/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: stadtreinigung_hamburg
11 | args:
12 | hnId: HNID
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **hnId**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: stadtreinigung_hamburg
26 | args:
27 | hnId: 113084
28 | ```
29 |
30 | ## How to get the source arguments
31 |
32 | Open [stadtreinigung.hamburg](https://www.stadtreinigung.hamburg/abfuhrkalender/) and search for schedules for your location.
33 |
34 | Check the URL and extract the number after field `housenumber%5D`.
35 |
36 | Example:
37 |
38 | `https://www.stadtreinigung.hamburg/abfuhrkalender/?tx_srh_pickups%5Bstreet%5D=2586&tx_srh_pickups%5Bhousenumber%5D=53814`
39 |
40 | The resulting `hnId` is `53814`.
41 |
--------------------------------------------------------------------------------
/doc/source/mrsc_vic_gov_au.md:
--------------------------------------------------------------------------------
1 | # Macedon Ranges Shire Council
2 |
3 | Support for schedules provided by [Macedon Ranges Shire Council](https://www.mrsc.vic.gov.au/Live-Work/Bins-Rubbish-Recycling/Bins-and-collection-days/Bin-collection-days).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: mrsc_vic_gov_au
11 | args:
12 | street_address: STREET_ADDRESS
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **street_address**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: mrsc_vic_gov_au
26 | args:
27 | street_address: 45 Aitken Street, Gisborne
28 | ```
29 |
30 | ## How to get the source arguments
31 |
32 | Visit the [Macedon Ranges Shire Council waste and recycling](https://www.mrsc.vic.gov.au/Live-Work/Bins-Rubbish-Recycling/Bins-and-collection-days/Bin-collection-days) page and search for your address. The arguments should exactly match the street address shown in the autocomplete result.
33 |
--------------------------------------------------------------------------------
/doc/source/recycleapp_be.md:
--------------------------------------------------------------------------------
1 | # Recycle!
2 |
3 | Support for schedules provided by [Recycle / recycleapp.be](https://www.recycleapp.be/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: recycleapp_be
11 | args:
12 | postcode: POST_CODE
13 | street: STREET
14 | house_number: HOUSE_NUMBER
15 | add_events: ADD_EVENTS
16 | ```
17 |
18 | The source arguments are simply the values of the form elements on the homepage.
19 |
20 | ### Configuration Variables
21 |
22 | **postcode**
23 | *(int)*
24 | Postal Code.
25 |
26 | **street**
27 | *(string)*
28 | Street name.
29 |
30 | **house_number**
31 | *(int)*
32 | House number
33 |
34 | **add_events**
35 | *(boolean)*
36 | Add events (e.g. Repair Cafe) in addition to waste collections.
37 |
38 | ## Example
39 |
40 | ```yaml
41 | waste_collection_schedule:
42 | sources:
43 | - name: recycleapp_be
44 | args:
45 | postcode: 1140
46 | street: Bazellaan
47 | house_number: 1
48 | ```
49 |
--------------------------------------------------------------------------------
/doc/source/nottingham_city_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Nottingham City Council
2 |
3 | Support for schedules provided by [Nottingham City
4 | Council](https://www.nottinghamcity.gov.uk/binreminders), serving the
5 | city of Nottingham City, UK.
6 |
7 | ## Configuration via configuration.yaml
8 |
9 | ```yaml
10 | waste_collection_schedule:
11 | sources:
12 | - name: nottingham_city_gov_uk
13 | args:
14 | uprn: UPRN_CODE
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **uprn**
20 | *(string) (required)*
21 |
22 | ## Example
23 |
24 | ```yaml
25 | waste_collection_schedule:
26 | sources:
27 | - name: nottingham_city_gov_uk
28 | args:
29 | uprn: "100031540175"
30 | ```
31 |
32 | ## How to get the source argument
33 |
34 | The UPRN code can be found in the network request when entering your
35 | postcode and selecting your address on the [Nottingham City Council
36 | Bin Reminders
37 | page](https://www.nottinghamcity.gov.uk/binreminders). You should look
38 | for a request ending in `/livebin/` the last segment is your UPRN
39 | code.
40 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/stadtreinigung_hamburg.py:
--------------------------------------------------------------------------------
1 | import requests
2 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
3 | from waste_collection_schedule.service.ICS import ICS
4 |
5 | TITLE = "Stadtreinigung Hamburg"
6 | DESCRIPTION = "Source for Stadtreinigung Hamburg waste collection."
7 | URL = "https://www.stadtreinigung.hamburg"
8 | TEST_CASES = {
9 | "Zabelweg 1B": {"hnId": 53814},
10 | }
11 |
12 |
13 | class Source:
14 | def __init__(self, hnId, asId=None):
15 | self._hnId = hnId
16 | self._ics = ICS()
17 |
18 | def fetch(self):
19 | args = {"hnIds": self._hnId, "adresse": "MeineAdresse"}
20 |
21 | # get ics file
22 | r = requests.get(
23 | "https://backend.stadtreinigung.hamburg/kalender/abholtermine.ics",
24 | params=args,
25 | )
26 |
27 | dates = self._ics.convert(r.text)
28 |
29 | entries = []
30 | for d in dates:
31 | entries.append(Collection(d[0], d[1]))
32 | return entries
33 |
--------------------------------------------------------------------------------
/doc/source/awb_bad_kreuznach_de.md:
--------------------------------------------------------------------------------
1 | # AWB Bad Kreuznach
2 |
3 | Support for schedules provided by [AWB Bad Kreuznach](https://app.awb-bad-kreuznach.de/), Germany.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: awb_bad_kreuznach_de
11 | args:
12 | ort: ORT
13 | strasse: STRASSE
14 | nummer: NUMMER
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **ort**
20 | *(string) (required)*
21 |
22 | **strasse**
23 | *(string) (required)*
24 |
25 | **nummer**
26 | *(integer) (required)*
27 |
28 | ## Example
29 |
30 | ```yaml
31 | waste_collection_schedule:
32 | sources:
33 | - name: awb_bad_kreuznach_de
34 | args:
35 | ort: "Hargesheim"
36 | strasse: "Winzenheimer Straße"
37 | nummer: 16
38 | ```
39 |
40 | ## How to get the source arguments
41 |
42 | 1. Go to your calendar at `https://app.awb-bad-kreuznach.de/`.
43 | 2. Enter your location.
44 | 3. Copy the exact values from the 3 textboxes as `ort`, `strasse` and `nummer` in the source configuration.
45 |
--------------------------------------------------------------------------------
/doc/source/huntingdonshire_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Huntingdonshire District Council
2 |
3 | Support for schedules provided by [Huntingdonshire District Council](https://www.huntingdonshire.gov.uk/refuse-calendar), serving Huntingdonshire, UK.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: huntingdonshire_gov_uk
11 | args:
12 | uprn: UPRN_CODE
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **uprn**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: huntingdonshire_gov_uk
26 | args:
27 | uprn: "100050580641"
28 | ```
29 |
30 | ## How to get the source argument
31 |
32 | The UPRN code can be found in the network request when entering your postcode and selecting your address on the [Huntingdonshire Waste Collection Calendar page](https://www.huntingdonshire.gov.uk/refuse-calendar/). You should look for a request like `https://www.huntingdonshire.gov.uk/refuse-calendar/100090123510` the last segment is your UPRN code.
33 |
--------------------------------------------------------------------------------
/doc/source/colchester_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Colchester Council
2 |
3 | Support for schedules provided by [Colchester Council](https://www.colchester.gov.uk/your-recycling-calendar/), serving the borough of Colchester, UK.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: colchester_gov_uk
11 | args:
12 | llpgid: LLPDID_CODE
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **llpgid**
18 | *(string) (required)*
19 |
20 | #### How to find your `llpgid` code
21 | The LLPDID code can be found in the URL after entering your postcode and selecting your address on the [Colchester Your recycling calendar page](https://www.colchester.gov.uk/your-recycling-calendar/). The URL in your browser URL bar should look like `https://www.colchester.gov.uk/your-recycling-calendar/?start=true&step=1&llpgid=1197e725-3c27-e711-80fa-5065f38b5681`.
22 |
23 | ## Example
24 |
25 | ```yaml
26 | waste_collection_schedule:
27 | sources:
28 | - name: colchester_gov_uk
29 | args:
30 | llpgid: "1197e725-3c27-e711-80fa-5065f38b5681"
31 | ```
--------------------------------------------------------------------------------
/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | // See https://aka.ms/vscode-remote/devcontainer.json for format details.
2 | {
3 | "name": "Waste Collection Schedule development",
4 | "image": "ghcr.io/ludeeus/devcontainer/integration:stable",
5 | "context": "..",
6 | "appPort": [
7 | "9123:8123"
8 | ],
9 | "containerEnv": {
10 | "TZ": "Europe/Berlin" // Set your local timezone here
11 | },
12 | "postCreateCommand": "container install",
13 | "extensions": [
14 | "ms-python.python",
15 | "github.vscode-pull-request-github",
16 | "ryanluker.vscode-coverage-gutters",
17 | "ms-python.vscode-pylance"
18 | ],
19 | "settings": {
20 | "files.eol": "\n",
21 | "editor.tabSize": 4,
22 | "terminal.integrated.shell.linux": "/bin/bash",
23 | "python.defaultInterpreterPath": "/usr/bin/python3",
24 | "python.analysis.autoSearchPaths": false,
25 | "python.linting.pylintEnabled": true,
26 | "python.linting.enabled": true,
27 | "python.formatting.provider": "black",
28 | "editor.formatOnPaste": false,
29 | "editor.formatOnSave": true,
30 | "editor.formatOnType": true,
31 | "files.trimTrailingWhitespace": true
32 | }
33 | }
--------------------------------------------------------------------------------
/doc/source/bmv_at.md:
--------------------------------------------------------------------------------
1 | # BMV.at
2 |
3 | Support for schedules provided by [bmv.at](https://www.bmv.at/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: bmv_at
11 | args:
12 | ort: ORT
13 | strasse: STRASSE
14 | hausnummer: HAUSNUMMER
15 | ```
16 |
17 | To get the source arguments, open the [website](https://www.bmv.at/service/muellabfuhrtermine.html) and select the right values for your location.
18 |
19 | Copy the values for `Ort`, `Straße` and `Hausnummer` into the configuration. Do not change to lower case! Just take the values as they are.
20 |
21 | ### Configuration Variables
22 |
23 | **ORT**
24 | *(string) (required)*
25 | City
26 |
27 | **STRASSE**
28 | *(string) (required)*
29 | Street
30 |
31 | **HAUSNUMMER**
32 | *(string) (required)*
33 | Housenumber
34 |
35 | ## Examples
36 |
37 | ```yaml
38 | waste_collection_schedule:
39 | sources:
40 | - name: bmv_at
41 | args:
42 | ort: BAD SAUERBRUNN
43 | strasse: BUCHINGERWEG
44 | hausnummer: 16
45 | ```
46 |
--------------------------------------------------------------------------------
/doc/source/wiltshire_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Wiltshire Council
2 |
3 | Support for schedules provided by [Wiltshire Council](https://wiltshire.gov.uk/).
4 |
5 | If collection data is available for the address provided, it will return household and recycling waste collection dates.
6 |
7 | ## Configuration via configuration.yaml
8 |
9 | ```yaml
10 | waste_collection_schedule:
11 | sources:
12 | - name: wiltshire_gov_uk
13 | args:
14 | postcode: POSTCODE
15 | uprn: UPRN
16 | ```
17 |
18 | ### Configuration Variables
19 |
20 | **postcode**
21 | *(string) (required)*
22 |
23 | **uprn**
24 | *(string) (required)*
25 |
26 | Both the postcode and the UPRN should be supplied in the arguments.
27 |
28 | ## Examples
29 |
30 | ```yaml
31 | waste_collection_schedule:
32 | sources:
33 | - name: wiltshire_gov_uk
34 | args:
35 | postcode: BA149QP
36 | uprn: 100121085972
37 | ```
38 |
39 | ## How to find your UPRN
40 |
41 | An easy way to discover your Unique Property Reference Number (UPRN) is by going to [Find My Address](https://www.findmyaddress.co.uk/) and providng your address details.
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Steffen Zimmermann
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/doc/source/pgh_st.md:
--------------------------------------------------------------------------------
1 | # PGH.ST
2 |
3 | Support for schedules provided by [PGH.ST](https://www.pgh.st/), serving the city of Pittsburgh, PA, USA.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: pgh_st
11 | args:
12 | house_number: HOUSE_NUMBER
13 | street_name: STREET_NAME
14 | zipcode: ZIPCODE
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **house_number**
20 | *(integer) (required)*
21 |
22 | **street_name**
23 | *(string) (required)*
24 |
25 | **zipcode**
26 | *(integer) (required)*
27 |
28 | ## Example
29 |
30 | ```yaml
31 | waste_collection_schedule:
32 | sources:
33 | - name: pgh_st
34 | args:
35 | house_number: 800
36 | street_name: Negley
37 | zipcode: 15232
38 | ```
39 |
40 | ## How to get the source arguments
41 |
42 | The source arguments are simply the house mailing address. The street_name field doesn't require cardinal direction (N/S/E/W) or road type (e.g. st) designations, so `S Negley Ave` can just be `Negley`. The zipcode field is just the 5-digit zipcode, not the 9-digit extended zipcode.
43 |
--------------------------------------------------------------------------------
/doc/source/abfalltermine_forchheim_de.md:
--------------------------------------------------------------------------------
1 | # Abfalltermine Forchheim
2 |
3 | Support for Landkreis Forchheim schedules provided by [abfalltermine-forchheim.de](https://www.abfalltermine-forchheim.de/) located in Bavaria, Germany.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: abfalltermine_forchheim_de
11 | args:
12 | city: CITY
13 | area: AREA
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **city**
19 | *(string) (required)*
20 |
21 | **area**
22 | *(string) (required)*
23 |
24 | ### How to get the source arguments
25 | The arguments can be found on [abfalltermine-forchheim.de](https://www.abfalltermine-forchheim.de/).
26 | Search for your area. Use the part in front of the dash as `city` argument and the part behind it as `area` argument. Do not insert additional spaces.
27 |
28 |
29 | **Examples**
30 | Forchheim - Bamberger Straße (nördlich der Adenauerallee)
31 |
32 | ```yaml
33 | city: Forchheim
34 | area: Bamberger Straße (nördlich der Adenauerallee)
35 | ```
36 |
37 | Dormitz - Dormitz
38 |
39 | ```yaml
40 | city: Dormitz
41 | area: Dormitz
42 | ```
--------------------------------------------------------------------------------
/doc/source/ipswich_qld_gov_au.md:
--------------------------------------------------------------------------------
1 | # Ipswich City Council
2 |
3 | Support for schedules provided by [Ipswich City Council](https://www.ipswich.qld.gov.au/live/waste-and-recycling/bin-collection-calendar).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: ipswich_qld_gov_au
11 | args:
12 | street: STREET_NO_NAME_TYPE
13 | suburb: SUBURB
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **street**
19 | *(string) (required)*
20 |
21 | **suburb**
22 | *(string) (required)*
23 |
24 | ## Example
25 |
26 | ```yaml
27 | waste_collection_schedule:
28 | sources:
29 | - name: ipswich_qld_gov_au
30 | args:
31 | street: 50 Brisbane Road
32 | suburb: Redbank
33 | ```
34 |
35 | ## How to get the source arguments
36 |
37 | Visit the [Ipswich City Council bin collection calendar](https://www.ipswich.qld.gov.au/live/waste-and-recycling/bin-collection-calendar) page and search for your address. Use your street number and name (include type such as street, avenue, road) for street and suburb only name in suburb. Including QLD or Australia is not required.
38 |
--------------------------------------------------------------------------------
/doc/source/stadtreinigung_dresden_de.md:
--------------------------------------------------------------------------------
1 | # Stadtreinigung Dresden
2 |
3 | Add support for schedules provided by [https://www.dresden.de/](https://www.dresden.de/apps_ext/AbfallApp/wastebins?0).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: stadtreinigung_dresden_de
11 | args:
12 | standort: STANDORT_ID
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **standort**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: stadtreinigung_dresden_de
26 | args:
27 | standort: 80542
28 | ```
29 |
30 | ## How to get the source arguments
31 |
32 | Open [https://www.dresden.de/](https://www.dresden.de/apps_ext/AbfallApp/wastebins?0) and search for schedules for your location.
33 |
34 | Check the Link-URL for downloading the schedules as *.PDF and extract the number after field `STANDORT`.
35 |
36 | Example:
37 |
38 | `https://stadtplan.dresden.de/project/cardo3Apps/IDU_DDStadtplan/abfall/kalender.ashx?STANDORT=80542&DUMMY=637834733764191577`
39 |
40 | The resulting `STANDORT_ID` is `80542`.
41 |
--------------------------------------------------------------------------------
/doc/source/ccc_govt_nz.md:
--------------------------------------------------------------------------------
1 | # Christchurch City Council
2 |
3 | Support for schedules provided by [Christchurch City Council](https://ccc.govt.nz/services/rubbish-and-recycling/collections).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: ccc_govt_nz
11 | args:
12 | address: STREET_NUMBER_AND_STREET_NAME
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **address**
18 | *(string) (required)*
19 |
20 | ## Bin Names example - Garbage, Recycle & Organic
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: ccc_govt_nz
26 | args:
27 | address: "53 Hereford Street"
28 | ```
29 |
30 | ## Bin Colours example - Red, Yellow & Green
31 |
32 | ```yaml
33 | waste_collection_schedule:
34 | sources:
35 | - name: ccc_govt_nz
36 | args:
37 | address: "53 Hereford Street"
38 | customize:
39 | - type: Garbage
40 | alias: Red
41 | - type: Recycle
42 | alias: Yellow
43 | - type: Organic
44 | alias: Green
45 | calendar_title: "CCC Bins"
46 | separator: " & "
47 | ```
48 |
--------------------------------------------------------------------------------
/doc/source/cheshire_east_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Cheshire East Council
2 |
3 | Support for schedules provided by [Cheshire East Council](https://online.cheshireeast.gov.uk/mycollectionday/), serving the borough of Cheshire East, UK.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: cheshire_east_gov_uk
11 | args:
12 | uprn: UPRN
13 | ```
14 |
15 | ```yaml
16 | waste_collection_schedule:
17 | sources:
18 | - name: cheshire_east_gov_uk
19 | args:
20 | postcode: POSTCODE
21 | name_number: NAME OR NUMBER
22 | ```
23 |
24 | ### Configuration Variables
25 |
26 | **uprn**
27 | *(string) (required)*
28 |
29 | --- or ---
30 |
31 | **postcode**
32 | *(string) (required)*
33 |
34 | **name_number**
35 | *(string) (required)*
36 |
37 | ## Examples
38 |
39 | ```yaml
40 | waste_collection_schedule:
41 | sources:
42 | - name: cheshire_east_gov_uk
43 | args:
44 | uprn: 100010132071
45 | ```
46 |
47 | ```yaml
48 | waste_collection_schedule:
49 | sources:
50 | - name: cheshire_east_gov_uk
51 | args:
52 | postcode: WA16 0AY
53 | name_number: 1
54 | ```
55 |
--------------------------------------------------------------------------------
/doc/source/bradford_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Bradford Metropolitan District Council
2 |
3 | Support for schedules provided by [Bradford Metropolitan District Council](https://onlineforms.bradford.gov.uk/ufs/collectiondates.eb), serving the metropolitan district of Bradford, UK.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: bradford_gov_uk
11 | args:
12 | uprn: UPRN_CODE
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **uprn**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: bradford_gov_uk
26 | args:
27 | uprn: "100051239296"
28 | ```
29 |
30 | ## How to get the source argument
31 |
32 | The UPRN code can be found by setting and selecting your address in the [Bradford household bin collection dates web page](https://onlineforms.bradford.gov.uk/ufs/collectiondates.eb) and saving your address for later. The UPRN will then be stored in the COLLECTIONDATES cookie
33 | in your browser.
34 |
35 | Alternatively, search for your address on the [FindMyAddress service](https://www.findmyaddress.co.uk/) which displays the UPRN in the result.
36 |
--------------------------------------------------------------------------------
/doc/source/was_wolfsburg_de.md:
--------------------------------------------------------------------------------
1 | # Wolfsburger Abfallwirtschaft und Straßenreinigung
2 |
3 | Support for schedules provided by [WAS-Wolfsburg.de](https://was-wolfsburg.de).
4 |
5 | Please note that WAS Wolfsburg provides 2 different schedules: One for "Restabfall - Bioabfall - Altpapier" and one for "Gelber Sack". This source fetches both schedules and merges it into one.
6 |
7 | ## Configuration via configuration.yaml
8 |
9 | ```yaml
10 | waste_collection_schedule:
11 | sources:
12 | - name: was_wolfsburg_de
13 | args:
14 | city: CITY
15 | street: STREET
16 | ```
17 |
18 | ### Configuration Variables
19 |
20 | **city**
21 | *(string) (required)*
22 |
23 | **street**
24 | *(string) (required)*
25 |
26 | ## Example
27 |
28 | ```yaml
29 | waste_collection_schedule:
30 | sources:
31 | - name: was_wolfsburg_de
32 | args:
33 | city: Barnstorf
34 | street: Bahnhofspassage
35 | ```
36 |
37 | ## How to get the source arguments
38 |
39 | | Argument | Description |
40 | | ----------- | ----------- |
41 | | city | Full district name as shown in the `Gelber Sack` web page. |
42 | | street | Full street name as shown in the `Restabfall/Bioabfall/Altpapier` web page. |
43 |
--------------------------------------------------------------------------------
/doc/source/canadabay_nsw_gov_au.md:
--------------------------------------------------------------------------------
1 | # City of Canada Bay Council
2 |
3 | Support for schedules provided by [City of Canada Bay Council](https://www.canadabay.nsw.gov.au/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: canadabay_nsw_gov_au
11 | args:
12 | suburb: SUBURB
13 | street_name: STREET_NAME
14 | street_number: STREET_NUMBER
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **suburb**
20 | *(string) (required)*
21 |
22 | **street_name**
23 | *(string) (required)*
24 |
25 | **street_number**
26 | *(string) (required)*
27 |
28 | ## Example
29 |
30 | ```yaml
31 | waste_collection_schedule:
32 | sources:
33 | - name: canadabay_nsw_gov_au
34 | args:
35 | suburb: Mortlake
36 | street_name: Tennyson Road
37 | street_number: 76
38 | ```
39 |
40 | ## How to get the source arguments
41 |
42 | Visit the [City of Canada Bay Council bin collection calendar](https://www.canadabay.nsw.gov.au/residents/waste-and-recycling/my-bins/my-bin-collection) page and search for your address. The arguments should exactly match the results shown for Suburb and Street and the number portion of the Property.
43 |
--------------------------------------------------------------------------------
/doc/source/alw_wf_de.md:
--------------------------------------------------------------------------------
1 | # ALW Wolfenbüttel
2 |
3 | Support for schedules provided by [ALW Wolfenbüttel](https://www.alw-wf.de//), Germany.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: alw_wf_de
11 | args:
12 | ort: ORT
13 | strasse: STRASSE
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **ort**
19 | *(string) (required)*
20 |
21 | **strasse**
22 | *(string) (required)*
23 |
24 | ## Example
25 |
26 | ```yaml
27 | waste_collection_schedule:
28 | sources:
29 | - name: alw_wf_de
30 | args:
31 | ort: "Linden mit Okertalsiedlung"
32 | strasse: "Am Buschkopf"
33 | ```
34 |
35 | ## How to get the source arguments
36 |
37 | 1. Go to the calendar at https://www.alw-wf.de/index.php/abfallkalender.
38 | 2. Select your location in the drop down menus.
39 | - Notice: The page reloads after selecting `Ort`, so wait for that before selecting `Straße`.
40 | 3. Copy the **exact** values from the 2 drop down menus as `ort` and `strasse` in the source configuration.
41 | - In case you can only select the street `Alle Straßen`, then the `strasse` option does not matter (it is still required, just set it to something).
42 |
--------------------------------------------------------------------------------
/doc/source/landkreis_wittmund_de.md:
--------------------------------------------------------------------------------
1 | # Landkreis-Wittmund.de
2 |
3 | Support for schedules provided by [Landkreis-Wittmund.de](https://www.landkreis-wittmund.de) located in Lower Saxony, Germany.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: landkreis_wittmund_de
11 | args:
12 | city: Werdum
13 | # optional
14 | # street: street name
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **city**
20 | *(string) (required)*
21 |
22 | **street**
23 | *(string) (optional)*
24 |
25 | ## Example
26 |
27 | ```yaml
28 | waste_collection_schedule:
29 | sources:
30 | - name: landkreis_wittmund_de
31 | args:
32 | city: Werdum
33 | ```
34 |
35 | Use `sources.customize` to filter or rename the waste types:
36 |
37 | ```yaml
38 | waste_collection_schedule:
39 | sources:
40 | - name: landkreis_wittmund_de
41 | args:
42 | city: Werdum
43 | calendar_title: Abfallkalender
44 | customize:
45 | # rename types to shorter name
46 | - type: Restmülltonne
47 | alias: Restmüll
48 |
49 | # hide unwanted types
50 | - type: Baum- und Strauchschnitt
51 | show: false
52 | ```
53 |
--------------------------------------------------------------------------------
/doc/source/innerwest_nsw_gov_au.md:
--------------------------------------------------------------------------------
1 | # Inner West Council (NSW)
2 |
3 | Support for schedules provided by [Inner West Council (NSW)](https://www.innerwest.nsw.gov.au/live/waste-and-recycling/bins-and-clean-ups/waste-calendar).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: innerwest_nsw_gov_au
11 | args:
12 | suburb: SUBURB
13 | street_name: STREET_NAME
14 | street_number: STREET_NUMBER
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **suburb**
20 | *(string) (required)*
21 |
22 | **street_name**
23 | *(string) (required)*
24 |
25 | **street_number**
26 | *(string) (required)*
27 |
28 | ## Example
29 |
30 | ```yaml
31 | waste_collection_schedule:
32 | sources:
33 | - name: innerwest_nsw_gov_au
34 | args:
35 | suburb: Tempe
36 | street_name: Princess Highway
37 | street_number: 810
38 | ```
39 |
40 | ## How to get the source arguments
41 |
42 | Visit the [Inner West Council (NSW)](https://www.innerwest.nsw.gov.au/live/waste-and-recycling/bins-and-clean-ups/waste-calendar) page and search for your address. The arguments should exactly match the results shown for Suburb and Street and the number portion of the Property.
43 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/lrasha_de.py:
--------------------------------------------------------------------------------
1 | import datetime
2 | import requests
3 | from waste_collection_schedule import Collection
4 | from waste_collection_schedule.service.ICS import ICS
5 |
6 |
7 | TITLE = "Landkreis Schwäbisch Hall"
8 | DESCRIPTION = "Source for lrasha.de - Landkreis Schwäbisch Hall"
9 | URL = "http://exchange.cmcitymedia.de/landkreis-schwaebisch-hallt3/wasteCalendarExport.php?location="
10 | # https://www.lrasha.de/de/buergerservice/abfallwirtschaft/abfallkalender
11 |
12 | TEST_CASES = {
13 | "Ilshofen": {"location": "114"}
14 | }
15 |
16 | HEADERS = {"user-agent": "Mozilla/5.0 (xxxx Windows NT 10.0; Win64; x64)"}
17 |
18 |
19 | class Source:
20 | def __init__(self, location):
21 | self._location = location
22 | self._ics = ICS()
23 |
24 | def fetch(self):
25 | # get ics file
26 | full_url = URL + str(self._location)
27 | r = requests.get(full_url, headers=HEADERS)
28 | r.raise_for_status()
29 |
30 | # parse ics file
31 | r.encoding = "utf-8"
32 | dates = self._ics.convert(r.text)
33 |
34 | entries = []
35 | for d in dates:
36 | entries.append(Collection(d[0], d[1]))
37 | return entries
38 |
--------------------------------------------------------------------------------
/doc/source/seattle_gov.md:
--------------------------------------------------------------------------------
1 | # Seattle Public Utilities
2 |
3 | Support for schedules provided by [Seattle Public Utilities](https://myutilities.seattle.gov/eportal/#/accountlookup/calendar), serving the city of Seattle, WA, USA.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: seattle_gov
11 | args:
12 | street_address: STREET_ADDRESS
13 | prem_code: PREM_CODE
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **street_address**
19 | *(string) (required)*
20 |
21 | **prem_code**
22 | *(string) (optional)*
23 |
24 | ## Example
25 |
26 | ```yaml
27 | waste_collection_schedule:
28 | sources:
29 | - name: seattle_gov
30 | args:
31 | street_address: 600 4th Ave
32 | ```
33 |
34 | ## How to get the source argument
35 |
36 | The street_address argument is simply the house mailing address. Road type (eg. St, Ave) and cardinal direction if applicable (eg. N/S/NW) are required, so "501 23rd Ave" and "501 23rd Ave E" will give different results.
37 |
38 | If the service cannot be identified based on street address alone (in some multi-family houses, etc), a `prem_code` can be extracted by inspecting the "findAccount" call when looking up your service on the Collection Calendar.
39 |
--------------------------------------------------------------------------------
/doc/source/walsall_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Walsall Council
2 |
3 | Support for schedules provided by [Walsall Council](https://cag.walsall.gov.uk/BinCollections/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: walsall_gov_uk
11 | args:
12 | uprn: UNIQUE_PROPERTY_REFERENCE_NUMBER
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **uprn**
18 | *(string) (optional) (preferred method)*
19 |
20 | This is required if you do not supply any other options. Using a UPRN removes the need to do an address look up using web requests.
21 |
22 | ## Example using UPRN
23 | ```yaml
24 | waste_collection_schedule:
25 | sources:
26 | - name: walsall_gov_uk
27 | args:
28 | uprn: "100071103746"
29 | ```
30 |
31 | ## How to find your `UPRN`
32 |
33 | An easy way to find your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.
34 |
35 | Otherwise you can inspect the web requests on [Walsall Council](https://www.environmentfirst.co.uk/) having searched for and selected your address details. Your UPRN is the collection of digits at the end of the URL, for example: *https://cag.walsall.gov.uk/BinCollections/GetBins?uprn=`100071103746`*
36 |
--------------------------------------------------------------------------------
/doc/source/cornwall_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Cornwall Council
2 |
3 | Support for schedules provided by [Cornwall Council](https://www.cornwall.gov.uk/), serving Truro, Bodmin, St Austell and much more
4 |
5 | If collection data is available for the address provided, it will return food, rubbish and recycling waste collection dates.
6 |
7 | ## Configuration via configuration.yaml
8 |
9 | ```yaml
10 | waste_collection_schedule:
11 | sources:
12 | - name: cornwall_gov_uk
13 | args:
14 | postcode: POSTCODE
15 | uprn: UPRN
16 | ```
17 |
18 | ### Configuration Variables
19 |
20 | **postcode**
21 | *(string) (optional)*
22 |
23 | **hournameornumber**
24 | *(string) (optional)*
25 |
26 | **uprn**
27 | *(string) (optional)*
28 |
29 | Either the postcode and housenameornumber or the UPRN should be supplied in the arguments
30 |
31 | ## Examples
32 |
33 | ```yaml
34 | waste_collection_schedule:
35 | sources:
36 | - name: cornwall_gov_uk
37 | args:
38 | postcode: TR261SP
39 | housenameornumber: 7
40 | uprn: 100040118005
41 | ```
42 |
43 | ## How to find your UPRN
44 |
45 | An easy way to discover your Unique Property Reference Number (UPRN) is by going to [Find My Address](https://www.findmyaddress.co.uk/) and providng your address details.
46 |
--------------------------------------------------------------------------------
/doc/source/aucklandcouncil_govt_nz.md:
--------------------------------------------------------------------------------
1 | # Auckland Council
2 |
3 | Support for schedules provided by [Auckland Council](https://aucklandcouncil.govt.nz/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: aucklandcouncil_govt_nz
11 | args:
12 | area_number: AREA_NUMBER_FROM_COLLECTION_PAGE # see 'How to get the source argument below'
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **area_number**
18 | *(string) (required)*
19 |
20 | ## Example
21 |
22 | ```yaml
23 | waste_collection_schedule:
24 | sources:
25 | - name: aucklandcouncil_govt_nz
26 | args:
27 | area_number: 12342306525
28 | ```
29 |
30 | ## How to get the source argument
31 |
32 | The source argument is the area number from Auckland Council site:
33 |
34 | - Open your collection days page by entering your address [on the Auckland Council collection day finder](https://www.aucklandcouncil.govt.nz/rubbish-recycling/rubbish-recycling-collections/Pages/rubbish-recycling-collection-days.aspx)
35 | - Look for 'an' parameter in your browser URL, e.g. https://www.aucklandcouncil.govt.nz/rubbish-recycling/rubbish-recycling-collections/Pages/collection-day-detail.aspx?an=12342306525
36 | - In this example the area number is `12342306525`.
37 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/data_umweltprofis_at.py:
--------------------------------------------------------------------------------
1 | import logging
2 | import requests
3 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
4 | from waste_collection_schedule.service.ICS import ICS
5 |
6 | TITLE = "UMWELTPROFIS"
7 | DESCRIPTION = "Source for Umweltprofis"
8 | URL = "https://www.umweltprofis.at"
9 | TEST_CASES = {
10 | "Ebensee": {"url": "https://data.umweltprofis.at/OpenData/AppointmentService/AppointmentService.asmx/GetIcalWastePickupCalendar?key=KXX_K0bIXDdk0NrTkk3xWqLM9-bsNgIVBE6FMXDObTqxmp9S39nIqwhf9LTIAX9shrlpfCYU7TG_8pS9NjkAJnM_ruQ1SYm3V9YXVRfLRws1"},
11 | }
12 |
13 | _LOGGER = logging.getLogger(__name__)
14 |
15 |
16 | class Source:
17 | def __init__(self, url):
18 | self._url = url
19 | self._ics = ICS()
20 |
21 | def fetch(self):
22 | r = requests.get(self._url)
23 | if r.status_code != 200:
24 | _LOGGER.error("Error querying calendar data")
25 | return []
26 |
27 | fixed_text = r.text.replace("REFRESH - INTERVAL; VALUE = ", "REFRESH-INTERVAL;VALUE=")
28 |
29 | dates = self._ics.convert(fixed_text)
30 |
31 | entries = []
32 | for d in dates:
33 | entries.append(Collection(d[0], d[1]))
34 | return entries
35 |
--------------------------------------------------------------------------------
/doc/source/brisbane_qld_gov_au.md:
--------------------------------------------------------------------------------
1 | # Brisbane City Council
2 |
3 | Support for schedules provided by [Brisbane City Council](https://www.brisbane.qld.gov.au/clean-and-green/rubbish-tips-and-bins/rubbish-collections/bin-collection-calendar).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: brisbane_qld_gov_au
11 | args:
12 | suburb: SUBURB
13 | street_name: STREET_NAME
14 | street_number: STREET_NUMBER
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **suburb**
20 | *(string) (required)*
21 |
22 | **street_name**
23 | *(string) (required)*
24 |
25 | **street_number**
26 | *(string) (required)*
27 |
28 | ## Example
29 |
30 | ```yaml
31 | waste_collection_schedule:
32 | sources:
33 | - name: brisbane_qld_gov_au
34 | args:
35 | suburb: Milton
36 | street_name: Park Rd
37 | street_number: 8/1
38 | ```
39 |
40 | ## How to get the source arguments
41 |
42 | Visit the [Brisbane City Council bin collection calendar](https://www.brisbane.qld.gov.au/clean-and-green/rubbish-tips-and-bins/rubbish-collections/bin-collection-calendar) page and search for your address. The arguments should exactly match the results shown for Suburb and Street and the number portion of the Property.
43 |
--------------------------------------------------------------------------------
/doc/source/bsr_de.md:
--------------------------------------------------------------------------------
1 | # Berliner Stadtreinigungsbetriebe
2 |
3 | Support for schedules provided by [bsr.de](https://www.bsr.de/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: bsr_de
11 | args:
12 | abf_strasse: STRASSE
13 | abf_hausnr: HAUSNR
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **abf_strasse**
19 | *(string) (required)*
20 |
21 | **abf_hausnr**
22 | *(string) (required)*
23 |
24 | ## Example
25 |
26 | ```yaml
27 | waste_collection_schedule:
28 | sources:
29 | - name: bsr_de
30 | args:
31 | abf_strasse: "Bahnhofstr., 12159 Berlin (Tempelhof-Schöneberg)"
32 | abf_hausnr: 1
33 | ```
34 |
35 | ## How to get the source arguments
36 |
37 | There is a script with an interactive command line interface which generates the required source configuration:
38 |
39 | [https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/bsr_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/bsr_de.py).
40 |
41 | First, install the Python module `inquirer`. Then run this script from a shell and answer the questions.
42 |
--------------------------------------------------------------------------------
/doc/source/nsomerset_gov_uk.md:
--------------------------------------------------------------------------------
1 | # North Somerset Council
2 |
3 | Support for schedules provided by [North Somerset Council](https://www.n-somerset.gov.uk/), serving Clevedon, Nailsea, Portishead and Weston super Mare, along with numerous villages.
4 |
5 | If collection data is available for the address provided, it will return food, rubbish and recycling waste collection dates.
6 |
7 | ## Configuration via configuration.yaml
8 |
9 | ```yaml
10 | waste_collection_schedule:
11 | sources:
12 | - name: nsomerset_gov_uk
13 | args:
14 | postcode: POSTCODE
15 | uprn: UPRN
16 | ```
17 |
18 | ### Configuration Variables
19 |
20 | **postcode**
21 | *(string) (required)*
22 |
23 | **uprn**
24 | *(string) (required)*
25 |
26 | ## Examples
27 |
28 | ```yaml
29 | waste_collection_schedule:
30 | sources:
31 | - name: nsomerset_gov_uk
32 | args:
33 | postcode: BS231UJ
34 | uprn: 24009468
35 | ```
36 |
37 | ## How to find your UPRN
38 |
39 | An easy way to discover your Unique Property Reference Number (UPRN) is by going to [Find My Address](https://www.findmyaddress.co.uk/) and providng your address details. Otherwise you can inspect the source code on the [North Somerset waste collection](https://forms.n-somerset.gov.uk/Waste/CollectionSchedule) website after entering your postcode.
40 |
--------------------------------------------------------------------------------
/doc/source/stuttgart_de.md:
--------------------------------------------------------------------------------
1 | # Abfallwirtschaft Stuttgart
2 |
3 | Support for schedules provided by [stuttgart.de](https://service.stuttgart.de/lhs-services/aws/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: stuttgart_de
11 | args:
12 | street: ORT_SEL
13 | streetnr: STR_SEL
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **street**
19 | *(string) (required)*
20 |
21 | **streetnr**
22 | *(string) (required)*
23 |
24 | ## Example
25 |
26 | ```yaml
27 | waste_collection_schedule:
28 | sources:
29 | - name: stuttgart_de
30 | args:
31 | street: Im Steinengarten
32 | streetnr: 7
33 | ```
34 |
35 | ## How to get the source arguments
36 |
37 | There is a script with an interactive command line interface which generates the required source configuration:
38 |
39 | [https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/stuttgart_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/stuttgart_de.py).
40 |
41 | First, install the Python module `inquirer`. Then run this script from a shell and answer the questions.
42 |
--------------------------------------------------------------------------------
/doc/source/hygea_be.md:
--------------------------------------------------------------------------------
1 | # Hygea
2 |
3 | Support for schedules provided by [hygea.be](https://www.hygea.be/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: hygea_be
11 | args:
12 | streetIndex: STREET_INDEX
13 | cp: POSTAL_CODE
14 | ```
15 |
16 | The arguments can be found in the URL after visiting the [the calendar](https://www.hygea.be/votre-calendrier-de-collecte.html). Select your city and optionally street to show the schedule for your town. Now check the URL and extract either streetIndex (if available) or postal code from the URL. See also examples below.
17 |
18 | ### Configuration Variables
19 |
20 | **streetIndex**
21 | *(int)*
22 | Street index, extracted from URL.
23 |
24 | **cp**
25 | *(int)*
26 | Postal code, extracted from URL.
27 |
28 | ## Example
29 |
30 | ```yaml
31 | # URL: https://www.hygea.be/votre-calendrier-de-collecte.html?cp=7021&street=&streetIndex=13
32 |
33 | waste_collection_schedule:
34 | sources:
35 | - name: hygea_be
36 | args:
37 | streetIndex: 13
38 | ```
39 |
40 | ```yaml
41 | # URL: https://www.hygea.be/votre-calendrier-de-collecte.html?cp=6560&streetIndex=
42 |
43 | waste_collection_schedule:
44 | sources:
45 | - name: hygea_be
46 | args:
47 | cp: 6560
48 | ```
49 |
--------------------------------------------------------------------------------
/doc/source/awbkoeln_de.md:
--------------------------------------------------------------------------------
1 | # Abfallwirtschaftsbetriebe Köln
2 |
3 | Support for schedules provided by [awbkoeln.de](https://www.awbkoeln.de/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: awbkoeln_de
11 | args:
12 | street_code: STREET_CODE
13 | building_number: BUILDING_NUMBER
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **street_code**
19 | *(string) (required)*
20 |
21 | **building_number**
22 | *(string) (required)*
23 |
24 | ## Example
25 |
26 | ```yaml
27 | waste_collection_schedule:
28 | sources:
29 | - name: awbkoeln_de
30 | args:
31 | street_code: 4272
32 | building_number: 10
33 | ```
34 |
35 | ## How to get the source arguments
36 |
37 | There is a script with an interactive command line interface which generates the required source configuration:
38 |
39 | [https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/awbkoeln_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/awbkoeln_de.py).
40 |
41 | First, install the Python module `inquirer`. Then run this script from a shell and answer the questions.
42 |
--------------------------------------------------------------------------------
/doc/source/kaev_niederlausitz_de.md:
--------------------------------------------------------------------------------
1 | # Kommunaler Abfallentsorgungsverband Niederlausitz
2 |
3 | Support for schedules provided by [kaev.de](https://www.kaev.de/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: kaev_niederlausitz
11 | args:
12 | abf_suche: SEARCH_STRING
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **abf_suche**
18 | *(string) (required)*
19 |
20 |
21 | ## Example
22 |
23 | ```yaml
24 | waste_collection_schedule:
25 | sources:
26 | - name: kaev_niederlausitz
27 | args:
28 | abf_suche: "Luckau / OT Zieckau"
29 | ```
30 |
31 | ```yaml
32 | waste_collection_schedule:
33 | sources:
34 | - name: kaev_niederlausitz
35 | args:
36 | abf_suche: "Luckau / Bersteweg"
37 | ```
38 |
39 | ```yaml
40 | waste_collection_schedule:
41 | sources:
42 | - name: kaev_niederlausitz
43 | args:
44 | abf_suche: "Staakow"
45 | ```
46 |
47 |
48 | ## How to get the source arguments
49 |
50 | 1. Go to your calendar at 1. Go to your calendar at [https://www.kaev.de/Info-und-Service/Tourenplan/Tourenplan-Abfalltermine.html](https://www.kaev.de/Info-und-Service/Tourenplan/Tourenplan-Abfalltermine.html).
51 | 2. Enter your location.
52 | 3. Use full string from the search box for the abf_suche value
53 |
--------------------------------------------------------------------------------
/doc/source/miljoteknik_se.md:
--------------------------------------------------------------------------------
1 | # Ronneby Miljöteknik Sophämtning
2 |
3 | Support for schedules provided by [Ronneby Miljöteknik](http://www.fyrfackronneby.se/hamtningskalender/), serving the municipality of Ronneby, Sweden.
4 |
5 | Note that they only provide their calendar service for customers with the "Fyrfack" bins which means this will only work for regular residential houses and not for apartment buildings, city services locations or similar.
6 |
7 | ## Configuration via configuration.yaml
8 |
9 | ```yaml
10 | waste_collection_schedule:
11 | sources:
12 | - name: miljoteknik_se
13 | args:
14 | street_address: STREET_ADDRESS
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **street_address**
20 | *(string) (required)*
21 |
22 | ## Example
23 |
24 | ```yaml
25 | waste_collection_schedule:
26 | sources:
27 | - name: miljoteknik_se
28 | args:
29 | street_address: Hjortsbergavägen 16, Johannishus
30 | ```
31 |
32 | ## How to get the source argument
33 |
34 | The source argument is the address to the house with waste collection. The address can be tested [here](http://www.fyrfackronneby.se/hamtningskalender/).
35 |
36 | ## Types returned
37 |
38 | The following waste types will be returned:
39 |
40 | * "Mat, Brännbart, färgat glas, tidningar."
41 |
42 | * "Plast, pappersförpackningar, ofärgat glas, metall."
43 |
44 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/abfalltermine_forchheim_de.py:
--------------------------------------------------------------------------------
1 | import requests
2 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
3 | from waste_collection_schedule.service.ICS import ICS
4 |
5 | import urllib
6 |
7 | TITLE = "Landkreis Forchheim"
8 | DESCRIPTION = "Source for Landkreis Forchheim"
9 | URL = "https://www.abfalltermine-forchheim.de/"
10 | TEST_CASES = {
11 | "Dormitz": {"city": "Dormitz", "area": "Dormitz"},
12 | "Rüsselbach": {"city": "Igensdorf", "area": "Oberrüsselbach"},
13 | "Kellerstraße": {"city": "Forchheim", "area": "Untere Kellerstraße (ab Adenauerallee bis Piastenbrücke)"}
14 | }
15 |
16 |
17 | class Source:
18 | def __init__(self, city, area):
19 | self._city = city
20 | self._area = area
21 | self._ics = ICS()
22 |
23 | def fetch(self):
24 | place = urllib.parse.quote(self._city + " - " + self._area)
25 | r = requests.get(
26 | f"http://www.abfalltermine-forchheim.de/Forchheim/Landkreis/{place}/ics?RESTMUELL=true&RESTMUELL_SINGLE=true&BIO=true&YELLOW_SACK=true&PAPER=true"
27 | )
28 | r.encoding = r.apparent_encoding
29 | dates = self._ics.convert(r.text)
30 |
31 | entries = []
32 | for d in dates:
33 | entries.append(Collection(d[0], d[1]))
34 | return entries
35 |
--------------------------------------------------------------------------------
/doc/source/westberks_gov_uk.md:
--------------------------------------------------------------------------------
1 | # West Berkshire Council
2 |
3 | Support for schedules provided by [West Berkshire Council](https://www.westberks.gov.uk/).
4 |
5 | If collection data is available for the address provided, it will return rubbish and recycling waste collection dates.
6 |
7 | ## Configuration via configuration.yaml
8 |
9 | ```yaml
10 | waste_collection_schedule:
11 | sources:
12 | - name: westberks_gov_uk
13 | args:
14 | postcode: POSTCODE
15 | uprn: UPRN
16 | ```
17 |
18 | ### Configuration Variables
19 |
20 | **postcode**
21 | _(string) (optional)_
22 |
23 | **hournameornumber**
24 | _(string) (optional)_
25 |
26 | **uprn**
27 | _(string) (optional)_
28 |
29 | Either the postcode _and_ housenameornumber or the UPRN should be supplied in the arguments
30 |
31 | ## Examples
32 |
33 | ```yaml
34 | waste_collection_schedule:
35 | sources:
36 | - name: westberks_gov_uk
37 | args:
38 | uprn: "100080241094"
39 | ```
40 |
41 | ```yaml
42 | waste_collection_schedule:
43 | sources:
44 | - name: westberks_gov_uk
45 | args:
46 | postcode: "RG18 4QU"
47 | housenameornumber: "6"
48 | ```
49 |
50 | ## How to find your UPRN
51 |
52 | An easy way to discover your Unique Property Reference Number (UPRN) is by going to [Find My Address](https://www.findmyaddress.co.uk/) and providing your address details.
53 |
--------------------------------------------------------------------------------
/doc/source/kuringgai_nsw_gov_au.md:
--------------------------------------------------------------------------------
1 | # Ku-ring-gai Council
2 |
3 | Support for schedules provided by [Ku-ring-gai Council Waste and Recycling](https://www.krg.nsw.gov.au/Community/Waste-and-recycling/Bins-and-collection-days).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: kuringgai_nsw_gov_au
11 | args:
12 | post_code: POST_CODE
13 | suburb: SUBURB
14 | street_name: STREET_NAME
15 | street_number: STREET_NUMBER
16 | ```
17 |
18 | ### Configuration Variables
19 |
20 | **post_code**
21 | *(string) (required)*
22 |
23 | **suburb**
24 | *(string) (required)*
25 |
26 | **street_name**
27 | *(string) (required)*
28 |
29 | **street_number**
30 | *(string) (required)*
31 |
32 | ## Example
33 |
34 |
35 | ```yaml
36 | waste_collection_schedule:
37 | sources:
38 | - name: kuringgai_nsw_gov_au
39 | args:
40 | post_code: 2070
41 | suburb: LINDFIELD
42 | street_name: Wolseley Road
43 | street_number: 42
44 | ```
45 |
46 | ## How to get the source arguments
47 |
48 | Visit the [Ku-ring-gai Council Waste and Recycling](https://www.krg.nsw.gov.au/Community/Waste-and-recycling/Bins-and-collection-days) page and search for your address. The arguments should exactly match the results shown for Post Code, Suburb, Street and number portion of the Property.
49 |
--------------------------------------------------------------------------------
/doc/source/campbelltown_nsw_gov_au.md:
--------------------------------------------------------------------------------
1 | # Cambelltown City Council
2 |
3 | Support for schedules provided by [Cambelltown City Council Waste and Recycling](https://www.campbelltown.nsw.gov.au/ServicesandFacilities/WasteandRecycling).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: campbelltown_nsw_gov_au
11 | args:
12 | post_code: POST_CODE
13 | suburb: SUBURB
14 | street_name: STREET_NAME
15 | street_number: STREET_NUMBER
16 | ```
17 |
18 | ### Configuration Variables
19 |
20 | **post_code**
21 | *(string) (required)*
22 |
23 | **suburb**
24 | *(string) (required)*
25 |
26 | **street_name**
27 | *(string) (required)*
28 |
29 | **street_number**
30 | *(string) (required)*
31 |
32 | ## Example
33 |
34 | ```yaml
35 | waste_collection_schedule:
36 | sources:
37 | - name: campbelltown_nsw_gov_au
38 | args:
39 | post_code: 2566
40 | suburb: Minto
41 | street_name: Brookfield Road
42 | street_number: 10
43 | ```
44 |
45 | ## How to get the source arguments
46 |
47 | Visit the [Cambelltown City Council Waste and Recycling](https://www.campbelltown.nsw.gov.au/ServicesandFacilities/WasteandRecycling) page and search for your address. The arguments should exactly match the results shown for Post Code, Suburb, Street and number portion of the Property.
48 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/awbkoeln_de.py:
--------------------------------------------------------------------------------
1 | import datetime
2 | import json
3 |
4 | import requests
5 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
6 |
7 | TITLE = "AWB Köln"
8 | DESCRIPTION = "Source for Abfallwirtschaftsbetriebe Köln waste collection."
9 | URL = "https://www.awbkoeln.de"
10 | TEST_CASES = {"Koeln": {"street_code": 2, "building_number": 50}}
11 |
12 |
13 | class Source:
14 | def __init__(self, street_code, building_number):
15 | self._street_code = street_code
16 | self._building_number = building_number
17 |
18 | def fetch(self):
19 | args = {
20 | "street_code": self._street_code,
21 | "building_number": self._building_number,
22 | }
23 |
24 | now = datetime.datetime.now()
25 | args["start_year"] = now.year
26 | args["start_month"] = now.month
27 | args["end_year"] = now.year + 1
28 | args["end_month"] = now.month
29 |
30 | # get json file
31 | r = requests.get("https://www.awbkoeln.de/api/calendar", params=args)
32 |
33 | data = json.loads(r.text)
34 |
35 | entries = []
36 | for d in data["data"]:
37 | date = datetime.date(year=d["year"], month=d["month"], day=d["day"])
38 | entries.append(Collection(date, d["type"]))
39 |
40 | return entries
41 |
--------------------------------------------------------------------------------
/doc/source/sheffield_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Sheffield City Council
2 |
3 | Support for schedules provided by [Sheffield City Council](https://wasteservices.sheffield.gov.uk/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: sheffield_gov_uk
11 | args:
12 | uprn: UNIQUE_PROPERTY_REFERENCE_NUMBER
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **uprn**
18 | *(string) (optional) (preferred method)*
19 |
20 | This is required if you do not supply any other options. Using a UPRN removes the need to do an address look up using web requests.
21 |
22 | ## Example using UPRN
23 | ```yaml
24 | waste_collection_schedule:
25 | sources:
26 | - name: sheffield_gov_uk
27 | args:
28 | uprn: "100050938234"
29 | ```
30 |
31 | ## How to find your `UPRN`
32 |
33 | An easy way to find your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.
34 |
35 | Otherwise you can inspect the URL on [Sheffield City Council's Waste Services](https://wasteservices.sheffield.gov.uk/) site having searched for and selected your address details. Your UPRN is the collection of digits at the end of the URL (before /calendar), for example: *https://wasteservices.sheffield.gov.uk/property/`100050938234`* or *https://wasteservices.sheffield.gov.uk/property/`100050938234`/calendar*
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/jumomind_de.py:
--------------------------------------------------------------------------------
1 | import datetime
2 | import json
3 |
4 | import requests
5 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
6 |
7 | TITLE = "Jumomind"
8 | DESCRIPTION = "Source for Jumomind.de waste collection."
9 | URL = "https://www.jumomind.de"
10 | TEST_CASES = {
11 | "ZAW": {"service_id": "zaw", "city_id": 106, "area_id": 94},
12 | "Bad Homburg, Bahnhofstrasse": {"service_id": "hom", "city_id": 1, "area_id": 411},
13 | "Bad Buchau via MyMuell": {
14 | "service_id": "mymuell",
15 | "city_id": 3031,
16 | "area_id": 3031,
17 | },
18 | }
19 |
20 |
21 | class Source:
22 | def __init__(self, service_id, city_id, area_id):
23 | self._service_id = service_id
24 | self._city_id = city_id
25 | self._area_id = area_id
26 |
27 | def fetch(self):
28 | args = {"r": "dates/0", "city_id": self._city_id, "area_id": self._area_id}
29 |
30 | # get json file
31 | r = requests.get(
32 | f"https://{self._service_id}.jumomind.com/mmapp/api.php", params=args
33 | )
34 |
35 | entries = []
36 |
37 | data = json.loads(r.text)
38 | for d in data:
39 | entries.append(
40 | Collection(datetime.date.fromisoformat(d["day"]), d["title"])
41 | )
42 |
43 | return entries
44 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/abfallnavi_de.py:
--------------------------------------------------------------------------------
1 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
2 | from waste_collection_schedule.service.AbfallnaviDe import AbfallnaviDe
3 |
4 | TITLE = "AbfallNavi"
5 | DESCRIPTION = (
6 | "Source for AbfallNavi waste collection. AbfallNavi is a brand name of regioit.de."
7 | )
8 | URL = "https://www.regioit.de"
9 | TEST_CASES = {
10 | "Aachen, Abteiplatz 7": {
11 | "service": "aachen",
12 | "ort": "Aachen",
13 | "strasse": "Abteiplatz",
14 | "hausnummer": "7",
15 | },
16 | "Lindlar, Aggerweg": {
17 | "service": "lindlar",
18 | "ort": "Lindlar",
19 | "strasse": "Aggerweg",
20 | },
21 | "Roetgen, Am Sportplatz 2": {
22 | "service": "roe",
23 | "ort": "Roetgen",
24 | "strasse": "Am Sportplatz",
25 | "hausnummer": "2",
26 | },
27 | }
28 |
29 |
30 | class Source:
31 | def __init__(self, service, ort, strasse, hausnummer=None):
32 | self._api = AbfallnaviDe(service)
33 | self._ort = ort
34 | self._strasse = strasse
35 | self._hausnummer = hausnummer
36 |
37 | def fetch(self):
38 | dates = self._api.get_dates(self._ort, self._strasse, self._hausnummer)
39 |
40 | entries = []
41 | for d in dates:
42 | entries.append(Collection(d[0], d[1]))
43 | return entries
44 |
--------------------------------------------------------------------------------
/doc/source/a_region_ch.md:
--------------------------------------------------------------------------------
1 | # A-Region, Switzerland
2 |
3 | Support for schedules provided by [A-Region.ch](https://www.a-region.ch)
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: a_region_ch
11 | args:
12 | municipality: MUNICIPALITY
13 | district: DISTRICT
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **municipality**
19 | *(string) (required)*
20 |
21 | **district**
22 | *(string) (optional)*
23 | Some municipalities (like Rorschach) are separated into districts for several waste types (e.g. `Hauskehricht` and `Papier, Karton`).
24 |
25 | ## Examples
26 |
27 | Municipality without extra districts:
28 |
29 | ```yaml
30 | waste_collection_schedule:
31 | sources:
32 | - name: a_region_ch
33 | args:
34 | municipality: Andwil
35 | ```
36 |
37 | Municipality with extra districts:
38 |
39 | ```yaml
40 | waste_collection_schedule:
41 | sources:
42 | - name: a_region_ch
43 | args:
44 | municipality: Rorschach
45 | district: Unteres Stadtgebiet
46 |
47 | ```
48 |
49 | ## How to get the source argument
50 |
51 | Open [Abfallkalender A-Region](https://www.a-region.ch/index.php?apid=13875680&apparentid=4618613) which shows a list of all municipalities. Select your municipality from the list.
52 | Some municipalities are separated into districts. Check for all waste types and add district if needed.
53 |
--------------------------------------------------------------------------------
/doc/source/wuerzburg_de.md:
--------------------------------------------------------------------------------
1 | # Abfallkalender Würzburg
2 |
3 | Support for schedules provided by [Abfallkalender Würzburg](https://www.wuerzburg.de/themen/umwelt-verkehr/vorsorge-entsorgung/abfallkalender/32208.Abfallkalender.html), serving the City of Würzburg.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: wuerzburg_de
11 | args:
12 | district: ADDRESS
13 | street: STREET
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **district** and **street** can be used independently, only **one** is required. If set, priority will be given to **street**.
19 |
20 | **district**
21 | *(string) (required)* - if *street* is empty
22 |
23 | **street**
24 | *(string) (required)* - if *district* is empty
25 |
26 | ## Example
27 |
28 | Both examples will yield the same result.
29 |
30 | ```yaml
31 | waste_collection_schedule:
32 | sources:
33 | - name: wuerzburg_de
34 | args:
35 | district: "Altstadt"
36 | ```
37 |
38 | ```yaml
39 | waste_collection_schedule:
40 | sources:
41 | - name: wuerzburg_de
42 | args:
43 | street: "Juliuspromenade"
44 | ```
45 |
46 | ## How to get the source argument
47 |
48 | The source argument is either district or street as displayed in the web form at [Abfallkalender Würzburg](https://www.wuerzburg.de/themen/umwelt-verkehr/vorsorge-entsorgung/abfallkalender/32208.Abfallkalender.html). Exact match is required.
49 |
--------------------------------------------------------------------------------
/doc/source/aw_harburg_de.md:
--------------------------------------------------------------------------------
1 | # AW Harburg
2 |
3 | Support for schedules provided by [AW Landkreis Harburg](https://www.landkreis-harburg.de) located in Lower Saxony, Germany.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: aw_harburg_de
11 | args:
12 | level_1: LEVEL_1
13 | level_2: LEVEL_2
14 | level_3: LEVEL_3
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **level_1**
20 | *(string) (required)*
21 |
22 | **level_2**
23 | *(string) (required)*
24 |
25 | **level_3**
26 | *(string) (optional - depending on level_2)*
27 |
28 | ## Example
29 |
30 | ```yaml
31 | waste_collection_schedule:
32 | sources:
33 | - name: aw_harburg_de
34 | args:
35 | level_1: "Hanstedt"
36 | level_2: "Evendorf"
37 | ```
38 |
39 |
40 | ```yaml
41 | waste_collection_schedule:
42 | sources:
43 | - name: aw_harburg_de
44 | args:
45 | level_1: "Buchholz"
46 | level_2: "Buchholz mit Steinbeck (ohne Reindorf)"
47 | level_3: "Seppenser Mühlenweg Haus-Nr. 1 / 2"
48 | ```
49 |
50 | ## How to get the source arguments
51 |
52 | Check [AW Harburg Abfallkalender](https://www.landkreis-harburg.de/bauen-umwelt/abfallwirtschaft/abfallkalender/) if you need two or three levels of entries in the config. The strings need to be written in the exact same way as in the webinterface e.g. "Bremer Straße Haus-Nr. 93 - 197 / 78 - 158".
53 |
--------------------------------------------------------------------------------
/doc/source/derby_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Derby City Council
2 |
3 | Support for schedules provided by [Derby City Council](https://secure.derby.gov.uk/binday/), serving the
4 | city of Derby, UK.
5 |
6 | ## Configuration via configuration.yaml
7 |
8 | (recommended)
9 | ```yaml
10 | waste_collection_schedule:
11 | sources:
12 | - name: derby_gov_uk
13 | args:
14 | premises_id: PREMISES_ID
15 | ```
16 |
17 | or (not recommended)
18 |
19 | ```yaml
20 | waste_collection_schedule:
21 | sources:
22 | - name: derby_gov_uk
23 | args:
24 | post_code: DE1 1ED
25 | house_number: 1
26 | ```
27 |
28 | ### Configuration Variables
29 |
30 | **premises_id**
31 | *(int) (required if post_code not provided)*
32 |
33 | **post_code**
34 | *(string) (required if premises_id not provided)*
35 |
36 | **house_number**
37 | *(int) (required if premises_id not provided)*
38 |
39 | ## Example
40 |
41 | ```yaml
42 | waste_collection_schedule:
43 | sources:
44 | - name: derby_gov_uk
45 | args:
46 | premises_id: 100030339868
47 | ```
48 |
49 | ## How to get the premises_id argument
50 |
51 | The premises_id can be found in the URL when looking up your
52 | bin collection days at [Derby City Councils bin day page](https://secure.derby.gov.uk/binday/).
53 |
54 | ## Why premises_id over post_code and house number?
55 |
56 | The code has to do a search by post code and house number then look up the bin collection time using premises ID.
57 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/stuttgart_de.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | import json
4 |
5 | import inquirer
6 | import requests
7 |
8 |
9 | def main():
10 | # search for street
11 | questions = [inquirer.Text("street", message="Enter search string for street")]
12 | answers = inquirer.prompt(questions)
13 |
14 | # retrieve suggestions for street
15 | r = requests.get(
16 | "https://service.stuttgart.de/lhs-services/aws/strassennamen", params=answers
17 | )
18 |
19 | data = json.loads(r.text)
20 | street_choices = []
21 | for d in data["suggestions"]:
22 | street_choices.append((d["value"], d["data"]))
23 |
24 | # select street
25 | questions = [
26 | inquirer.List("street", choices=street_choices, message="Select street")
27 | ]
28 | results = inquirer.prompt(questions)
29 |
30 | # search for house number
31 | questions = [inquirer.Text("streetnr", message="Enter house number")]
32 | results.update(inquirer.prompt(questions))
33 |
34 | print("Copy the following statements into your configuration.yaml:\n")
35 | print("# waste_collection_schedule source configuration")
36 | print("waste_collection_schedule:")
37 | print(" sources:")
38 | print(" - name: stuttgart_de")
39 | print(" args:")
40 | for key, value in results.items():
41 | print(f" {key}: {value}")
42 |
43 |
44 | if __name__ == "__main__":
45 | main()
46 |
--------------------------------------------------------------------------------
/doc/source/rh_entsorgung_de.md:
--------------------------------------------------------------------------------
1 | # Rhein-Hunsrück Entsorgung (RHE)
2 |
3 | Support for schedules provided by [RHE](https://www.rh-entsorgung.de) (Rhein-Hunsrück Entsorgung) located in Rhineland-Palatinate, Germany.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: rh_entsorgung_de
11 | args:
12 | city: CITY
13 | street: STREET
14 | house_number: HNR
15 | address_suffix: HNR_SUFFIX
16 | ```
17 |
18 | ### Configuration Variables
19 |
20 | **city**
21 | *(string) (required)*
22 |
23 | **street**
24 | *(string) (required)*
25 |
26 | **house_number**
27 | *(integer) (required)*
28 |
29 | **address_suffix**
30 | *(string) (optional) (default: "")*
31 |
32 | ## Example
33 |
34 | ```yaml
35 | waste_collection_schedule:
36 | sources:
37 | - name: rhe_de
38 | args:
39 | city: "Alterkülz"
40 | street: "Brühlweg"
41 | house_number: 1
42 | ```
43 |
44 | ## How to get the source arguments
45 |
46 | These values are the location you want to query for. Make sure, the writing is exactly as it is on [https://www.rh-entsorgung.de/de/Service/Abfallkalender/](https://www.rh-entsorgung.de/de/Service/Abfallkalender/). Typos will result in the collection schedule for the default location *(Alterkülz, Brühlweg)*, so make sure to validate the returned schedule after setting up the integration. As `house_number` expects a numeric input, address suffixes have to be provided via the `address_suffix` argument.
--------------------------------------------------------------------------------
/doc/source/awn_de.md:
--------------------------------------------------------------------------------
1 | # Abfallwirtschaft Neckar-Odenwald-Kreis (AWN)
2 |
3 | Support for schedules provided by [Abfallwirtschaft Neckar-Odenwald-Kreis](https://www.awn-online.de/) located in Baden-Württemberg, Germany.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: awn_de
11 | args:
12 | city: CITY
13 | street: STREET
14 | house_number: HNR
15 | address_suffix: HNR_SUFFIX
16 | ```
17 |
18 | ### Configuration Variables
19 |
20 | **city**
21 | *(string) (required)*
22 |
23 | **street**
24 | *(string) (required)*
25 |
26 | **house_number**
27 | *(integer) (required)*
28 |
29 | **address_suffix**
30 | *(string) (optional) (default: "")*
31 |
32 | ## Example
33 |
34 | ```yaml
35 | waste_collection_schedule:
36 | sources:
37 | - name: awn_de
38 | args:
39 | city: "Billigheim"
40 | street: "Marienhöhe"
41 | house_number: 5
42 | address_suffix: "A"
43 | ```
44 |
45 | ## How to get the source arguments
46 |
47 | These values are the location you want to query for. Make sure, the writing is exactly as it is on [https://www.awn-online.de/abfuhrtermine](https://www.awn-online.de/abfuhrtermine). Typos will result in an parsing error which is printed in the log. As `house_number` expects a numeric input, address suffixes have to be provided via the `address_suffix` argument.
48 | `address_suffix` could be for example a alpha-numeric character "A" or a additional house number like "/1".
--------------------------------------------------------------------------------
/doc/source/jumomind_de.md:
--------------------------------------------------------------------------------
1 | # Jumomind.de / MyMuell.de
2 |
3 | Support for schedules provided by [jumomind.de](https://jumomind.de/) and [MyMüll App](https://www.mymuell.de). Jumomind and MyMüll are services provided by [junker.digital](https://junker.digital/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: jumomind_de
11 | args:
12 | service_id: SERVICE_ID
13 | city_id: CITY_ID
14 | area_id: AREA_ID
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **service_id**
20 | *(string) (required)*
21 |
22 | **city_id**
23 | *(string) (required)*
24 |
25 | **area_id**
26 | *(string) (required)*
27 |
28 | ## Example
29 |
30 | ```yaml
31 | waste_collection_schedule:
32 | sources:
33 | - name: jumomind_de
34 | args:
35 | service_id: zaw
36 | city_id: 106
37 | area_id: 94
38 | ```
39 |
40 | ## How to get the source arguments
41 |
42 | There is a script with an interactive command line interface which generates the required source configuration:
43 |
44 | [https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/jumomind_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/jumomind_de.py).
45 |
46 | First, install the Python module `inquirer`. Then run this script from a shell and answer the questions.
47 |
--------------------------------------------------------------------------------
/doc/source/muellmax_de.md:
--------------------------------------------------------------------------------
1 | # Müllmax
2 |
3 | Support for schedules provided by [muellmax.de](https://www.muellmax.de).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: muellmax_de
11 | args:
12 | service: SERVICE
13 | mm_frm_ort_sel: ORT_SEL
14 | mm_frm_str_sel: STR_SEL
15 | mm_frm_hnr_sel: HNR_SEL
16 | ```
17 |
18 | ### Configuration Variables
19 |
20 | **service**
21 | *(string) (required)*
22 |
23 | **mm_frm_ort_sel**
24 | *(string) (optional)*
25 |
26 | **mm_frm_str_sel**
27 | *(string) (optional)*
28 |
29 | **mm_frm_hnr_sel**
30 | *(string) (optional)*
31 |
32 | ## Example
33 |
34 | ```yaml
35 | waste_collection_schedule:
36 | sources:
37 | - name: muellmax_de
38 | args:
39 | service: Fes
40 | mm_frm_str_sel: Achenbachstraße
41 | mm_frm_hnr_sel: 60596;Sachsenhausen;2;
42 | ```
43 |
44 | ## How to get the source arguments
45 |
46 | There is a script with an interactive command line interface which generates the required source configuration:
47 |
48 | [https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/muellmax_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/muellmax_de.py).
49 |
50 | First, install the Python module `inquirer`. Then run this script from a shell and answer the questions.
51 |
--------------------------------------------------------------------------------
/doc/source/abfallnavi_de.md:
--------------------------------------------------------------------------------
1 | # AbfallNavi.de
2 |
3 | Support for schedules provided by [Abfallnavi.de](https://www.abfallnavi.de). The service is hosted under [regioit.de](https://regioit.de).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: abfallnavi_de
11 | args:
12 | service: SERVICE
13 | ort: SERVICE
14 | strasse: STRASSE
15 | hausnummer: hausnummer
16 | ```
17 |
18 | ### Configuration Variables
19 |
20 | **service**
21 | *(string) (required)*
22 |
23 | **ort**
24 | *(string) (required)*
25 |
26 | **strasse**
27 | *(string) (required)*
28 |
29 | **hausnummer**
30 | *(string) (optional)*
31 |
32 | ## Example
33 |
34 | ```yaml
35 | waste_collection_schedule:
36 | sources:
37 | - name: abfallnavi_de
38 | args:
39 | service: coe
40 | ort: Coesfeld
41 | strasse: Ahornweg
42 | ```
43 |
44 | ## How to get the source arguments
45 |
46 | There is a script with an interactive command line interface which generates the required source configuration:
47 |
48 | [https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/abfallnavi_de.py](https://github.com/mampfes/hacs_waste_collection_schedule/blob/master/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/abfallnavi_de.py).
49 |
50 | First, install the Python module `inquirer`. Then run this script from a shell and answer the questions.
51 |
--------------------------------------------------------------------------------
/doc/source/bielefeld_de.md:
--------------------------------------------------------------------------------
1 | # Umweltbetrieb Stadt Bielefeld
2 |
3 | Support for schedules provided by [Umweltbetrieb Stadt Bielefeld](https://www.bielefeld.de/umweltbetrieb) located in Bielefeld, Germany.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: bielefeld_de
11 | args:
12 | street: STREET
13 | house_number: HNR
14 | address_suffix: HNR_SUFFIX
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **street**
20 | *(string) (required)*
21 |
22 | **house_number**
23 | *(integer) (required)*
24 |
25 | **address_suffix**
26 | *(string) (optional) (default: "")*
27 |
28 | ## Example
29 |
30 | ```yaml
31 | waste_collection_schedule:
32 | sources:
33 | - name: bielefeld_de
34 | args:
35 | street: "Eckendorfer Straße"
36 | house_number: 57
37 | ```
38 |
39 | ## How to get the source arguments
40 |
41 | These values are the location you want to query for. Make sure, the writing is exactly as it is on [https://anwendungen.bielefeld.de/WasteManagementBielefeld/WasteManagementServlet?SubmitAction=wasteDisposalServices](https://anwendungen.bielefeld.de/WasteManagementBielefeld/WasteManagementServlet?SubmitAction=wasteDisposalServices). Typos will result in an parsing error which is printed in the log. As `house_number` expects a numeric input, address suffixes have to be provided via the `address_suffix` argument.
42 | `address_suffix` could be for example a alpha-numeric character "A" or a additional house number like "/1".
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/erlangen_hoechstadt_de.py:
--------------------------------------------------------------------------------
1 | import requests
2 | import datetime
3 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
4 | from waste_collection_schedule.service.ICS import ICS
5 |
6 | import urllib
7 |
8 | TITLE = "Landkreis Erlangen-Höchstadt"
9 | DESCRIPTION = "Source for Landkreis Erlangen-Höchstadt"
10 | URL = "https://www.erlangen-hoechstadt.de/"
11 | TEST_CASES = {
12 | "Höchstadt": {"city": "Höchstadt", "street": "Böhmerwaldstraße"},
13 | "Brand": {"city": "Eckental", "street": "Eckenhaid, Amselweg"},
14 | "Ortsteile": {"city": "Wachenroth", "street": "Wachenroth Ort ink. aller Ortsteile"}
15 | }
16 |
17 |
18 | class Source:
19 | def __init__(self, city, street):
20 | self._city = city
21 | self._street = street
22 | self._ics = ICS(split_at=" / ")
23 |
24 | def fetch(self):
25 | city = self._city.upper()
26 | street = self._street
27 | today = datetime.date.today()
28 | year = today.year
29 |
30 | payload = {"ort": city, "strasse": street,
31 | "abfallart": "Alle", "jahr": year}
32 | r = requests.get(
33 | "https://www.erlangen-hoechstadt.de/komx/surface/dfxabfallics/GetAbfallIcs", params=payload
34 | )
35 | r.encoding = r.apparent_encoding
36 | dates = self._ics.convert(r.text)
37 |
38 | entries = []
39 | for d in dates:
40 | entries.append(Collection(d[0], d[1]))
41 | return entries
42 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/stadtreinigung_dresden_de.py:
--------------------------------------------------------------------------------
1 | import datetime
2 |
3 | import requests
4 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
5 | from waste_collection_schedule.service.ICS import ICS
6 |
7 | TITLE = "Stadtreinigung Dresden"
8 | DESCRIPTION = "Source for Stadtreinigung Dresden waste collection."
9 | URL = "https://www.dresden.de/apps_ext/AbfallApp/wastebins?0"
10 | TEST_CASES = {
11 | "Neumarkt 6": {"standort": 80542},
12 | }
13 |
14 |
15 | class Source:
16 | def __init__(self, standort):
17 | self._standort = standort
18 | self._ics = ICS()
19 |
20 | def fetch(self):
21 |
22 | now = datetime.datetime.now().date()
23 |
24 | r = requests.get(
25 | "https://stadtplan.dresden.de/project/cardo3Apps/IDU_DDStadtplan/abfall/ical.ashx",
26 | params={
27 | "STANDORT": self._standort,
28 | "DATUM_VON": now.strftime("%d.%m.%Y"),
29 | "DATUM_BIS": (now + datetime.timedelta(days=365)).strftime("%d.%m.%Y"),
30 | },
31 | )
32 |
33 | dates = self._ics.convert(r.text)
34 |
35 | # example: "Leerung Gelbe Tonne, Bio-Tonne"
36 |
37 | entries = []
38 | for d in dates:
39 | if d[1] == "Abfallkalender endet bald":
40 | continue
41 |
42 | types = d[1].removeprefix("Leerung ")
43 | for type in types.split(", "):
44 | entries.append(Collection(d[0], type))
45 | return entries
46 |
--------------------------------------------------------------------------------
/doc/source/sbazv_de.md:
--------------------------------------------------------------------------------
1 | # Südbrandenburgischer Abfallzweckverband
2 |
3 | Support for schedules provided by [https://www.sbazv.de/](https://www.sbazv.de/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: sbazv_de
11 | args:
12 | city: CITY
13 | district: DISTRICT
14 | street: STREET
15 | ```
16 |
17 | ### Configuration Variables
18 |
19 | **city**
20 | *(string) (required)*
21 |
22 | **district**
23 | *(string) (required)*
24 |
25 | **street**
26 | *(string) (required)*
27 |
28 | ## Example
29 |
30 | ```yaml
31 | waste_collection_schedule:
32 | sources:
33 | - name: sbazv_de
34 | args:
35 | city: "wildau"
36 | district: "wildau"
37 | street: "Ahornring"
38 | ```
39 |
40 | ## How to get the source arguments
41 |
42 | ### Hardcore Variant: Extract arguments from website
43 |
44 | The way to get the source arguments is to extract them from the website using a (desktop) browser with developer tools, e.g. Google Chrome:
45 |
46 | 1. Open [https://www.sbazv.de/entsorgungstermine/restmuell-papier-gelbesaecke-laubsaecke-weihnachtsbaeume/](https://www.sbazv.de/entsorgungstermine/restmuell-papier-gelbesaecke-laubsaecke-weihnachtsbaeume/).
47 | 2. Enter your data and click on "Termine anzeigen"
48 | 3. Right-click on "Download als ICS Datei"
49 | 4. In the context menu click on "Copy link address" (or something similiar, depending on your browser).
50 | 5. Paste the copied string to a text editor. You can see the string to download your ics file now.
51 |
--------------------------------------------------------------------------------
/doc/source/landkreis_rhoen_grabfeld.md:
--------------------------------------------------------------------------------
1 | # Landkreis Rhön Grabfeld
2 |
3 | Support for schedules provided by [AbfallInfo Rhön Grabfeld](https://www.abfallinfo-rhoen-grabfeld.de/service/abfuhr-wecker), serving the rural district of Rhön Grabfeld.
4 |
5 | Api in the background is provided by Offizium.
6 |
7 | Possibles types are:
8 | - Restmüll/Gelber Sack/Biotonne
9 | - Papiersammlung
10 | - Problemmüllsammlung
11 |
12 | ## Configuration via configuration.yaml
13 |
14 | ```yaml
15 | waste_collection_schedule:
16 | sources:
17 | - name: landkreis_landkreis_rhoen_grabfeld
18 | args:
19 | district: DISTRICT
20 | city: CITY
21 | ```
22 |
23 | ### Configuration Variables
24 |
25 | **district** and **city** can be used independently, they can also be omitted to get the calender for the whole rural district.
26 |
27 | **district**
28 | *(string)*
29 |
30 | **street**
31 | *(string)*
32 |
33 | ## Example
34 |
35 |
36 | ```yaml
37 | waste_collection_schedule:
38 | sources:
39 | - name: landkreis_rhoen_grabfeld
40 | args:
41 | district: "Oberwaldbehrungen"
42 | ```
43 |
44 | ```yaml
45 | waste_collection_schedule:
46 | sources:
47 | - name: landkreis_rhoen_grabfeld
48 | args:
49 | city: "Ostheim"
50 | ```
51 |
52 | ## How to get the source argument
53 |
54 | To get the names used by the api navigate to the [collection alarm website](https://www.abfallinfo-rhoen-grabfeld.de/service/abfuhr-wecker), enter your city and district, select "Aktuelles Jahr als .ics-Datei exportieren" and copy the parameters from the corresponding download url.
55 |
--------------------------------------------------------------------------------
/doc/source/nawma_sa_gov_au.md:
--------------------------------------------------------------------------------
1 | # North Adelaide Waste Management Authority (South Australia)
2 |
3 | Support for schedules provided by [North Adelaide Waste Management Authority](https://www.nawma.sa.gov.au/kerbside-collections/bin-collection-days/).
4 | This covers Salisbury, Playford, and Gawler councils.
5 |
6 | ## Configuration via configuration.yaml
7 |
8 | ```yaml
9 | waste_collection_schedule:
10 | sources:
11 | - name: nawma_sa_gov_au
12 | args:
13 | suburb: SUBURB
14 | street_name: STREET_NAME
15 | street_number: STREET_NUMBER
16 | ```
17 |
18 | ### Configuration Variables
19 |
20 | **suburb**
21 | *(string) (required)*
22 |
23 | **street_name**
24 | *(string) (required)*
25 |
26 | **street_number**
27 | *(string) (optional)*
28 |
29 | Only required if the street crosses multiple collection areas with different days.
30 |
31 | ## Example
32 |
33 | ```yaml
34 | waste_collection_schedule:
35 | sources:
36 | - name: nawma_sa_gov_au
37 | args:
38 | suburb: Whites Road
39 | street_name: Paralowie
40 | ```
41 |
42 | ## How to get the source arguments
43 |
44 | Visit the [North Adelaide Waste Management Authority collection days](https://www.nawma.sa.gov.au/kerbside-collections/bin-collection-days/) page and search for your address. The arguments should exactly match the results shown for Suburb and Street and (if required) the number portion of the auto-completed address.
45 |
46 | Note: Some addresses can be quite obscure, for example for the Gawler main street set `street_name` to `'Murray Street (sec between Ayers and the railway line'`.
47 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/richmondshire_gov_uk.py:
--------------------------------------------------------------------------------
1 | from datetime import datetime
2 | import requests
3 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
4 | import json
5 |
6 | TITLE = "Richmondshire (North Yorkshire)"
7 | DESCRIPTION = "To find your UPRN, visit the Richmondshire page and use the address search. Right-click your entry in the house dropdown, choose Inspect, and copy the UPRN from the value"
8 | URL = "https://www.richmondshire.gov.uk/collectionCalendar"
9 | TEST_CASES = {"test 1": {"uprn": 200001767082}, "test 2": {"uprn": 200001767078}, "test3": {"uprn": 200001767079 }}
10 |
11 | ICONS = {
12 | "240L GREY RUBBISH BIN": "mdi:trash-can",
13 | "55L RECYCLING BOX": "mdi:recycle",
14 | "140L GARDEN BIN": "mdi:leaf",
15 | }
16 |
17 | class Source:
18 | def __init__(
19 | self, uprn
20 | ): # argX correspond to the args dict in the source configuration
21 | self._uprn = uprn
22 |
23 | def fetch(self):
24 | r = requests.get(
25 | f"https://www.richmondshire.gov.uk/Umbraco/Api/MyAreaApi/GetBinRoundData?uprn={self._uprn}"
26 | )
27 | # print(r.text)
28 | ids = r.json()
29 | # print (len(ids))
30 |
31 | entries = []
32 |
33 | for id in ids:
34 | entries.append(
35 | Collection(
36 | date=datetime.strptime(id["start"], "%Y-%m-%dT%H:%M:%S").date(),
37 | t=id["title"],
38 | icon=ICONS.get(id["title"]),
39 | )
40 | )
41 | return entries
42 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/was_wolfsburg_de.py:
--------------------------------------------------------------------------------
1 | import datetime
2 | import re
3 |
4 | import requests
5 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
6 | from waste_collection_schedule.service.ICS import ICS
7 |
8 | TITLE = "Wolfsburger Abfallwirtschaft und Straßenreinigung"
9 | DESCRIPTION = "Source for waste collections for WAS-Wolfsburg, Germany."
10 | URL = "https://was-wolfsburg.de"
11 | TEST_CASES = {"WAS": {"city": "Barnstorf", "street": "Bahnhofspassage"}}
12 |
13 |
14 | class Source:
15 | def __init__(self, city, street):
16 | self._city = city
17 | self._street = street
18 | self._ics = ICS()
19 |
20 | def fetch(self):
21 | # fetch "Gelber Sack"
22 | args = {"g": self._city}
23 | r = requests.get(
24 | "https://was-wolfsburg.de/subgelberweihgarten/php/abfuhrgelber.php",
25 | params=args,
26 | )
27 |
28 | entries = []
29 | match = re.findall(r"(\d{2})\.(\d{2})\.(\d{4})", r.text)
30 | for m in match:
31 | date = datetime.date(day=int(m[0]), month=int(m[1]), year=int(m[2]))
32 | entries.append(Collection(date, "Gelber Sack"))
33 |
34 | # fetch remaining collections
35 | args = {"ortabf": self._street}
36 | r = requests.post(
37 | "https://was-wolfsburg.de/subabfuhrtermine/ics_abfuhrtermine3.php",
38 | data=args,
39 | )
40 | dates = self._ics.convert(r.text)
41 | for d in dates:
42 | entries.append(Collection(d[0], d[1]))
43 |
44 | return entries
45 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/test/recurring.ics:
--------------------------------------------------------------------------------
1 | BEGIN:VCALENDAR
2 | VERSION:2.0
3 | CALSCALE:GREGORIAN
4 | PRODID:-//SabreDAV//SabreDAV//EN
5 | X-WR-CALNAME:Sivom (zeguigui)
6 | X-APPLE-CALENDAR-COLOR:#748be7
7 | BEGIN:VEVENT
8 | CREATED:20200509T073126Z
9 | DTSTAMP:20200509T073349Z
10 | LAST-MODIFIED:20200509T073349Z
11 | UID:L911Y7UJ5NRKDSS4ARHOC
12 | SUMMARY:Poubelle jaune
13 | CLASS:PUBLIC
14 | STATUS:CONFIRMED
15 | RRULE:FREQ=WEEKLY;INTERVAL=2;BYDAY=TH
16 | SEQUENCE:2
17 | DESCRIPTION:yellow
18 | DTSTART;VALUE=DATE:20200402
19 | DTEND;VALUE=DATE:20200403
20 | END:VEVENT
21 | BEGIN:VEVENT
22 | CREATED:20200508T203313Z
23 | DTSTAMP:20200509T073457Z
24 | LAST-MODIFIED:20200509T073457Z
25 | UID:BB0RPY6WDYGZ9TFN2QATP
26 | SUMMARY:Encombrants
27 | CLASS:PUBLIC
28 | STATUS:CONFIRMED
29 | RRULE:FREQ=MONTHLY;INTERVAL=2;BYDAY=4FR
30 | SEQUENCE:4
31 | DESCRIPTION:red
32 | DTSTART;VALUE=DATE:20200522
33 | DTEND;VALUE=DATE:20200523
34 | END:VEVENT
35 | BEGIN:VEVENT
36 | CREATED:20200509T072937Z
37 | DTSTAMP:20200509T073331Z
38 | LAST-MODIFIED:20200509T073331Z
39 | UID:BSUFEJSO5777YTKTZ0GAUU
40 | SUMMARY:Poubelle verte
41 | CLASS:PUBLIC
42 | STATUS:CONFIRMED
43 | RRULE:FREQ=WEEKLY
44 | SEQUENCE:1
45 | DESCRIPTION:green
46 | DTSTART;VALUE=DATE:20200406
47 | DTEND;VALUE=DATE:20200407
48 | END:VEVENT
49 | BEGIN:VEVENT
50 | CREATED:20200509T073015Z
51 | DTSTAMP:20200509T073438Z
52 | LAST-MODIFIED:20200509T073438Z
53 | UID:UCZXXNAFZ6M095KX1HXHCZM
54 | SUMMARY:Poubelle marron (matin)
55 | CLASS:PUBLIC
56 | STATUS:CONFIRMED
57 | RRULE:FREQ=WEEKLY
58 | SEQUENCE:1
59 | DESCRIPTION:DarkGoldenRod
60 | DTSTART;VALUE=DATE:20200410
61 | DTEND;VALUE=DATE:20200411
62 | END:VEVENT
63 | END:VCALENDAR
64 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/york_gov_uk.py:
--------------------------------------------------------------------------------
1 | import json
2 | from datetime import datetime
3 |
4 | import requests
5 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
6 |
7 | TITLE = "York.gov.uk"
8 | DESCRIPTION = "Source for York.gov.uk services for the city of York, UK."
9 | URL = "https://york.gov.uk"
10 | TEST_CASES = {
11 | "Reighton Avenue, York": {"uprn": "100050580641"},
12 | "Granary Walk, York": {"uprn": "010093236548"},
13 | }
14 |
15 | ICONS = {
16 | "REFUSE": "mdi:trash-can",
17 | "RECYCLING": "mdi:recycle",
18 | "GARDEN": "mdi:leaf",
19 | }
20 |
21 |
22 | class Source:
23 | def __init__(self, uprn):
24 | self._uprn = uprn
25 |
26 | def fetch(self):
27 | # get json file
28 | r = requests.get(
29 | f"https://waste-api.york.gov.uk/api/Collections/GetBinCalendarDataForUprn/{self._uprn}"
30 | )
31 |
32 | # extract data from json
33 | data = json.loads(r.text)
34 |
35 | entries = []
36 |
37 | for collection in data["collections"]:
38 | try:
39 | entries.append(
40 | Collection(
41 | date=datetime.strptime(
42 | collection["date"], "%Y-%m-%dT%H:%M:%S"
43 | ).date(),
44 | t=collection["roundType"].title(),
45 | icon=ICONS[collection["roundType"]],
46 | )
47 | )
48 | except ValueError:
49 | pass # ignore date conversion failure for not scheduled collections
50 |
51 | return entries
52 |
--------------------------------------------------------------------------------
/doc/source/south_norfolk_and_broadland_gov_uk.md:
--------------------------------------------------------------------------------
1 | # South Norfolk and Broadland Council
2 |
3 | Support for schedules provided by [South Norfolk and Broadland Council](https://www.southnorfolkandbroadland.gov.uk/rubbish/find-bin-collection-day)
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: south_norfolk_gov_uk
11 | - args:
12 | address_payload: ADDRESS_PAYLOAD
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **address_payload**
18 | *(dict) (required)*
19 |
20 | This is the only configuration variable and is required. It is very easy to fetch.
21 | 1. Go to https://area.southnorfolkandbroadland.gov.uk/
22 | 2. Input your postcode and select your address
23 | 3. Paste the following code snippet into your browser console (right click -> inspect element -> console)
24 | 4. Paste the result into your `configuration.yaml`
25 |
26 | ```js
27 | cookieStore.get("MyArea.Data")
28 | .then(({ value }) => value)
29 | .then(decodeURIComponent)
30 | .then(JSON.parse)
31 | .then((value) => JSON.stringify(value, null, 2))
32 | .then(console.log)
33 | .catch(console.error);
34 | ```
35 |
36 | ## Example
37 |
38 | ```yaml
39 | waste_collection_schedule:
40 | sources:
41 | - address_payload: {
42 | "Uprn": "100091575309",
43 | "Address": "Tesco Stores Ltd, Blue Boar Lane, Sprowston, Norwich, Norfolk, NR7 8AB",
44 | "X": "625657.00000",
45 | "Y": "312146.00000",
46 | "Ward": "Sprowston East",
47 | "Parish": "Sprowston",
48 | "Village": "Sprowston",
49 | "Street": "Blue Boar Lane",
50 | "Authority": "2610"
51 | }
52 | ```
53 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/huntingdonshire_gov_uk.py:
--------------------------------------------------------------------------------
1 | import json
2 | from datetime import datetime
3 |
4 | import requests
5 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
6 |
7 | TITLE = "Huntingdonshire.gov.uk"
8 | DESCRIPTION = "Source for Huntingdonshire.gov.uk services for Huntingdonshire District Council."
9 | URL = "https://www.huntingdonshire.gov.uk"
10 | TEST_CASES = {
11 | "Wells Close, Brampton": {"uprn": "100090123510"},
12 | "Inkerman Rise, St. Neots": {"uprn": "10000144271"},
13 | }
14 |
15 | ICONS = {
16 | "Refuse": "mdi:trash-can",
17 | "Recycling": "mdi:recycle",
18 | "Garden": "mdi:leaf",
19 | }
20 |
21 |
22 | class Source:
23 | def __init__(self, uprn):
24 | self._uprn = uprn
25 |
26 | def fetch(self):
27 | # get json file
28 | r = requests.get(
29 | f"https://servicelayer3c.azure-api.net/wastecalendar/collection/search/{self._uprn}?authority=HDC&take=20"
30 | )
31 |
32 | # extract data from json
33 | data = json.loads(r.text)
34 |
35 | entries = []
36 |
37 | collections = r.json()["collections"]
38 | entries = []
39 |
40 | for collection in collections:
41 | for round_type in collection["roundTypes"]:
42 | entries.append(
43 | Collection(
44 | date=datetime.strptime(
45 | collection["date"], "%Y-%m-%dT%H:%M:%SZ"
46 | ).date(),
47 | t=round_type.title(),
48 | icon=ICONS.get(round_type),
49 | )
50 | )
51 |
52 |
53 | return entries
54 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/awb_bad_kreuznach_de.py:
--------------------------------------------------------------------------------
1 | import datetime
2 | import json
3 |
4 | import requests
5 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
6 |
7 | TITLE = "AWB Bad Kreuznach"
8 | DESCRIPTION = "Source for AWB Bad Kreuznach."
9 | URL = "https://app.awb-bad-kreuznach.de/"
10 | TEST_CASES = {
11 | "Hargesheim": {"ort": "Hargesheim", "strasse": "Winzenheimer Straße", "nummer": 16}
12 | }
13 |
14 | TYPES = ("restmuell", "bio", "wert", "papier")
15 |
16 |
17 | class Source:
18 | def __init__(self, ort, strasse, nummer):
19 | self._ort = ort
20 | self._strasse = strasse
21 | self._nummer = nummer
22 |
23 | def fetch(self):
24 | args = {
25 | "ort": self._ort,
26 | "strasse": self._strasse,
27 | "nummer": self._nummer,
28 | }
29 |
30 | # get latitude/longitude file
31 | r = requests.post(
32 | "https://app.awb-bad-kreuznach.de/api/checkAddress.php", data=args
33 | )
34 | data = json.loads(r.text)
35 |
36 | # get dates
37 | del args["nummer"]
38 | args["mode"] = "web"
39 | args["lat"] = data["lat"]
40 | args["lon"] = data["lon"]
41 | r = requests.post(
42 | "https://app.awb-bad-kreuznach.de/api/loadDates.php", data=args
43 | )
44 | data = json.loads(r.text)
45 |
46 | entries = []
47 |
48 | for d in data["termine"]:
49 | date = datetime.date.fromisoformat(d["termin"])
50 | for type in TYPES:
51 | if d[type] != "0":
52 | entries.append(Collection(date, type, date))
53 |
54 | return entries
55 |
--------------------------------------------------------------------------------
/doc/source/kwb_goslar_de.md:
--------------------------------------------------------------------------------
1 | # KWB-Goslar.de
2 |
3 | Support for schedules provided by [KWB-Goslar.de](https://www.kwb-goslar.de/Abfallwirtschaft/Abfuhr/) located in Lower Saxony, Germany.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: kwb_goslar_de
11 | args:
12 | pois: 2523.602 # Berliner Straße (Clausthal-Zellerfeld)
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **pois**
18 | *(string) (required)*
19 |
20 | #### How to find the `pois` value
21 |
22 | 1. Open [Online-Abfuhrkalender 2022](https://www.kwb-goslar.de/Abfallwirtschaft/Abfuhr/Online-Abfuhrkalender-2022/) (`Abfallwirtschaft -> Abfuhr -> Online-Abfuhrkalender 2022`)
23 | 2. Select your city (`Ort auswählen`)
24 | 3. Select your district/street (`Ortsteil, Straße auswählen`)
25 | 4. Copy the `pois` value out of the url (e.g. `https://www.kwb-goslar.de/Abfallwirtschaft/Abfuhr/Online-Abfuhrkalender-2022/index.php?ModID=48&...&pois=2523.602`)
26 |
27 | ## Example
28 |
29 | ```yaml
30 | waste_collection_schedule:
31 | sources:
32 | - name: kwb_goslar_de
33 | args:
34 | pois: 2523.409 # Braunschweiger Straße (Seesen)
35 | ```
36 |
37 | Use `sources.customize` to filter or rename the waste types:
38 |
39 | ```yaml
40 | waste_collection_schedule:
41 | sources:
42 | - name: kwb_goslar_de
43 | args:
44 | pois: 2523.409 # Braunschweiger Straße (Seesen)
45 | calendar_title: Abfuhrtermine - Braunschweiger Straße (Seesen)
46 | customize:
47 | # rename types to shorter name
48 | - type: Restmülltonne
49 | alias: Restmüll
50 |
51 | # hide unwanted types
52 | - type: Baum- und Strauchschnitt
53 | show: false
54 | ```
55 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/kwb_goslar_de.py:
--------------------------------------------------------------------------------
1 | import requests
2 | from waste_collection_schedule import Collection
3 | from waste_collection_schedule.service.ICS import ICS
4 |
5 | TITLE = "KreisWirtschaftsBetriebe Goslar"
6 | DESCRIPTION = "Source for kwb-goslar.de waste collection."
7 | URL = "https://www.kwb-goslar.de/Abfallwirtschaft/Abfuhr/"
8 | TEST_CASES = {
9 | "Berliner Straße (Clausthal-Zellerfeld)": {"pois": "2523.602"},
10 | "Braunschweiger Straße (Seesen)": {"pois": "2523.409"},
11 | }
12 |
13 | ICON_MAP = {
14 | "Baum- und Strauchschnitt": "mdi:leaf",
15 | "Biotonne": "mdi:bio",
16 | "Blaue Tonne": "mdi:newspaper-variant-multiple",
17 | "Gelber Sack": "mdi:recycle",
18 | "Restmülltonne": "mdi:trash-can",
19 | "Weihnachtsbäume": "mdi:pine-tree",
20 | }
21 |
22 |
23 | class Source:
24 | def __init__(self, pois):
25 | self.ics = ICS()
26 | self.pois = pois
27 |
28 | def fetch(self):
29 | r = requests.get(
30 | url="https://www.kwb-goslar.de/output/options.php",
31 | params={
32 | "ModID": "48",
33 | "call": "ical",
34 | "pois": self.pois,
35 | },
36 | headers={
37 | "Referer": "https://www.kwb-goslar.de",
38 | },
39 | )
40 |
41 | if not r.ok:
42 | raise Exception(f"Error: failed to fetch url: {r.request.url}")
43 |
44 | dates = self.ics.convert(r.text)
45 |
46 | entries = []
47 | for d in dates:
48 | date, waste_type = d
49 | icon = ICON_MAP.get(waste_type, "mdi:trash-can-outline")
50 | entries.append(Collection(date=date, t=waste_type, icon=icon))
51 |
52 | return entries
53 |
--------------------------------------------------------------------------------
/doc/source/infeo_at.md:
--------------------------------------------------------------------------------
1 | # INFEO based services
2 |
3 | INFEO is a platform for waste schedules, which has several German, Austrian and Swiss cities and districts as customers. The homepage of the company is https://www.infeo.at/.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: infeo_at
11 | args:
12 | customer: CUSTOMER
13 | zone: ZONE
14 | ```
15 |
16 | ### Configuration Variables
17 |
18 | **customer**
19 | *(string) (required)*
20 |
21 | **zone**
22 | *(string) (required)*
23 |
24 | ## Example
25 |
26 | ```yaml
27 | waste_collection_schedule:
28 | sources:
29 | - name: infeo_at
30 | args:
31 | customer: bogenschütz
32 | zone: "Rottenburg (Bezirk 2; Baisingen; Ergenzingen)"
33 | ```
34 |
35 | ## How to get the source arguments
36 |
37 | ### customer
38 |
39 | Approved list of customers (2022-11-13):
40 |
41 | - `bogenschütz`: Bogenschuetz-Entsorgung.de
42 |
43 | If your provider is also using infeo.at you can just try to use the name of your provider as customer. If you have any troubles please file an issue [here](https://github.com/mampfes/hacs_waste_collection_schedule/issues/new) and mention `@dm82m`.
44 |
45 | ### zone
46 |
47 | #### Bogenschuetz-Entsorgung.de
48 | - Go to your calendar at `https://www.bogenschuetz-entsorgung.de/images/wastecal/index-zone.html`.
49 | - Leave the year as it is and select the zone of your choice.
50 | - Copy the whole zone name and put it into `zone` of your configuration.
51 |
52 | ### city, street, house number
53 |
54 | This is currently not implemented, as it is not needed for customer `bogenschütz`. If you need it, don't hesitate to file an issue [here](https://github.com/mampfes/hacs_waste_collection_schedule/issues/new) and mention `@dm82m`.
55 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/c_trace_de.py:
--------------------------------------------------------------------------------
1 | import requests
2 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
3 | from waste_collection_schedule.service.ICS import ICS
4 |
5 | TITLE = "C-Trace.de"
6 | DESCRIPTION = "Source for C-Trace.de."
7 | URL = "https://c-trace.de/"
8 | TEST_CASES = {"Bremen": {"ort": "Bremen", "strasse": "Abbentorstraße", "hausnummer": 5}}
9 |
10 |
11 | BASE_URL = "https://web.c-trace.de"
12 | SERVICE_MAP = {"Bremen": "bremenabfallkalender"}
13 |
14 |
15 | class Source:
16 | def __init__(self, ort, strasse, hausnummer):
17 | self._ort = ort
18 | self._strasse = strasse
19 | self._hausnummer = hausnummer
20 | self._ics = ICS(regex=r"Abfuhr: (.*)")
21 |
22 | def fetch(self):
23 | service = SERVICE_MAP.get(self._ort)
24 | if service is None:
25 | raise Exception(f"no service for {self._ort}")
26 |
27 | session = requests.session()
28 |
29 | # get session url
30 | r = session.get(f"{BASE_URL}/{service}/Abfallkalender", allow_redirects=False,)
31 | session_id = r.headers["location"].split("/")[
32 | 2
33 | ] # session_id like "(S(r3bme50igdgsp2lstgxxhvs2))"
34 |
35 | args = {
36 | "Gemeinde": self._ort,
37 | "Strasse": self._strasse,
38 | "Hausnr": self._hausnummer,
39 | }
40 | r = session.get(
41 | f"{BASE_URL}/{service}/{session_id}/abfallkalender/cal", params=args
42 | )
43 | r.raise_for_status()
44 |
45 | # parse ics file
46 | r.encoding = "utf-8"
47 | dates = self._ics.convert(r.text)
48 |
49 | entries = []
50 | for d in dates:
51 | entries.append(Collection(d[0], d[1]))
52 | return entries
53 |
--------------------------------------------------------------------------------
/doc/source/grafikai_svara_lt.md:
--------------------------------------------------------------------------------
1 | # Kauno švara
2 |
3 | Support for schedules provided by [Kauno švara](https://svara.lt).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: grafikai_svara_lt
11 | args:
12 | region: CITY
13 | street: STREET_NAME
14 | house_number: HOUSE_NUMBER
15 | district: DISTRICT
16 | waste_object_ids:
17 | - WASTE_OBJECT_ID
18 | ```
19 |
20 | ### Configuration Variables
21 |
22 | **region**
23 | *(string) (required)*
24 |
25 | **street**
26 | *(string) (required)*
27 |
28 | **house_number**
29 | *(string) (required)*
30 |
31 | **district**
32 | *(string) (optional)*
33 |
34 | **waste_object_ids**
35 | *(list) (optional)*
36 |
37 | ## Example
38 |
39 | ```yaml
40 | waste_collection_schedule:
41 | sources:
42 | - name: grafikai_svara_lt
43 | args:
44 | region: Kauno m. sav.
45 | street: Demokratų g.
46 | house_number: 7
47 | district: DISTRICT
48 | waste_object_ids:
49 | - 101358
50 | - 100858
51 | - 100860
52 | ```
53 |
54 | ## How to get the source arguments
55 |
56 | Visit the [Grafikai](http://grafikai.svara.lt) page and search for your address. The arguments should exactly match the following table below. To include waste object id's at search results page, copy url from "Atsisiųsti" button and take "wasteObjectId" parameter.
57 |
58 | | Parameter name in grafikai.svara.lt | Argument in yaml |
59 | |-------------------------------------|------------------|
60 | | Regionas | region |
61 | | Gatvė | street |
62 | | Namo nr. | house_number |
63 | | Seniūnija | district |
64 |
--------------------------------------------------------------------------------
/doc/source/warszawa19115_pl.md:
--------------------------------------------------------------------------------
1 | # Warszawa19115
2 |
3 | Support for schedules provided by [Warszawa19115](https://warszawa19115.pl/harmonogramy-wywozu-odpadow).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: warszawa19115_pl
11 | args:
12 | street_address: STREET_ADDRESS
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **street_address**
18 | *(string) (optional)*
19 |
20 | **geolocation_id**
21 | *(string) (optional)*
22 |
23 | At least one argument must be provided.
24 |
25 | ## Example
26 |
27 | ```yaml
28 | waste_collection_schedule:
29 | sources:
30 | - name: warszawa19115_pl
31 | args:
32 | street_address: MARSZAŁKOWSKA 84/92, 00-514 Śródmieście
33 | ```
34 |
35 | ```yaml
36 | waste_collection_schedule:
37 | sources:
38 | - name: warszawa19115_pl
39 | args:
40 | geolocation_id: 76802934
41 | ```
42 |
43 | ## How to get the source arguments
44 |
45 | Visit the [Warszawa19115 - Harmonogram odbioru odpadów](https://warszawa19115.pl/harmonogramy-wywozu-odpadow) page and search for your address. The ```street_address``` argument should exactly match the street address shown in the autocomplete result. For unlisted addresses use an adjacent listed address.
46 |
47 | The ```geolocation_id``` argument can be used to bypass the initial address lookup on first use. This value can be discovered using the developer console in any modern browser and inspecting the request sent once an address is selected and the search button is clicked. The request URL takes the format: ```https://warszawa19115.pl/harmonogramy-wywozu-odpadow?p_p_id=portalCKMjunkschedules_WAR_portalCKMjunkschedulesportlet_INSTANCE_o5AIb2mimbRJ&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_resource_id=ajaxResourceURL&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=1```.
48 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/sysav_se.py:
--------------------------------------------------------------------------------
1 | import json
2 | from datetime import datetime
3 |
4 | import requests
5 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
6 |
7 | TITLE = "Sysav Sophämntning"
8 | DESCRIPTION = "Source for Sysav waste collection."
9 | URL = "https://www.sysav.se/Privat/min-sophamtning/"
10 | TEST_CASES = {
11 | "Home": {"street_address": "Sommargatan 1, Svedala"},
12 | "Polisen": {"street_address": "Stationsplan 1, Svedala"},
13 | }
14 |
15 |
16 | class Source:
17 | def __init__(self, street_address):
18 | self._street_address = street_address
19 |
20 | def fetch(self):
21 | params = {"address": self._street_address}
22 | response = requests.get(
23 | "https://www.sysav.se/api/my-pages/PickupSchedule/findAddress",
24 | params=params,
25 | )
26 |
27 | address_data = json.loads(response.text)
28 | address = None
29 | if address_data and len(address_data) > 0:
30 | address = address_data[0]
31 |
32 | if not address:
33 | return []
34 |
35 | params = {"address": address}
36 | response = requests.get(
37 | "https://www.sysav.se/api/my-pages/PickupSchedule/ScheduleForAddress",
38 | params=params,
39 | )
40 |
41 | data = json.loads(response.text)
42 |
43 | entries = []
44 | for item in data:
45 | waste_type = item["WasteType"]
46 | icon = "mdi:trash-can"
47 | if waste_type == "Trädgårdsavfall":
48 | icon = "mdi:leaf"
49 | next_pickup = item["NextPickupDate"]
50 | next_pickup_date = datetime.fromisoformat(next_pickup).date()
51 | entries.append(Collection(date=next_pickup_date, t=waste_type, icon=icon))
52 |
53 | return entries
54 |
--------------------------------------------------------------------------------
/doc/source/banyule_vic_gov_au.md:
--------------------------------------------------------------------------------
1 | # Banyule City Council
2 |
3 | Support for schedules provided by [Banyule City Council](https://www.banyule.vic.gov.au/binday). This implementation is heavily based upon the Stonnington City Council parser, as both interfaces appear to use the same back-end.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: banyule_vic_gov_au
11 | args:
12 | street_address: STREET_ADDRESS
13 | ```
14 |
15 | ### Configuration Variables
16 |
17 | **street_address**
18 | *(string) (optional)*
19 |
20 | **geolocation_id**
21 | *(string) (optional)*
22 |
23 | At least one argument must be provided.
24 |
25 | ## Example
26 |
27 | ```yaml
28 | waste_collection_schedule:
29 | sources:
30 | - name: banyule_vic_gov_au
31 | args:
32 | street_address: 6 Mandall Avenue, IVANHOE
33 | ```
34 |
35 | ```yaml
36 | waste_collection_schedule:
37 | sources:
38 | - name: banyule_vic_gov_au
39 | args:
40 | geolocation_id: 4f7ebfca-1526-4363-8b87-df3103a10a87
41 | ```
42 |
43 | ## How to get the source arguments
44 |
45 | Visit the [Banyule City Council bin collection services](https://www.banyule.vic.gov.au/Waste-environment/Waste-recycling/Bin-collection-services) page and search for your address. The ```street_address``` argument should exactly match the street address shown in the autocomplete result. For unlisted addresses use an adjacent listed address.
46 |
47 | The ```geolocation_id``` argument can be used to bypass the initial address lookup on first use. This value can be discovered using the developer console in any modern browser and inspecting the request sent once an address is selected and the search button is clicked. The request URL takes the format: ```https://www.banyule.vic.gov.au/ocapi/Public/myarea/wasteservices?geolocationid=&ocsvclang=en-AU```.
48 |
--------------------------------------------------------------------------------
/doc/source/lewisham_gov_uk.md:
--------------------------------------------------------------------------------
1 | # London Borough of Lewisham
2 |
3 | Support for schedules provided by the [London Borough of Lewisham](https://lewisham.gov.uk/myservices/wasterecycle/your-bins/collection).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: lewisham_gov_uk
11 | args:
12 | uprn: UNIQUE_PROPERTY_REFERENCE_NUMBER
13 | post_code: POST_CODE
14 | name: HOUSE_NAME
15 | number: HOUSE_NUMBER
16 | ```
17 |
18 | ### Configuration Variables
19 |
20 | **uprn**
21 | *(string) (optional)*
22 |
23 | This is required if you do not supply any other options. (Using this removes the need to do an address look up web request)
24 |
25 | **name**
26 | *(string) (optional)*
27 |
28 | This is required if you supply a Postcode and do not have a house number.
29 |
30 | **number**
31 | *(string) (optional)*
32 |
33 | This is required if you supply a Postcode and have a house number.
34 |
35 | **post_code**
36 | *(string) (optional)*
37 |
38 | This is required if you do not supply a UPRN. Single space between 1st and 2nd part of postcode is optional.
39 |
40 | #### How to find your `UPRN`
41 | An easy way to discover your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.
42 | Otherwise you can inspect the web requests the Peterborough Council website makes when entering in your postcode and then selecting your address.
43 |
44 | ## Example using UPRN
45 | ```yaml
46 | waste_collection_schedule:
47 | sources:
48 | - name: lewisham_gov_uk
49 | args:
50 | uprn: 100021937156
51 | ```
52 |
53 | ## Example using Address lookup
54 | ```yaml
55 | waste_collection_schedule:
56 | sources:
57 | - name: lewisham_gov_uk
58 | args:
59 | post_code: SE231LB
60 | number: 23
61 | ```
62 |
--------------------------------------------------------------------------------
/doc/source/peterborough_gov_uk.md:
--------------------------------------------------------------------------------
1 | # Peterborough City Council
2 |
3 | Support for schedules provided by [Peterborough City Council](https://www.peterborough.gov.uk/residents/rubbish-and-recycling/bins).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: peterborough_gov_uk
11 | args:
12 | uprn: UNIQUE_PROPERTY_REFERENCE_NUMBER
13 | post_code: POST_CODE
14 | name: HOUSE_NAME
15 | number: HOUSE_NUMBER
16 | ```
17 |
18 | ### Configuration Variables
19 |
20 | **uprn**
21 | *(string) (optional)*
22 |
23 | This is required if you do not supply any other options. (Using this removes the need to do an address look up web request)
24 |
25 | **name**
26 | *(string) (optional)*
27 |
28 | This is required if you supply a Postcode and do not have a house number.
29 |
30 | **number**
31 | *(string) (optional)*
32 |
33 | This is required if you supply a Postcode and have a house number.
34 |
35 | **post_code**
36 | *(string) (optional)*
37 |
38 | This is required if you do not supply a UPRN. Single space between 1st and 2nd part of postcode is optional.
39 |
40 | #### How to find your `UPRN`
41 | An easy way to discover your Unique Property Reference Number (UPRN) is by going to https://www.findmyaddress.co.uk/ and entering in your address details.
42 | Otherwise you can inspect the web requests the Peterborough Council website makes when entering in your postcode and then selecting your address.
43 |
44 | ## Example using UPRN
45 | ```yaml
46 | waste_collection_schedule:
47 | sources:
48 | - name: peterborough_gov_uk
49 | args:
50 | uprn: 100090214774
51 | ```
52 |
53 | ## Example using Address lookup
54 | ```yaml
55 | waste_collection_schedule:
56 | sources:
57 | - name: peterborough_gov_uk
58 | args:
59 | post_code: PE57AX
60 | number: 1
61 | ```
62 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/wiltshire_gov_uk.py:
--------------------------------------------------------------------------------
1 | import requests
2 |
3 | from datetime import datetime
4 | from bs4 import BeautifulSoup
5 | from waste_collection_schedule import Collection
6 |
7 | TITLE = "Wiltshire Council, UK"
8 | DESCRIPTION = "Source for wiltshire.gov.uk services for Wiltshire Council"
9 | URL = "wiltshire.gov.uk"
10 | TEST_CASES = {
11 | "house_uprn": {"uprn": "100121085972", "postcode": "BA149QP"},
12 | }
13 | SEARCH_URLS = {
14 | "collection_search": "https://ilforms.wiltshire.gov.uk/wastecollectiondays/collectionlist"
15 | }
16 | COLLECTIONS = {"Household waste",
17 | "Mixed dry recycling (blue lidded bin)", # some addresses may not have a black box collection
18 | "Mixed dry recycling (blue lidded bin) and glass (black box or basket)"
19 | }
20 |
21 |
22 | class Source:
23 | def __init__(
24 | self, uprn=None, postcode=None, housenumberorname=None
25 | ): # argX correspond to the args dict in the source configuration
26 | self._uprn = uprn
27 | self._postcode = postcode
28 |
29 | def fetch(self):
30 | entries = []
31 | session = requests.Session()
32 | args = {
33 | "Postcode": self._postcode,
34 | "Uprn": self._uprn,
35 | }
36 | r = session.post(SEARCH_URLS["collection_search"], params=args)
37 | r.raise_for_status()
38 | soup = BeautifulSoup(r.text, 'html.parser')
39 | for collection in COLLECTIONS:
40 | for tag in soup.find_all(
41 | attrs={"data-original-title": collection}
42 | ):
43 |
44 | entries.append(
45 | Collection(
46 | datetime.strptime(
47 | tag['data-original-datetext'], "%A %d %B, %Y").date(),
48 | collection,
49 | )
50 | )
51 |
52 | return entries
53 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/awb_oldenburg_de.py:
--------------------------------------------------------------------------------
1 | import urllib
2 |
3 | import requests
4 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
5 | from waste_collection_schedule.service.ICS import ICS
6 |
7 | TITLE = "AWB Oldenburg"
8 | DESCRIPTION = "Source for 'Abfallwirtschaftsbetrieb Stadt Oldenburg (Oldb)'."
9 | URL = "https://services.oldenburg.de/index.php"
10 | TEST_CASES = {
11 | "Polizeiinspektion Oldenburg": {"street": "Friedhofsweg", "house_number": 30}
12 | }
13 |
14 |
15 | class Source:
16 | def __init__(self, street, house_number):
17 | self._street = street
18 | self._house_number = house_number
19 | self._ics = ICS(regex=r"(.*)\:\s*\!")
20 |
21 | def fetch(self):
22 |
23 | args = {
24 | "id": 430,
25 | "tx_citkoabfall_abfallkalender[strasse]": str(self._street).encode("utf-8"),
26 | "tx_citkoabfall_abfallkalender[hausnummer]": str(self._house_number).encode(
27 | "utf-8"
28 | ),
29 | "tx_citkoabfall_abfallkalender[abfallarten][0]": 61,
30 | "tx_citkoabfall_abfallkalender[abfallarten][1]": 60,
31 | "tx_citkoabfall_abfallkalender[abfallarten][2]": 59,
32 | "tx_citkoabfall_abfallkalender[abfallarten][3]": 58,
33 | "tx_citkoabfall_abfallkalender[action]": "ics",
34 | "tx_citkoabfall_abfallkalender[controller]": "FrontendIcs",
35 | }
36 |
37 | # use '%20' instead of '+' in URL
38 | # https://stackoverflow.com/questions/21823965/use-20-instead-of-for-space-in-python-query-parameters
39 | args = urllib.parse.urlencode(args, quote_via=urllib.parse.quote)
40 |
41 | # post request
42 | r = requests.get(URL, params=args)
43 |
44 | dates = self._ics.convert(r.text)
45 |
46 | entries = []
47 | for d in dates:
48 | entries.append(Collection(d[0], d[1]))
49 | return entries
50 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/awb_es_de.py:
--------------------------------------------------------------------------------
1 | import requests
2 | from bs4 import BeautifulSoup
3 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
4 | from waste_collection_schedule.service.ICS import ICS
5 |
6 | TITLE = "Abfallwirtschaftsbetrieb Esslingen"
7 | DESCRIPTION = "Source for AWB Esslingen, Germany"
8 | URL = "https://www.awb-es.de"
9 |
10 | TEST_CASES = {
11 | "Aichwald": {"city": "Aichwald", "street": "Alte Dorfstrasse"},
12 | "Kohlberg": {"city": "Kohlberg", "street": "alle Straßen"},
13 | }
14 |
15 | HEADERS = {"user-agent": "Mozilla/5.0 (xxxx Windows NT 10.0; Win64; x64)"}
16 |
17 |
18 | class Source:
19 | def __init__(self, city, street=None):
20 | self._city = city
21 | self._street = street
22 | self._ics = ICS()
23 |
24 | def fetch(self):
25 | session = requests.Session()
26 |
27 | params = {
28 | "city": self._city,
29 | "street": self._street,
30 | "direct": "true",
31 | }
32 | r = session.get(
33 | "https://www.awb-es.de/abfuhr/abfuhrtermine/__Abfuhrtermine.html",
34 | params=params,
35 | )
36 | r.raise_for_status()
37 |
38 | soup = BeautifulSoup(r.text, features="html.parser")
39 | downloads = soup.find_all("a", href=True)
40 | ics_url = None
41 | for download in downloads:
42 | href = download.get("href")
43 | if "t=ics" in href:
44 | ics_url = href
45 | break
46 |
47 | if ics_url is None:
48 | raise Exception(f"ics url not found")
49 |
50 | # get ics file
51 | r = session.get(ics_url, headers=HEADERS)
52 | r.raise_for_status()
53 |
54 | # parse ics file
55 | dates = self._ics.convert(r.text)
56 |
57 | entries = []
58 | for d in dates:
59 | entries.append(Collection(d[0], d[1]))
60 | return entries
61 |
--------------------------------------------------------------------------------
/doc/source/egn_abfallkalender_de.md:
--------------------------------------------------------------------------------
1 | # EGN - Abfallkalender
2 |
3 | Support for schedules provided by [egn-abfallkalender.de](https://www.egn-abfallkalender.de/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: egn_abfallkalender_de
11 | args:
12 | city: CITY_NAME
13 | district: DISTRICT_NAME
14 | street: STREET_NAME
15 | housenumber: HOUSE_NUMBER
16 | ```
17 |
18 | The arguments can be found above the calendar after generating one [here](https://www.egn-abfallkalender.de/kalender#skill-setup-form). Select your city, street and enter your housenumber to show the schedule for your address. The complete information you need are displayed above the calendar view in the format `für , ()`. See also examples below.
19 |
20 | ### Configuration Variables
21 |
22 | **city**
23 | *(string) (required)*
24 | City, extracted from the displayed address.
25 |
26 | **district**
27 | *(string) (required)*
28 | District, extracted from the displayed address.
29 |
30 | **street**
31 | *(string) (required)*
32 | Street, extracted from the displayed address.
33 |
34 | **housenumber**
35 | *(string) (required)*
36 | Housenumber, extracted from the displayed address.
37 |
38 | ## Examples
39 |
40 | ```yaml
41 | # Displayed address:
42 | # für Albert-Schweitzer-Weg 27, Grevenbroich (Stadtmitte)
43 |
44 | waste_collection_schedule:
45 | sources:
46 | - name: egn_abfallkalender_de
47 | args:
48 | city: Grevenbroich
49 | district: Stadtmitte
50 | street: Albert-Schweitzer-Weg
51 | housenumber: 27
52 | ```
53 |
54 | ```yaml
55 | # Displayed address:
56 | # für Am Damschenpfad 81, Dormagen (Nievenheim)
57 |
58 | waste_collection_schedule:
59 | sources:
60 | - name: egn_abfallkalender_de
61 | args:
62 | city: Dormagen
63 | district: Nievenheim
64 | street: "Am Damschenpfad"
65 | housenumber: 81
66 | ```
67 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/vasyd_se.py:
--------------------------------------------------------------------------------
1 | import json
2 | from datetime import datetime
3 |
4 | import requests
5 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
6 |
7 | TITLE = "VA Syd Sophämntning"
8 | DESCRIPTION = "Source for VA Syd waste collection."
9 | URL = (
10 | "https://www.vasyd.se/Artiklar/Avfall-och-soptomning-privat/sopt%C3%B6mning-schema/"
11 | )
12 | TEST_CASES = {
13 | "Home": {"street_address": "Industrigatan 13, Malmö"},
14 | "Polisen": {"street_address": "Drottninggatan 20, Malmö"},
15 | }
16 |
17 |
18 | class Source:
19 | def __init__(self, street_address):
20 | self._street_address = street_address
21 |
22 | def fetch(self):
23 | data = {"query": self._street_address}
24 | response = requests.post(
25 | "https://www.vasyd.se/api/sitecore/MyPagesApi/BuildingAddressSearch",
26 | data=data,
27 | )
28 |
29 | building_data = json.loads(response.text)["items"]
30 | building_id = None
31 | if building_data and len(building_data) > 0:
32 | building_id = building_data[0]["id"]
33 |
34 | if not building_id:
35 | return []
36 |
37 | data = {"query": building_id, "street": self._street_address}
38 | response = requests.post(
39 | "https://www.vasyd.se/api/sitecore/MyPagesApi/WastePickupByAddress",
40 | data=data,
41 | )
42 |
43 | data = json.loads(response.text)["items"]
44 |
45 | entries = []
46 | for item in data:
47 | waste_type = item["wasteType"]
48 | icon = "mdi:trash-can"
49 | if waste_type == "Trädgårdsavfall":
50 | icon = "mdi:leaf"
51 | next_pickup = item["nextWastePickup"]
52 | next_pickup_date = datetime.fromisoformat(next_pickup).date()
53 | entries.append(Collection(date=next_pickup_date, t=waste_type, icon=icon))
54 |
55 | return entries
56 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/lindau_ch.py:
--------------------------------------------------------------------------------
1 | import json
2 | from datetime import datetime
3 |
4 | import requests
5 | from bs4 import BeautifulSoup
6 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
7 |
8 | TITLE = "Abfall Lindau"
9 | DESCRIPTION = "Source for Lindau waste collection."
10 | URL = "https://www.lindau.ch/abfalldaten"
11 | TEST_CASES = {
12 | "Tagelswangen": {"city": "Tagelswangen"},
13 | "Grafstal": {"city": "190"},
14 | }
15 |
16 |
17 | IconMap = {
18 | "kehricht": "mdi:trash-can",
19 | "grungut": "mdi:leaf",
20 | "hackseldienst": "mdi:leaf",
21 | "papier und karton": "mdi:package-variant",
22 | "altmetalle": "mdi:nail",
23 | }
24 |
25 |
26 | class Source:
27 | def __init__(self, city):
28 | self._city = city
29 |
30 | def fetch(self):
31 | response = requests.get("https://www.lindau.ch/abfalldaten")
32 |
33 | html = BeautifulSoup(response.text, "html.parser")
34 |
35 | table = html.find("table", attrs={"id": "icmsTable-abfallsammlung"})
36 | data = json.loads(table.attrs["data-entities"])
37 |
38 | entries = []
39 | for item in data["data"]:
40 | if (
41 | self._city in item["abfallkreisIds"]
42 | or self._city in item["abfallkreisNameList"]
43 | ):
44 | next_pickup = item["_anlassDate-sort"].split()[0]
45 | next_pickup_date = datetime.fromisoformat(next_pickup).date()
46 |
47 | waste_type = BeautifulSoup(item["name"], "html.parser").text
48 | waste_type_sorted = BeautifulSoup(item["name-sort"], "html.parser").text
49 |
50 | entries.append(
51 | Collection(
52 | date=next_pickup_date,
53 | t=waste_type,
54 | icon=IconMap.get(waste_type_sorted, "mdi:trash-can"),
55 | )
56 | )
57 |
58 | return entries
59 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/stadtreinigung_leipzig_de.py:
--------------------------------------------------------------------------------
1 | import json
2 | import logging
3 |
4 | import requests
5 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
6 | from waste_collection_schedule.service.ICS import ICS
7 |
8 | _LOGGER = logging.getLogger(__name__)
9 |
10 | TITLE = "Stadtreinigung Leipzig"
11 | DESCRIPTION = "Source for Stadtreinigung Leipzig."
12 | URL = "https://stadtreinigung-leipzig.de"
13 | TEST_CASES = {"Bahnhofsallee": {"street": "Bahnhofsallee", "house_number": 7}}
14 |
15 |
16 | class Source:
17 | def __init__(self, street, house_number):
18 | self._street = street
19 | self._house_number = house_number
20 | self._ics = ICS()
21 |
22 | def fetch(self):
23 | params = {
24 | "name": self._street,
25 | }
26 |
27 | # get list of streets and house numbers
28 | r = requests.get(
29 | "https://stadtreinigung-leipzig.de/rest/wastecalendarstreets", params=params
30 | )
31 |
32 | data = json.loads(r.text)
33 | if len(data["results"]) == 0:
34 | _LOGGER.error(f"street not found: {self._street}")
35 | return []
36 | street_entry = data["results"].get(self._street)
37 | if street_entry is None:
38 | _LOGGER.error(f"street not found: {self._street}")
39 | return []
40 |
41 | id = street_entry.get(str(self._house_number))
42 | if id is None:
43 | _LOGGER.error(f"house_number not found: {self._house_number}")
44 | return []
45 |
46 | # get ics file
47 | params = {
48 | "position_nos": id,
49 | }
50 | r = requests.get(
51 | "https://stadtreinigung-leipzig.de/wir-kommen-zu-ihnen/abfallkalender/ical.ics",
52 | params=params,
53 | )
54 | dates = self._ics.convert(r.text)
55 |
56 | entries = []
57 | for d in dates:
58 | entries.append(Collection(d[0], d[1].removesuffix(", ")))
59 | return entries
60 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/awbkoeln_de.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | import json
4 |
5 | import inquirer
6 | import requests
7 |
8 |
9 | def main():
10 | questions = [
11 | inquirer.Text("street_name", message="Enter search string for street"),
12 | inquirer.Text(
13 | "building_number", message="Enter search string for house number"
14 | ),
15 | ]
16 | answers = inquirer.prompt(questions)
17 |
18 | args = answers
19 | args["form"] = "json"
20 | r = requests.get("https://www.awbkoeln.de/api/streets", params=args)
21 |
22 | # "data":[{"street_name":"Bahnhofplatz","building_number":"5","building_number_plain":"5","building_number_addition":"","street_code":"4270",
23 | # "district":"Gremberghoven","zipcode":"51149","district_code":"4","area_code":"7","user_street_name":"Bahnhofplatz","user_building_number":"1"}
24 | data = json.loads(r.text)
25 | if len(data["data"]) == 0:
26 | print("no matching address found")
27 | return
28 |
29 | choices = []
30 | for d in data["data"]:
31 | value = {
32 | "street_code": d["street_code"],
33 | "building_number": d["building_number"],
34 | }
35 | choices.append(
36 | (
37 | f"{d['user_street_name']} {d['user_building_number']}, {d['zipcode']} Köln - {d['district']}",
38 | value,
39 | )
40 | )
41 |
42 | questions = [inquirer.List("data", choices=choices, message="Select address")]
43 | answers = inquirer.prompt(questions)
44 |
45 | print("Copy the following statements into your configuration.yaml:\n")
46 | print("# waste_collection_schedule source configuration")
47 | print("waste_collection_schedule:")
48 | print(" sources:")
49 | print(" - name: awbkoeln_de")
50 | print(" args:")
51 | print(f" street_code: {answers['data']['street_code']}")
52 | print(f" building_number: {answers['data']['building_number']}")
53 |
54 |
55 | if __name__ == "__main__":
56 | main()
57 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/landkreis_rhoen_grabfeld.py:
--------------------------------------------------------------------------------
1 | import datetime
2 |
3 | import requests
4 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
5 |
6 | TITLE = "Source for Rhön Grabfeld"
7 | DESCRIPTION = "Source for Rhönn Grabfeld uses service by offizium."
8 | URL = 'https://fs-api-rg.offizium.com/abfalltermine'
9 | ICON_MAP = {
10 | "Restmüll/Gelber Sack/Biotonne": "mdi:trash-can",
11 | "Papiersammlung": "mdi:package-variant",
12 | "Problemmüllsammlung": "mdi:biohazard"
13 | }
14 | EVENT_BLACKLIST = ['Wertstoffhof Mellrichstadt',
15 | 'Wertstoffhof Bad Königshofen', 'Wertstoffzentrum Bad Neustadt',
16 | 'Wertstoffsammelstelle Ostheim',
17 | 'Wertstoffsammelstelle Bischofsheim']
18 | TEST_CASES = {
19 | "City only": {"city": "Ostheim"},
20 | "City + District": {"city": "Ostheim", "district": "Oberwaldbehrungen"},
21 | "District only": {"district": "Oberwaldbehrungen"},
22 | "empty": {}
23 | }
24 |
25 |
26 | class Source:
27 | def __init__(self, city: str = None, district: str = None):
28 | self._city = city
29 | self._district = district
30 |
31 | def fetch(self):
32 | now = datetime.datetime.now().date()
33 |
34 | r = requests.get(URL, params={
35 | "stadt": self._city,
36 | "ortsteil": self._district
37 | })
38 |
39 | r.raise_for_status()
40 |
41 | entries = []
42 | for event in r.json():
43 | # filter out Sammelstellen, Wertstoffhof and Wertstoffzentrum
44 | if event["muellart"] not in EVENT_BLACKLIST:
45 | entries.append(
46 | Collection(
47 | date=datetime.datetime.fromisoformat(
48 | event["termin"]).date(),
49 | t=event["muellart"],
50 | icon=ICON_MAP.get(
51 | event["muellart"], "mdi:trash-can")
52 | )
53 | )
54 |
55 | return entries
56 |
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | repos:
2 | - repo: https://github.com/asottile/pyupgrade
3 | rev: v2.32.1
4 | hooks:
5 | - id: pyupgrade
6 | args: [--py37-plus]
7 | - repo: https://github.com/psf/black
8 | rev: 22.3.0
9 | hooks:
10 | - id: black
11 | args:
12 | - --safe
13 | - --quiet
14 | files: ^((custom_components|script|tests)/.+)?[^/]+\.py$
15 | - repo: https://github.com/codespell-project/codespell
16 | rev: v2.1.0
17 | hooks:
18 | - id: codespell
19 | args:
20 | - --ignore-words-list=hass,alot,datas,dof,dur,farenheit,hist,iff,ines,ist,lightsensor,mut,nd,pres,referer,ser,serie,te,technik,ue,uint,visability,wan,wanna,withing, Adresse, termine, adresse
21 | - --skip="./.*,*.csv,*.json"
22 | - --quiet-level=2
23 | exclude_types: [csv, json]
24 | - repo: https://gitlab.com/pycqa/flake8
25 | rev: 3.9.2
26 | hooks:
27 | - id: flake8
28 | args:
29 | - --ignore=D100,D101,D102,D103,D104,D105,D107,E501,W503
30 | additional_dependencies:
31 | - flake8-docstrings==1.5.0
32 | - pydocstyle==5.0.2
33 | files: ^(custom_components|script|tests)/.+\.py$
34 | - repo: https://github.com/PyCQA/bandit
35 | rev: 1.7.4
36 | hooks:
37 | - id: bandit
38 | args:
39 | - --quiet
40 | - --format=custom
41 | - --configfile=tests/bandit.yaml
42 | files: ^(custom_components|script|tests)/.+\.py$
43 | - repo: https://github.com/pre-commit/mirrors-isort
44 | rev: v5.10.1
45 | hooks:
46 | - id: isort
47 | - repo: https://github.com/pre-commit/pre-commit-hooks
48 | rev: v4.2.0
49 | hooks:
50 | - id: check-executables-have-shebangs
51 | stages: [manual]
52 | - id: check-json
53 | - repo: https://github.com/pre-commit/mirrors-mypy
54 | rev: v0.960
55 | hooks:
56 | - id: mypy
57 | additional_dependencies: ["types-requests"]
58 | args:
59 | - --pretty
60 | - --show-error-codes
61 | - --show-error-context
62 | - --ignore-missing-imports
63 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/lerum_se.py:
--------------------------------------------------------------------------------
1 | # coding: utf-8
2 | from datetime import datetime
3 | import json
4 | from urllib.parse import urlencode
5 |
6 | import requests
7 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
8 |
9 | TITLE = "Lerum Vatten och Avlopp"
10 | DESCRIPTION = "Source for Lerum Vatten och Avlopp waste collection."
11 | URL = "https://vatjanst.lerum.se/FutureWeb/SimpleWastePickup/SimpleWastePickup"
12 | TEST_CASES = {
13 | "PRO": {"street_address": "Floda stationsväg 5, Floda"},
14 | "Polisen": {"street_address": "Göteborgsvägen 16, Lerum"},
15 | }
16 |
17 |
18 | class Source:
19 | def __init__(self, street_address):
20 | self._street_address = street_address
21 |
22 | def fetch(self):
23 | response = requests.post(
24 | "https://vatjanst.lerum.se/FutureWeb/SimpleWastePickup/SearchAdress",
25 | {"searchText": self._street_address}
26 | )
27 |
28 | address_data = json.loads(response.text)
29 | address = None
30 | if address_data["Succeeded"] and address_data["Succeeded"] is True:
31 | if address_data["Buildings"] and len(address_data["Buildings"]) > 0:
32 | address = address_data["Buildings"][0]
33 |
34 | if not address:
35 | return []
36 |
37 | query_params = urlencode({"address": address})
38 | response = requests.get(
39 | "https://vatjanst.lerum.se/FutureWeb/SimpleWastePickup/GetWastePickupSchedule?{}"
40 | .format(query_params)
41 | )
42 | data = json.loads(response.text)
43 |
44 | entries = []
45 | for item in data["RhServices"]:
46 | waste_type = item["WasteType"]
47 | icon = "mdi:trash-can"
48 | if waste_type == "Matavfall":
49 | icon = "mdi:leaf"
50 | next_pickup = item["NextWastePickup"]
51 | next_pickup_date = datetime.fromisoformat(next_pickup).date()
52 | entries.append(
53 | Collection(date=next_pickup_date, t=waste_type, icon=icon)
54 | )
55 |
56 | return entries
57 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/republicservices_com.py:
--------------------------------------------------------------------------------
1 | import requests
2 | import json
3 |
4 | from datetime import datetime
5 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
6 |
7 | TITLE = "Republic Services"
8 | DESCRIPTION = "Source for Republic Services Collection."
9 | URL = "https://www.republicservices.com"
10 | TEST_CASES = {
11 | "Scott Country Clerk": {"street_address": "101 E Main St, Georgetown, KY 40324"},
12 | "Branch County Clerk": {"street_address": "31 Division St. Coldwater, MI 49036"}
13 | }
14 |
15 |
16 | class Source:
17 | def __init__(self, street_address):
18 | self._street_address = street_address
19 |
20 | def fetch(self):
21 | response1 = requests.get(
22 | "https://www.republicservices.com/api/v1/addresses",
23 | params={"addressLine1": self._street_address},
24 | )
25 |
26 | address_hash = json.loads(response1.text)["data"][0]["addressHash"]
27 |
28 | response2 = requests.get(
29 | "https://www.republicservices.com/api/v1/publicPickup",
30 | params={"siteAddressHash": address_hash},
31 | )
32 |
33 | r_json = json.loads(response2.text)["data"]
34 |
35 | entries = []
36 |
37 | for x in r_json:
38 | if hasattr(r_json[x], "__iter__"):
39 | for item in r_json[x]:
40 | waste_type = item["wasteTypeDescription"]
41 | container_type = item["containerType"]
42 | icon = "mdi:trash-can"
43 | if waste_type == "Recycle":
44 | icon = "mdi:recycle"
45 | if container_type == "YC":
46 | waste_type = "Yard Waste"
47 | icon = "mdi:sprout"
48 | for day in item["nextServiceDays"]:
49 | next_pickup = day
50 | next_pickup_date = datetime.fromisoformat(next_pickup).date()
51 | entries.append(Collection(date=next_pickup_date, t=waste_type, icon=icon))
52 |
53 | return entries
54 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/ccc_govt_nz.py:
--------------------------------------------------------------------------------
1 | import datetime
2 |
3 | import requests
4 | from waste_collection_schedule import Collection
5 |
6 | TITLE = "Christchurch City Council"
7 | DESCRIPTION = "Source for Christchurch City Council."
8 | URL = "https://ccc.govt.nz/services/rubbish-and-recycling/collections"
9 | TEST_CASES = {"53 Hereford Street": {"address": "53 Hereford Street"}}
10 |
11 |
12 | class Source:
13 | def __init__(self, address):
14 | self._address = address
15 |
16 | def fetch(self):
17 | entries = []
18 |
19 | # Find the Rating Unit ID by the physical address
20 | # While a property may have more than one address, bins are allocated by each Rating Unit
21 | addressQuery = {
22 | "q": self._address,
23 | "status": "current",
24 | "crs": "epsg:4326",
25 | "limit": 1,
26 | }
27 | r = requests.get(
28 | "https://opendata.ccc.govt.nz/CCCSearch/rest/address/suggest",
29 | params=addressQuery,
30 | )
31 | address = r.json()
32 |
33 | # Find the Bin service by Rating Unit ID
34 | binsHeaders = {
35 | "client_id": "69f433c880c74c349b0128e9fa1b6a93",
36 | "client_secret": "139F3D2A83E34AdF98c80566f2eb7212"
37 | }
38 | r = requests.get(
39 | "https://ccc-data-citizen-api-v1-prod.au-s1.cloudhub.io/api/v1/properties/" + str(address[0]["RatingUnitID"]),
40 | headers=binsHeaders
41 | )
42 | bins = r.json()
43 |
44 | # Deduplicate the Bins in case the Rating Unit has more than one of the same Bin type
45 | bins = {each["material"]: each for each in bins["bins"]["collections"]}.values()
46 |
47 | # Process each Bin
48 | for bin in bins:
49 | entries.append(
50 | Collection(
51 | datetime.datetime.strptime(
52 | bin["next_planned_date_app"], "%Y-%m-%d"
53 | ).date(),
54 | bin["material"],
55 | )
56 | )
57 |
58 | return entries
59 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/hygea_be.py:
--------------------------------------------------------------------------------
1 | import datetime
2 | import json
3 | import time
4 |
5 | import requests
6 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
7 |
8 | TITLE = "Hygea"
9 | DESCRIPTION = "Source for Hygea garbage collection"
10 | URL = "https://www.hygea.be/"
11 | TEST_CASES = {
12 | "Soignies": {"streetIndex": "3758"},
13 | "Frameries": {"streetIndex": "4203"},
14 | "Erquelinnes": {"cp": "6560"},
15 | }
16 |
17 | WASTE_MAP = {
18 | "om": {"type": "Ordures ménagères", "icon": "mdi:trash-can"},
19 | "pmc": {"type": "PMC", "icon": "mdi:recycle"},
20 | "sacvert": {"type": "Déchets Organiques", "icon": "mdi:trash-can"},
21 | "fourth": {"type": "Papier & cartons", "icon": "mdi:leaf"},
22 | }
23 |
24 |
25 | class Source:
26 | def __init__(self, streetIndex=None, cp=None):
27 | self._street_index = streetIndex
28 | self._cp = cp
29 |
30 | def fetch(self):
31 | params = {"start": int(time.time()), "end": int(time.time() + 2678400)}
32 | if self._street_index is not None:
33 | params["street"] = self._street_index
34 | response = requests.get(
35 | "https://www.hygea.be/displaycal.html", params=params
36 | )
37 | elif self._cp is not None:
38 | params["street"] = self._cp
39 | response = requests.get(
40 | "https://www.hygea.be/displaycalws.html", params=params
41 | )
42 |
43 | if not response.ok:
44 | return []
45 | data = json.loads(response.text)
46 |
47 | entries = []
48 | for day in data:
49 | date = datetime.datetime.strptime(
50 | day["start"], "%Y-%m-%dT%H:%M:%S%z"
51 | ).date()
52 |
53 | # example for day["className"]: 12 notadded pos136 om multi
54 | waste_types = set(day["className"].split())
55 | for abbr, map in WASTE_MAP.items():
56 | if abbr in waste_types:
57 | c = Collection(date=date, t=map["type"], icon=map["icon"])
58 | entries.append(c)
59 |
60 | return entries
61 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/collection.py:
--------------------------------------------------------------------------------
1 | import datetime
2 |
3 |
4 | class CollectionBase(dict): # inherit from dict to enable JSON serialization
5 | def __init__(self, date: datetime.date, icon: str = None, picture: str = None):
6 | dict.__init__(self, date=date.isoformat(), icon=icon, picture=picture)
7 | self._date = date # store date also as python date object
8 |
9 | @property
10 | def date(self):
11 | return self._date
12 |
13 | @property
14 | def daysTo(self):
15 | return (self._date - datetime.datetime.now().date()).days
16 |
17 | @property
18 | def icon(self):
19 | return self["icon"]
20 |
21 | def set_icon(self, icon: str):
22 | self["icon"] = icon
23 |
24 | @property
25 | def picture(self):
26 | return self["picture"]
27 |
28 | def set_picture(self, picture: str):
29 | self["picture"] = picture
30 |
31 |
32 | class Collection(CollectionBase):
33 | def __init__(
34 | self, date: datetime.date, t: str, icon: str = None, picture: str = None
35 | ):
36 | CollectionBase.__init__(self, date=date, icon=icon, picture=picture)
37 | self["type"] = t
38 |
39 | @property
40 | def type(self):
41 | return self["type"]
42 |
43 | def set_type(self, t: str):
44 | self["type"] = t
45 |
46 | def __repr__(self):
47 | return f"Collection{{date={self.date}, type={self.type}}}"
48 |
49 |
50 | class CollectionGroup(CollectionBase):
51 | def __init__(self, date: datetime.date):
52 | CollectionBase.__init__(self, date=date)
53 |
54 | @staticmethod
55 | def create(group):
56 | """Create from list of Collection's."""
57 | x = CollectionGroup(group[0].date)
58 | if len(group) == 1:
59 | x.set_icon(group[0].icon)
60 | x.set_picture(group[0].picture)
61 | else:
62 | x.set_icon(f"mdi:numeric-{len(group)}-box-multiple")
63 | x["types"] = list(it.type for it in group)
64 | return x
65 |
66 | @property
67 | def types(self):
68 | return self["types"]
69 |
70 | def __repr__(self):
71 | return f"CollectionGroup{{date={self.date}, types={self.types}}}"
72 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/belmont_wa_gov_au.py:
--------------------------------------------------------------------------------
1 | import datetime
2 |
3 | import requests
4 | from waste_collection_schedule import Collection
5 |
6 | TITLE = "Belmont City Council"
7 | DESCRIPTION = "Source for Belmont City Council rubbish collection."
8 | URL = "https://www.belmont.wa.gov.au/"
9 | TEST_CASES = {
10 | "PETstock Belmont": {"address": "196 Abernethy Road Belmont 6104"},
11 | "Belgravia Medical Centre": {"address": "374 Belgravia Street Cloverdale 6105"},
12 | "IGA Rivervale": {"address": "126 Kooyong Road Rivervale 6103"},
13 | }
14 |
15 |
16 | class Source:
17 | def __init__(self, address: str):
18 | self._address = address
19 |
20 | def fetch(self):
21 | params = {"key": self._address}
22 | r = requests.get(
23 | "https://www.belmont.wa.gov.au/api/intramaps/getaddresses", params=params
24 | )
25 | r.raise_for_status()
26 | j = r.json()
27 |
28 | if len(j) == 0:
29 | raise Exception("address not found")
30 |
31 | if len(j) > 1:
32 | raise Exception("multiple addresses found")
33 |
34 | params = {"mapkey": j[0]["mapkey"], "dbkey": j[0]["dbkey"]}
35 | r = requests.get(
36 | "https://www.belmont.wa.gov.au/api/intramaps/getpropertydetailswithlocalgov",
37 | params=params,
38 | )
39 | r.raise_for_status()
40 | data = r.json()["data"]
41 |
42 | entries = []
43 |
44 | # get general waste
45 | date = datetime.datetime.strptime(
46 | data["BinDayGeneralWasteFormatted"], "%Y-%m-%dT%H:%M:%S"
47 | ).date()
48 | entries.append(
49 | Collection(
50 | date=date,
51 | t="General Waste",
52 | icon="mdi:trash-can",
53 | )
54 | )
55 |
56 | # get recycling
57 | date = datetime.datetime.strptime(
58 | data["BinDayRecyclingFormatted"], "%Y-%m-%dT%H:%M:%S"
59 | ).date()
60 | entries.append(
61 | Collection(
62 | date=date,
63 | t="Recycling",
64 | icon="mdi:recycle",
65 | )
66 | )
67 |
68 | return entries
69 |
--------------------------------------------------------------------------------
/doc/source/abfall_zollernalbkreis_de.md:
--------------------------------------------------------------------------------
1 | # Abfallwirtschaft Zollernalbkreis
2 |
3 | Support for schedules provided by [https://www.abfallkalender-zak.de/](https://www.abfallkalender-zak.de/).
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: abfall_zollernalbkreis_de
11 | args:
12 | city: CITY
13 | street: STREET
14 | types:
15 | - "restmuell"
16 | - "gelbersack"
17 | - "papiertonne"
18 | - "biomuell"
19 | - "gruenabfall"
20 | - "schadstoffsammlung"
21 | - "altpapiersammlung"
22 | - "schrottsammlung"
23 | - "weihnachtsbaeume"
24 | - "elektrosammlung"
25 | ```
26 |
27 | ### Configuration Variables
28 |
29 | **city**
30 | *(string) (required)*
31 |
32 | **street**
33 | *(integer) (optional)*
34 |
35 | **types**
36 | *(list of string) (required)*
37 |
38 | ## Example
39 |
40 | ```yaml
41 | waste_collection_schedule:
42 | sources:
43 | - name: abfall_zollernalbkreis_de
44 | args:
45 | city: "2,3,4"
46 | street: 3
47 | types:
48 | - "restmuell"
49 | - "gelbersack"
50 | - "papiertonne"
51 | - "biomuell"
52 | - "gruenabfall"
53 | - "schadstoffsammlung"
54 | - "altpapiersammlung"
55 | - "schrottsammlung"
56 | - "weihnachtsbaeume"
57 | - "elektrosammlung"
58 | ```
59 |
60 | ## How to get the source arguments
61 |
62 | ### Hardcore Variant: Extract arguments from website
63 |
64 | Another way get the source arguments is to extract the arguments from the website using a (desktop) browser with developer tools, e.g. Google Chrome:
65 |
66 | 1. Open [https://www.abfallkalender-zak.de/](https://www.abfallkalender-zak.de/).
67 | 2. Enter your data, but don't click on "ICS Download" so far!
68 | 3. Open the Developer Tools (Ctrl + Shift + I) and open the `Network` tab.
69 | 4. Now click the "ICS Download" button.
70 | 5. You should see (amongst other's) one POST entry to Host https://www.abfallkalender-zak.de/ labeled `/` in the network recording.
71 | 6. Select `/` on the left hand side and click on Request on the right hand side.
72 | 7. At the `Form Data` you can find the values for `city` and `street` etc..
73 |
--------------------------------------------------------------------------------
/doc/source/static.md:
--------------------------------------------------------------------------------
1 | # Static Source
2 |
3 | Support for schedules with static dates or recurrences.
4 |
5 | ## Configuration via configuration.yaml
6 |
7 | ```yaml
8 | waste_collection_schedule:
9 | sources:
10 | - name: static
11 | args:
12 | type: TYPE
13 | dates: DATES
14 | frequency: FREQUENCY
15 | interval: INTERVAL
16 | start: START
17 | until: UNTIL
18 | excludes: EXCLUDES
19 | ```
20 |
21 | ### Configuration Variables
22 |
23 | **TYPE**
24 | *(string) (required)*
25 |
26 | The type of this source.
27 |
28 | **DATES**
29 | *(list) (optional)*
30 |
31 | A list of dates in format "YYYY-MM-DD" which should be added to the source.
32 | Dates defined in this list will be added in addition to calculated dates from the recurrence and will not be affected by the exclude-list.
33 |
34 | **FREQUENCY**
35 | *(string) (optional)*
36 |
37 | Defines the frequency of the recurrence. Must be one of "DAILY", "WEEKLY", "MONTHLY" or "YEARLY".
38 |
39 | **INTERVAL**
40 | *(int) (optional, default: ```1```)*
41 |
42 | Defines the interval of the recurrence.
43 |
44 | **START**
45 | *(string) (optional)*
46 |
47 | Defines the start of the recurrence in the format "YYYY-MM-DD".
48 | Required if *FREQUENCY* is set.
49 |
50 | **UNTIL**
51 | *(string) (optional)*
52 |
53 | Defines the end of the recurrence in the format "YYYY-MM-DD".
54 | Required if *FREQUENCY* is set.
55 |
56 | **EXCLUDES**
57 | *(list) (optional)*
58 |
59 | A list of dates in format "YYYY-MM-DD" which should be excluded from the recurrence.
60 |
61 | ## Example
62 |
63 | This example defines a schedule, every 4 weeks starting on Friday, January 14, 2022 until the end of the year.
64 | Two days are removed from the schedule and two days are added instead, which are outside of the recurrence.
65 |
66 | ```yaml
67 | waste_collection_schedule:
68 | sources:
69 | - name: static
70 | calendar_title: Altpapier
71 | args:
72 | type: Altpapier
73 | frequency: WEEKLY
74 | interval: 4
75 | start: '2022-01-14'
76 | until: '2022-12-31'
77 | excludes: # Add exception for the recurrence
78 | - '2022-07-29'
79 | - '2022-09-23'
80 | dates: # Manually define dates that are not part of the recurrence
81 | - '2022-07-28'
82 | - '2022-09-22'
83 | ```
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/recyclesmart_com.py:
--------------------------------------------------------------------------------
1 | import json
2 | from datetime import datetime
3 |
4 | import requests
5 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
6 |
7 | TITLE = "RecycleSmart"
8 | DESCRIPTION = "Source for RecycleSmart collection."
9 | URL = "https://www.recyclesmart.com/"
10 | TEST_CASES = {
11 | "pickup": {
12 | "email": "!secret recyclesmart_email",
13 | "password": "!secret recyclesmart_password"
14 | },
15 | }
16 |
17 |
18 | class Source:
19 | def __init__(self, email, password):
20 | self._email = email
21 | self._password = password
22 |
23 | def fetch(self):
24 | # login is via Google Identity Toolkit, providing username and password.
25 | r = requests.post(
26 | "https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword",
27 | json={
28 | "returnSecureToken": True,
29 | "email": self._email,
30 | "password": self._password,
31 | },
32 | params={"key": "AIzaSyBnup3QFYYGwnvjZi7r5a39c8b94SNospU"},
33 | )
34 | data = json.loads(r.text)
35 |
36 | # take the token returned from Google Identity Toolkit to get the API auth token (JWT) from Firebase
37 | r = requests.post(
38 | "https://www.app.recyclesmart.com/api/sessions/firebase",
39 | json={"id_token": data["idToken"]},
40 | headers={"content-type": "application/json"},
41 | )
42 | data = json.loads(r.text)
43 |
44 | # use the auth token (jwt) from firebase to get pickups
45 | r = requests.get(
46 | "https://www.app.recyclesmart.com/api/pickups",
47 | # retrieves future pickups (if scheduled), then past pickups, until per_page is reached
48 | # the average user is scheduled for monthly pickups
49 | params={"page":"1", "per_page":"5"},
50 | headers={"Authorization": data["data"]["attributes"]["auth_token"]},
51 | )
52 |
53 | data = json.loads(r.text)
54 |
55 | entries = []
56 | for item in data["data"]:
57 | collection_date = datetime.strptime(item["attributes"]["pickup_on"], "%Y-%m-%d")
58 | entries.append(Collection(collection_date.date(), "Pickup"))
59 | return entries
60 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/cambridge_gov_uk.py:
--------------------------------------------------------------------------------
1 | import logging
2 | from datetime import datetime
3 |
4 | import requests
5 | from waste_collection_schedule import Collection
6 |
7 | TITLE = "Cambridge.gov.uk"
8 | DESCRIPTION = (
9 | "Source for cambridge.gov.uk services for Cambridge and part of Cambridgeshire"
10 | )
11 | URL = "cambridge.gov.uk"
12 | TEST_CASES = {
13 | "houseNumber": {"post_code": "CB13JD", "number": 37},
14 | "houseName": {"post_code": "cb215hd", "number": "ROSEMARY HOUSE"},
15 | }
16 |
17 | API_URLS = {
18 | "address_search": "https://servicelayer3c.azure-api.net/wastecalendar/address/search/",
19 | "collection": "https://servicelayer3c.azure-api.net/wastecalendar/collection/search/{}/",
20 | }
21 |
22 | ICONS = {
23 | "DOMESTIC": "mdi:trash-can",
24 | "RECYCLE": "mdi:recycle",
25 | "ORGANIC": "mdi:leaf",
26 | }
27 |
28 | _LOGGER = logging.getLogger(__name__)
29 |
30 |
31 | class Source:
32 | def __init__(self, post_code: str, number: str):
33 | self._post_code = post_code
34 | self._number = str(number).capitalize()
35 |
36 | def fetch(self):
37 | # fetch location id
38 | r = requests.get(
39 | API_URLS["address_search"], params={"postCode": self._post_code}
40 | )
41 | r.raise_for_status()
42 | addresses = r.json()
43 |
44 | address_ids = [
45 | x["id"] for x in addresses if x["houseNumber"].capitalize() == self._number
46 | ]
47 |
48 | if len(address_ids) == 0:
49 | raise Exception(f"Could not find address {self._post_code} {self._number}")
50 |
51 | q = str(API_URLS["collection"]).format(address_ids[0])
52 | r = requests.get(q)
53 | r.raise_for_status()
54 |
55 | collections = r.json()["collections"]
56 | entries = []
57 |
58 | for collection in collections:
59 | for round_type in collection["roundTypes"]:
60 | entries.append(
61 | Collection(
62 | date=datetime.strptime(
63 | collection["date"], "%Y-%m-%dT%H:%M:%SZ"
64 | ).date(),
65 | t=round_type.title(),
66 | icon=ICONS.get(round_type),
67 | )
68 | )
69 |
70 | return entries
71 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/wizard/bsr_de.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | import json
4 |
5 | import inquirer
6 | import requests
7 |
8 |
9 | def main():
10 | # get cookies
11 | r = requests.get("https://www.bsr.de/abfuhrkalender-20520.php")
12 | cookies = r.cookies
13 |
14 | while True:
15 | questions = [inquirer.Text("q", message="Enter search string for street")]
16 | answers = inquirer.prompt(questions)
17 |
18 | args = {"script": "dynamic_search", "step": 1, "q": answers["q"]}
19 |
20 | r = requests.get(
21 | "https://www.bsr.de/abfuhrkalender_ajax.php", params=args, cookies=cookies
22 | )
23 |
24 | data = json.loads(r.text)
25 | if (
26 | len(data) == 1 and data[0]["value"] == "Keine Adresse gefunden"
27 | ): # {'value': 'Keine Adresse gefunden'}
28 | print("Search returned no result. Please try again.")
29 | else:
30 | break
31 |
32 | street_choices = []
33 | for d in data:
34 | street_choices.append(d["value"])
35 |
36 | # select street
37 | questions = [
38 | inquirer.List("abf_strasse", choices=street_choices, message="Select street")
39 | ]
40 | answers = inquirer.prompt(questions)
41 |
42 | # retrieve house number list
43 | args = {"script": "dynamic_search", "step": 2, "q": answers["abf_strasse"]}
44 |
45 | r = requests.get(
46 | "https://www.bsr.de/abfuhrkalender_ajax.php", params=args, cookies=cookies
47 | )
48 |
49 | # select house number
50 | data = json.loads(r.text)
51 | house_number_choices = []
52 | for d in data.values():
53 | house_number_choices.append((d["FullStreet"], d["HouseNo"]))
54 |
55 | questions = [
56 | inquirer.List(
57 | "abf_hausnr", choices=house_number_choices, message="Select house number"
58 | )
59 | ]
60 | answers.update(inquirer.prompt(questions))
61 |
62 | print("Copy the following statements into your configuration.yaml:\n")
63 | print("# waste_collection_schedule source configuration")
64 | print("waste_collection_schedule:")
65 | print(" sources:")
66 | print(" - name: bsr_de")
67 | print(" args:")
68 | for key, value in answers.items():
69 | print(f" {key}: {value}")
70 |
71 |
72 | if __name__ == "__main__":
73 | main()
74 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/rushmoor_gov_uk.py:
--------------------------------------------------------------------------------
1 | import requests
2 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
3 | from waste_collection_schedule.service.ICS import ICS
4 |
5 | TITLE = "rushmoor.gov.uk"
6 | DESCRIPTION = "Source for rushmoor.gov.uk services for Rushmoor, UK."
7 | # Find the UPRN of your address using https://www.findmyaddress.co.uk/search
8 | URL = "https://rushmoor.gov.uk"
9 | TEST_CASES = {
10 | "GU14": {"uprn": "100060551749"},
11 | }
12 |
13 | ICON_MAP = {
14 | "Refuse": "mdi:trash-can",
15 | "Recycle": "mdi:recycle",
16 | "Garden": "mdi:leaf",
17 | "Food": "mdi:food-apple",
18 | }
19 |
20 | API_URL = "https://www.rushmoor.gov.uk/recycling-rubbish-and-environment/bins-and-recycling/download-or-print-your-bin-collection-calendar/"
21 |
22 |
23 | class Source:
24 | def __init__(self, uprn):
25 | self._uprn = uprn
26 | self._ics = ICS()
27 |
28 | def fetch(self):
29 | params = {"uprn": self._uprn, "weeks": "16"}
30 | r = requests.post(API_URL, params=params)
31 | r.raise_for_status()
32 |
33 | dates = self._ics.convert(r.text)
34 |
35 | entries = []
36 | for d in dates:
37 | for wasteType in d[1].split("&"):
38 | wasteType = wasteType.replace('bin', '')
39 | wasteType = wasteType.strip()
40 | entries.append(
41 | Collection(
42 | d[0],
43 | wasteType,
44 | icon=ICON_MAP[wasteType],
45 | )
46 | )
47 | # If wasteType is "Refuse" then add a second entry for "Garden"
48 | if wasteType == "Refuse":
49 | entries.append(
50 | Collection(
51 | d[0],
52 | "Garden",
53 | icon=ICON_MAP["Garden"],
54 | )
55 | )
56 |
57 | # Always add Food as that is collected weekly
58 | entries.append(
59 | Collection(
60 | d[0],
61 | "Food",
62 | icon=ICON_MAP["Food"],
63 | )
64 | )
65 | return entries
66 |
--------------------------------------------------------------------------------
/custom_components/waste_collection_schedule/waste_collection_schedule/source/cochem_zell_online_de.py:
--------------------------------------------------------------------------------
1 | import contextlib
2 | from datetime import datetime
3 |
4 | import requests
5 | from waste_collection_schedule import Collection # type: ignore[attr-defined]
6 | from waste_collection_schedule.service.ICS import ICS
7 |
8 | TITLE = "Abfall Cochem-Zell"
9 | DESCRIPTION = "Source for waste collection in district Cochem-Zell."
10 | URL = "https://www.cochem-zell-online.de/abfallkalender/"
11 | TEST_CASES = {
12 | "Alf": {"district": "Alf"},
13 | "Bullay": {"district": "Bullay"},
14 | "Zell-Stadt": {"district": "Zell-Stadt"},
15 | "Pünderich": {"district": "Pünderich"},
16 | }
17 |
18 | API_URL = "https://abfallkalender10.app.moba.de/Cochem_Zell/api"
19 | REMINDER_DAY = 0 # The calendar event should be on the same day as the waste collection
20 | REMINDER_HOUR = 6 # The calendar event should start on any hour of the correct day, so this does not matter much
21 | FILENAME = "Abfallkalender.ics"
22 | ICON_MAP = {
23 | "Biotonne": "mdi:leaf",
24 | "Gruengut": "mdi:forest",
25 | "Papierabfall": "mdi:package-variant",
26 | "Restmülltonne": "mdi:trash-can",
27 | "Umweltmobil": "mdi:truck",
28 | "Verpackungsabfall": "mdi:recycle",
29 | }
30 |
31 |
32 | class Source:
33 | def __init__(self, district: str):
34 | self._district = district
35 | self._ics = ICS()
36 |
37 | def fetch(self):
38 | now = datetime.now()
39 | entries = self._fetch_year(now.year)
40 |
41 | if now.month == 12:
42 | # also get data for next year if we are already in december
43 | with contextlib.suppress(Exception):
44 | entries.extend(self._fetch_year(now.year + 1))
45 |
46 | return entries
47 |
48 | def _fetch_year(self, year: int):
49 | url = "/".join(
50 | str(param)
51 | for param in (
52 | API_URL,
53 | self._district,
54 | year,
55 | REMINDER_DAY,
56 | REMINDER_HOUR,
57 | FILENAME,
58 | )
59 | )
60 |
61 | r = requests.get(url)
62 | schedule = self._ics.convert(r.text)
63 |
64 | return [
65 | Collection(
66 | date=entry[0], t=entry[1], icon=ICON_MAP.get(entry[1], "mdi:trash-can")
67 | )
68 | for entry in schedule
69 | ]
70 |
--------------------------------------------------------------------------------