mampfes / hacs_waste_collection_schedule

Home Assistant integration framework for (garbage collection) schedules
MIT License
1.01k stars 637 forks source link

[Bug]: Integration stopped working #2765

Closed feasly closed 1 hour ago

feasly commented 2 days ago

I Have A Problem With:

The integration in general

What's Your Problem

I divided the sensors for different garbage types, after that the integration didn't work anymore. Then I recovered the original configuration and even restored a full backup of homeassistant, but the error remains the same.

I removed all files and config, uninstalled the integration, deleted the local calendar and started new from scratch, no success.

There are no entries in the "Müllmax" calendar, which was created by the addon after configuration. The configuration was done in the yaml file, using the GUI didn't work from the beginning.

I used this integration with the configuration below for months without any issues before.

What am I doing wrong?

Source (if relevant)

No response

Logs

Logger: custom_components.waste_collection_schedule.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:40:29 (1 Vorkommnisse)
Zuletzt protokolliert: 13:40:29

fetch failed for source Müllmax: Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/icalendar/parser.py", line 339, in parts validate_token(name) File "/usr/local/lib/python3.12/site-packages/icalendar/parser.py", line 128, in validate_token raise ValueError(name) ValueError: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/muellmax_de.py", line 160, in fetch dates = self._ics.convert(r.text) ^^^^^^^^^^^^^^^^^^^^^^^^^ 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 299, in parse_events calendar = Calendar.from_ical(content) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/icalendar/cal.py", line 331, in from_ical name, params, vals = line.parts() ^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/icalendar/parser.py", line 353, in parts raise ValueError( ValueError: Content line could not be parsed into parts: '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">': <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> The above exception was the direct cause of the following exception: 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/muellmax_de.py", line 162, in fetch raise ValueError( ValueError: Got invalid response from the server, please recheck your arguments

Relevant Configuration

# waste_collection_schedule_ source configuration
waste_collection_schedule:
  sources:
    - name: muellmax_de
      args:
        service: Rsa
        mm_frm_ort_sel: (Cityname)
        mm_frm_str_sel: (Streetname)
sensor:
  - platform: waste_collection_schedule
    name: muellmax
    details_format: upcoming
    add_days_to: true
    types:
      - "RSAG Restmülltonne 2-wö."
      - "RSAG Biotonne 2-wö."
      - "RSAG Wertstofftonne oder -sack 4-wö."
      - "RSAG Papiertonne 4-wö."

Checklist Source Error

Checklist Sensor Error

Required

5ila5 commented 2 days ago

I cannot really reproduce this issue this works for me:

# waste_collection_schedule_ source configuration
waste_collection_schedule:
  sources:
    - name: muellmax_de
      args:
        service: Rsa
        mm_frm_ort_sel: Alfter
        mm_frm_str_sel: Ahrweg (105-Ende/94-Ende)

Maybe they changed the street name (added a hnr range or something).

Make sure your city and street exactly mathces the autocompleted values here: https://www.muellmax.de/abfallkalender/rsa/res/RsaStart.php

feasly commented 2 days ago

Thanks @5ila5 , your config above works! I already tried this test config before without success, maybe I made a typo. So something in my city- or streetnaming must have changed. I will have a closer look and try.

feasly commented 2 days ago

I checked with some different cities and streetnames, nothing but the example above (Alfter / Ahrweg (105-Ende/94-Ende)) works. All other entries result in the same error.

EDIT: I noticed that I also can't download the iCalendar file from muellmax.de manually anymore. Maybe I'm blocked due to too many requests. I will change my IP and wait some time.

feasly commented 1 hour ago

I contacted my provider with this issue.

This was the reply (translated):

"We have forwarded the case to our technical service provider and they have identified an unusual use of the waste calendar. It is planned to display an error message in such cases in future instead of returning to the start page." ... "RSAG's waste collection data is presented via a web interface for Internet browsers. Use is only permitted by natural persons. Script-controlled access is excluded from use."

RSAG uses the muellmax service.

I'm going to follow this guide to import a iCal file and use it for waste collection schedule.