mampfes / hacs_waste_collection_schedule

Home Assistant integration framework for (garbage collection) schedules
MIT License
988 stars 631 forks source link

[Bug]: Kreis Plön #2252

Closed DocF00 closed 1 month ago

DocF00 commented 2 months ago

I Have A Problem With:

A specific source

What's Your Problem

Hey, I just updated to v2.0, sadly I cant find 'Kreis Plön' or 'Abfallwirtschaft Kreis Plön' at the list of sources from the GUI configuration. Under v1.x I had no issues. My sensor from configuration.yaml is not working anymore either. Before no issues. Thanks in advance!

Source (if relevant)

https://www.kreis-ploen.de/output/abfall_export.php

Logs

No response

Relevant Configuration

No response

Checklist Source Error

Checklist Sensor Error

Required

5ila5 commented 2 months ago

Kreis Plön is not a source, but just documentation on how to use the ics source for it. You can find the ICS source in country: Generic -> source: ics

I cannot reproduce your issue with sensors, Could you please share your sensor configuration and take a look if there are any logs (English: settings -> system -> logs) (German: einstellungen -> system -> Protokolle)

DocF00 commented 2 months ago

The url which was working till yesterday now delivers via Generic → ics the error 'pop from empty list'. The Integration and the sensor from v1.x looks like this:

waste_collection_schedule: sources:

sensor:

The configuation above now delivers this error via the protocol readout (which reads to me as if the problem is pop from empty list aswell): Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: waste_collection_schedule.source_shell Quelle: custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py:147 Integration: Waste Collection Schedule (Dokumentation) Erstmals aufgetreten: 13. Juli 2024 um 20:41:33 (2 Vorkommnisse) Zuletzt protokolliert: 01:28:52

fetch failed for source ICS: Traceback (most recent call last): File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py", line 145, in fetch entries = self._source.fetch() ^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/ics.py", line 164, in fetch entries = self.fetch_url(url, self._params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/ics.py", line 205, in fetch_url return self._convert(r.text) ^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/ics.py", line 216, in _convert dates = self._ics.convert(data) ^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/service/ICS.py", line 48, in convert events: List[Any] = icalevents.events( ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/icalevents/icalevents.py", line 57, in events found_events += parse_events( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/icalevents/icalparser.py", line 288, in parse_events calendar = Calendar.from_ical(content) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/icalendar/cal.py", line 360, in from_ical component = stack.pop() ^^^^^^^^^^^ IndexError: pop from empty list

5ila5 commented 2 months ago
curl "https://www.kreis-ploen.de/output/abfall_export.php?csv_export=1&mode=vcal&ort=2156.41&strasse=2156.373.1&abfart%5B0%5D=1.1&abfart%5B1%5D=1.3&abfart%5B2%5D=1.4&abfart%5B3%5D=1.5&vtyp=4&vMo=1&vJ=2024&bMo=12"

results in:

BEGIN:VCALENDAR
METHOD:PUBLISH
X-WR-TIMEZONE:Europe/Berlin
PRODID:http://www.kreis-ploen.de
CALSCALE:GREGORIAN
VERSION:2.0

END:VEVENT
END:VCALENDAR

It looks like your ICL URL got invalid somehow. Did you try to get a new one? Does it match the old one?

DocF00 commented 1 month ago

Its working again. Coincidentally the source url was changes around the time of your release of v2.0. Maybe its helping somebody else, correct source for Kreis Plön can be found on https://www.kreis-ploen.de after selection of city and address.