mampfes / hacs_waste_collection_schedule

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

[Bug]: fetch failed for source Apps by Abfall+ #1675

Closed rotweiss4 closed 9 months ago

rotweiss4 commented 9 months ago

I Have A Problem With:

A specific source

What's Your Problem

Unknown data for sensors. Integration doesnt catch the data.

Source (if relevant)

No response

Logs

fetch failed for source Apps by Abfall+: Traceback (most recent call last): File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py", line 134, in fetch entries = self._source.fetch() ^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/app_abfallplus_de.py", line 124, in fetch for d in self._app.generate_calendar(): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/service/AppAbfallplusDe.py", line 761, in generate_calendar return self.get_collections() ^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/service/AppAbfallplusDe.py", line 696, in get_collections r.raise_for_status() File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://app.abfallplus.de/struktur.xml.zip

Relevant Configuration

No response

Checklist Source Error

Checklist Sensor Error

Required

5ila5 commented 9 months ago

runs fine for me on the master branch where there where some changes after 1.44.0 please try the newly released 1.45.0 and report back

rotweiss4 commented 9 months ago

Unfortunately it does not work. I tested the master and the latest version

Here is my config:

waste_collection_schedule:
  sources:
    - name: app_abfallplus_de
      args:
        app_id: de.k4systems.regioentsorgung
        city: Nörvenich
        strasse: blabla-Straße 
        hnr: 2

If I wrote only the street, without city and hnr, i get an error "Street blabla-Straße not found." The same error with another Street.

If I wrote the Code above, i get an error "response=self) requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://app.abfallplus.de/struktur.xml.zip"

rotweiss4 commented 9 months ago

I tested the configuration with the first example Braunschweig and it runs. With my configuration i get the same error like before.

I think there is something wrong with the source or the configuration of the source.

5ila5 commented 9 months ago

The App (https://play.google.com/store/apps/details?id=de.k4systems.regioentsorgung) does not work for me either when choosing without signing I cannot use the app at all and spying on the traffic I get the same 401 UNAUTHORIZED. The source tries to use the sign in anonymously option and currently does not support logging in with an account (creating an account failed for me as well on the app. I think the APP Broke. They may fix this?)

rotweiss4 commented 9 months ago

Thank you very much for your help. I'll write to the developer

ReneNulschDE commented 9 months ago

Looks like "city: Nörvenich" is using regioentsorgung.de. So you could use this config to get your calendar data too.

    - name: regioentsorgung_de
      args:
        city: Nörvenich
        street: blabla-Straße
        house_number: 2
rotweiss4 commented 9 months ago

is using regioentsorgung.de.

Yes, that´s right. I can find my street on the homepage regioentsorgung.de

Unfortunately it does not work. I still have sensors with unknown. are you sure the configuration is correct?

ReneNulschDE commented 9 months ago

I check it with

    - name: regioentsorgung_de
      args:
        city: Nörvenich
        street: Am Burgacker 
        house_number: 6

and this is working.

rotweiss4 commented 9 months ago

I checked my configuration again and you are right. It works. I had to rewrite the types in the sensors. They had different names now. (without brackets and without ä ö ü) Thank you for your help

ReneNulschDE commented 9 months ago

please close the issue when you're ok.