mampfes / hacs_waste_collection_schedule

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

[Bug]: Source is not working #2143

Closed M4tRiX92 closed 3 months ago

M4tRiX92 commented 3 months ago

I Have A Problem With:

A specific source

What's Your Problem

Hi,

I set up the integration a few months ago and since then it has worked very reliably.

Now I noticed a few weeks ago that the calendar is empty and no new data is being pulled. I suspected an update and that's why I waited. Unfortunately, it still doesn't work.

waste_collection_schedule:
  sources:
    - name: abfall_io
      args:
        key: "d287412901d68d66825e588a60c94641"
        f_id_kommune: 128
        f_id_bezirk: 884
        f_id_strasse: 9922
        f_abfallarten:
          - 20
          - 17
          - 19
          - 24
          - 31
          - 37
          - 85

Logfile just displays a warning (attached). Any ideas or do you need more information?

Thank you.

Source (if relevant)

No response

Logs

`Logger: homeassistant.util.loop
Quelle: util/loop.py:84
Erstmals aufgetreten: 11:58:52 (1 Vorkommnisse)
Zuletzt protokolliert: 11:58:52

Detected blocking call to import_module inside the event loop by custom integration 'waste_collection_schedule' at custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py, line 188: source_module = importlib.import_module( (offender: /config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py, line 188: source_module = importlib.import_module(), please report it to the author of the 'waste_collection_schedule' custom integration Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2064, in _async_forward_entry_setup result = await async_setup_component( File "/usr/src/homeassistant/homeassistant/setup.py", line 165, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 402, in _async_setup_component result = await task File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 127, in async_setup await component.async_setup(config) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 149, in async_setup self.hass.async_create_task_internal( File "/usr/src/homeassistant/homeassistant/core.py", line 828, in async_create_task_internal task = create_eager_task(target, name=name, loop=self.loop) File "/usr/src/homeassistant/homeassistant/util/async_.py", line 37, in create_eager_task return Task(coro, loop=loop, name=name, eager_start=True) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 299, in async_setup_platform platform = await async_prepare_setup_platform( File "/usr/src/homeassistant/homeassistant/setup.py", line 538, in async_prepare_setup_platform ) and not await async_setup_component(hass, integration.domain, hass_config): File "/usr/src/homeassistant/homeassistant/setup.py", line 165, in async_setup_component result = await _async_setup_component(hass, domain, config) File "/usr/src/homeassistant/homeassistant/setup.py", line 402, in _async_setup_component result = await task File "/config/custom_components/waste_collection_schedule/__init__.py", line 110, in async_setup api.add_source_shell( File "/config/custom_components/waste_collection_schedule/__init__.py", line 200, in add_source_shell new_shell = SourceShell.create( File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py", line 188, in create source_module = importlib.import_module(`

Relevant Configuration

No response

Checklist Source Error

Checklist Sensor Error

Required

5ila5 commented 3 months ago

as far as I can tell you're using https://www.landkreis-rottweil.de/abfallkalender looks like your bezirk 884 does not have a street with id 9922 (anymore???), so culd you please recheck that your arguments are still valid?

        "key": "d287412901d68d66825e588a60c94641",
        "f_id_kommune": 128,
        "f_id_bezirk": 884,
        "f_id_strasse": 1805,
        "f_id_strasse_hnr": 20111,

works for me

M4tRiX92 commented 3 months ago

as far as I can tell you're using https://www.landkreis-rottweil.de/abfallkalender looks like your bezirk 884 does not have a street with id 9922 (anymore???), so culd you please recheck that your arguments are still valid?

        "key": "d287412901d68d66825e588a60c94641",
        "f_id_kommune": 128,
        "f_id_bezirk": 884,
        "f_id_strasse": 1805,
        "f_id_strasse_hnr": 20111,

works for me

Hi 5ila5,

I tried it with you values:

waste_collection_schedule:
  sources:
    - name: abfall_io
      args:
        key: "d287412901d68d66825e588a60c94641"
        f_id_kommune: 128
        f_id_bezirk: 884
        f_id_strasse: 1805
        f_abfallarten:
          - 20
          - 17
          - 19
          - 24
          - 31
          - 37
          - 85

Unfortunately, still my calender in homeassistant is empty :( strasse_hnr can be empty and is optional, right?

5ila5 commented 3 months ago

f_id_strasse_hnr is optional because you don't need it for all providers or cities/streets, but if you have to select a house number (even if it is something like All numbers) you do need it. This test case only returns Selbstanlieferung and Sperrmüll if you do not add the f_id_strasse_hnr parameter (which you excluded with the f_abfallarten argument). So you DO need f_id_strasse_hnr for these parameters