custom-components / sensor.stadtreinigung_hamburg

Stadtreinigung Hamburg - get garbage collection dates in Hamburg - custom component for Home Assistant
MIT License
25 stars 5 forks source link

Sensor not working since update of core 2021-12 #10

Closed gordenfalk closed 2 years ago

gordenfalk commented 2 years ago

Version of the custom_component

Configuration


Add your logs here.

Describe the bug

A clear and concise description of what the bug is.

Debug log


Add your logs here.
Japander commented 2 years ago

This is my debug log when trying to setup the Sensor with HA 2021-12

2021-12-16 06:33:02 ERROR (MainThread) [aiohttp.server] Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 181, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 157, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper result = await method(view, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 252, in async_configure result = await self._async_handle_step(flow, cur_step["step_id"], user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/stadtreinigung_hamburg/config_flow.py", line 41, in async_step_user await self.hass.async_add_executor_job( File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.9/site-packages/stadtreinigung_hamburg/StadtreinigungHamburg.py", line 47, in get_garbage_collections uuid = r.html.find("input[name=asId]")[0].attrs["value"] IndexError: list index out of range

PhilippBaumgarten commented 2 years ago

I can confirm for HA 2021-12

This error originated from a custom integration.

Logger: custom_components.stadtreinigung_hamburg.sensor Source: custom_components/stadtreinigung_hamburg/sensor.py:162 Integration: Stadtreinigung Hamburg (documentation) First occurred: 10:29:04 AM (1 occurrences) Last logged: 10:29:04 AM

Error occurred while fetching data: IndexError('list index out of range')

oliverboermel commented 2 years ago

HI have the same Problem will you fix it?

murmelbahn commented 2 years ago

Sadly I have the same error. Would be nice if this coud be fixed.

vigonotion commented 2 years ago

I've identified the problem. The website https://stadtreinigung.hamburg where this integration scrapes its data from got updated. The underlying library needs to be updated: https://github.com/vigonotion/stadtreinigung_hamburg

It might take some time because the street name -> id resolution is not working in my library, but theoretically all the required information is still available

oliverboermel commented 2 years ago

i hope you can fix it i hoestly miss it :-)

fabsenet commented 2 years ago

Don't you have to push a new version of this sensor with the fixed library? or does this work without a new release? At least my home assistant neither works nor shows an available update?

oliverboermel commented 2 years ago

why did you close it is still not working or did i miss something?

vigonotion commented 2 years ago

GitHub closed it automatically because the PR in the library linked this issue

vigonotion commented 2 years ago

The library needs to be updated (https://github.com/custom-components/sensor.stadtreinigung_hamburg/blob/master/custom_components/stadtreinigung_hamburg/manifest.json) and then tested if it works. I didn't have time for that yet, PRs are welcome

jherrmann commented 2 years ago

Hi, I changed the manifest.json to:

    "domain": "stadtreinigung_hamburg",
    "name": "Stadtreinigung Hamburg",
    "documentation": "https://github.com/custom-components/sensor.stadtreinigung_hamburg",
    "dependencies": [],
    "codeowners": [
        "@vigonotion"
    ],
    "requirements": [
        "stadtreinigung-hamburg==0.3.0"
    ],
    "config_flow": true,
    "version": "1.0.1"
}

but then I get after restart and new setup of the component

Logger: homeassistant.helpers.entity Source: helpers/entity.py:549 First occurred: 06:59:05 (18 occurrences) Last logged: 07:03:27

Entity sensor.stadtreinigung_hamburg_mulltonnen_schwarze_restmulltonne (<class 'custom_components.stadtreinigung_hamburg.sensor.StadtreinigungHamburgSensor'>) implements device_state_attributes. Please report it to the custom component author. Entity sensor.stadtreinigung_hamburg_mulltonnen_gelbe_wertstofftonne_sack (<class 'custom_components.stadtreinigung_hamburg.sensor.StadtreinigungHamburgSensor'>) implements device_state_attributes. Please report it to the custom component author. Entity sensor.stadtreinigung_hamburg_mulltonnen_blaue_papiertonne (<class 'custom_components.stadtreinigung_hamburg.sensor.StadtreinigungHamburgSensor'>) implements device_state_attributes. Please report it to the custom component author. Entity sensor.stadtreinigung_hamburg_mulltonnen_weihnachtsbaume (<class 'custom_components.stadtreinigung_hamburg.sensor.StadtreinigungHamburgSensor'>) implements device_state_attributes. Please report it to the custom component author. Entity sensor.stadtreinigung_hamburg_mulltonnen_laubsacke (<class 'custom_components.stadtreinigung_hamburg.sensor.StadtreinigungHamburgSensor'>) implements device_state_attributes. Please report it to the custom component author.

If I get this fixed I can create a pull request.

gordenfalk commented 2 years ago

It works !!! Thanks to all the involved ones