Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: 2.6 and 2025.1.1 [AWIDO Online] sensor unavailable and creating new source unknown error #3509

Open
7 tasks done
fila612 opened this issue Jan 9, 2025 · 1 comment

Comments

@fila612
Copy link

fila612 commented Jan 9, 2025

I Have A Problem With:

The integration in general

What's Your Problem

my sensors are not longer available and if I try to create this source new I get an "unknown error"

Source (if relevant)

AWIDO Online

Logs

2025-01-09 01:08:37.957 ERROR (SyncWorker_3) [custom_components.waste_collection_schedule.waste_collection_schedule.source_shell] error loading source awido_de:
No module named 'icalendar.windows_to_olson' 
Traceback (most recent call last):
  File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source_shell.py", line 217, in create
    source_module: SourceModule = importlib.import_module(
                                  ~~~~~~~~~~~~~~~~~~~~~~~^
        f"waste_collection_schedule.source.{source_name}"
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/awido_de.py", line 7, in <module>
    from waste_collection_schedule.service.ICS import ICS
  File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/service/ICS.py", line 7, in <module>
    from icalevents import icalevents
  File "/usr/local/lib/python3.13/site-packages/icalevents/icalevents.py", line 3, in <module>
    from .icalparser import parse_events, Event
  File "/usr/local/lib/python3.13/site-packages/icalevents/icalparser.py", line 18, in <module>
    from icalendar.windows_to_olson import WINDOWS_TO_OLSON
ModuleNotFoundError: No module named 'icalendar.windows_to_olson'

[...]

2025-01-09 01:08:47.220 ERROR (MainThread) [homeassistant.components.calendar] Error while setting up waste_collection_schedule platform for calendar
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/waste_collection_schedule/calendar.py", line 165, in async_setup_entry
    entities = create_calendar_entries([shell], coordinator=coordinator)
  File "/config/custom_components/waste_collection_schedule/calendar.py", line 129, in create_calendar_entries
    dedicated_calendar_types = shell.get_dedicated_calendar_types()
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_dedicated_calendar_types'
2025-01-09 01:08:47.230 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up waste_collection_schedule platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/waste_collection_schedule/sensor.py", line 76, in async_setup_entry
    _LOGGER.debug("Adding sensors for %s", coordinator.shell.calendar_title)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'calendar_title'
2025-01-09 01:08:48.256 ERROR (MainThread) [homeassistant.components.mqtt.models] Exception raised while updating state of sensor.geschwindigkeit, topic: 'Tesla' with payload: b'{"charging":false,"driving":false,"online":false,"sleeping":true,"falling_asleep":false,"speed":0,"power":0,"odometer":16844.160118769814,"ideal_battery_range_km":404.46033408,"battery_range_km":404.46111012762123,"outside_temp":9.5,"battery_level":80,"charger_voltage":0,"charger_phases":0,"charger_actual_current":0,"charge_energy_added":32.86,"charger_power":0,"charge_rate_km":0.0,"charge_port_door_open":true,"time_to_full_charge":0.0,"fast_charger_brand":"","fast_charger_present":false,"car_version":"2023.44.30.9 eef969740612","trip_start":"16:50","trip_start_dt":"2024-02-12T15:50:03Z","trip_max_speed":140.0,"trip_max_power":250.0,"trip_duration_sec":4153,"trip_kwh":11.432801712345304,"trip_avg_kwh":168.05002383666215,"trip_distance":68.032133833301486,"ts":"2024-02-13T04:01:20Z","latitude":48.302318,"longitude":11.358674,"charge_limit_soc":80,"inside_temperature":11.1,"battery_heater":false,"is_preconditioning":false,"sentry_mode":false,"country_code":"de","state":"Bayern","display_name":"Zane","heading":0,"software_update_status":"","software_update_version":" ","active_route_destination":null,"active_route_energy_at_arrival":null,"active_route_minutes_to_arrival":null,"active_route_traffic_minutes_delay":0.0,"active_route_latitude":48.302318,"active_route_longitude":11.358674,"open_windows":0,"open_doors":0,"frunk":0,"trunk":0,"locked":true,"TLGeofence":"zu Hause","TLGeofenceIsHome":true,"TLGeofenceIsCharger":false,"TLGeofenceIsWork":false}'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 640, in state
    numerical_value = float(value)  # type:ignore[arg-type]
ValueError: could not convert string to float: 'Zane'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/mqtt/models.py", line 366, in process_write_state_requests
    entity.async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1085, in __async_calculate_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1029, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 642, in state
    raise ValueError(
    ...<5 lines>...
    ) from err
ValueError: Sensor sensor.geschwindigkeit has device class 'None', state class 'None' unit 'km/h' and suggested precision 'None' thus indicating it has a numeric value; however, it has the non-numeric value: 'Zane' (<class 'str'>)
2025-01-09 01:08:49.011 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'charging' when rendering '{{value_json.charging}}'
2025-01-09 01:08:51.145 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up hafas platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/hafas/sensor.py", line 37, in async_setup_entry
    await hass.async_add_executor_job(client.locations, entry.data[CONF_START])
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.13/site-packages/pyhafas/client.py", line 230, in locations
    res = self.profile.request(body)
  File "/usr/local/lib/python3.13/site-packages/pyhafas/profile/base/helper/request.py", line 96, in request
    return HafasResponse(res, BaseErrorCodesMapping)
  File "/usr/local/lib/python3.13/site-packages/pyhafas/types/hafas_response.py", line 27, in __init__
    data = json.loads(raw_hafas_response.text)
  File "/usr/local/lib/python3.13/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/usr/local/lib/python3.13/json/decoder.py", line 345, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/json/decoder.py", line 363, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2025-01-09 01:08:51.171 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up hafas platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/hafas/sensor.py", line 37, in async_setup_entry
    await hass.async_add_executor_job(client.locations, entry.data[CONF_START])
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.13/site-packages/pyhafas/client.py", line 230, in locations
    res = self.profile.request(body)
  File "/usr/local/lib/python3.13/site-packages/pyhafas/profile/base/helper/request.py", line 96, in request
    return HafasResponse(res, BaseErrorCodesMapping)
  File "/usr/local/lib/python3.13/site-packages/pyhafas/types/hafas_response.py", line 27, in __init__
    data = json.loads(raw_hafas_response.text)
  File "/usr/local/lib/python3.13/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/usr/local/lib/python3.13/json/decoder.py", line 345, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/json/decoder.py", line 363, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2025-01-09 01:08:51.179 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up hafas platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/hafas/sensor.py", line 37, in async_setup_entry
    await hass.async_add_executor_job(client.locations, entry.data[CONF_START])
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.13/site-packages/pyhafas/client.py", line 230, in locations
    res = self.profile.request(body)
  File "/usr/local/lib/python3.13/site-packages/pyhafas/profile/base/helper/request.py", line 96, in request
    return HafasResponse(res, BaseErrorCodesMapping)
  File "/usr/local/lib/python3.13/site-packages/pyhafas/types/hafas_response.py", line 27, in __init__
    data = json.loads(raw_hafas_response.text)
  File "/usr/local/lib/python3.13/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/usr/local/lib/python3.13/json/decoder.py", line 345, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/json/decoder.py", line 363, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

[...]

Logger: homeassistant.components.sensor
Quelle: helpers/entity_platform.py:366
Integration: Sensor (Dokumentation, Probleme)
Erstmals aufgetreten: 01:08:47 (3 Vorkommnisse)
Zuletzt protokolliert: 06:21:48

Error while setting up waste_collection_schedule platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/waste_collection_schedule/sensor.py", line 76, in async_setup_entry
    _LOGGER.debug("Adding sensors for %s", coordinator.shell.calendar_title)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'calendar_title'



Logger: homeassistant.components.calendar
Quelle: helpers/entity_platform.py:366
Integration: Kalender (Dokumentation, Probleme)
Erstmals aufgetreten: 01:08:47 (3 Vorkommnisse)
Zuletzt protokolliert: 06:21:48

Error while setting up waste_collection_schedule platform for calendar
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/waste_collection_schedule/calendar.py", line 165, in async_setup_entry
    entities = create_calendar_entries([shell], coordinator=coordinator)
  File "/config/custom_components/waste_collection_schedule/calendar.py", line 129, in create_calendar_entries
    dedicated_calendar_types = shell.get_dedicated_calendar_types()
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_dedicated_calendar_types'


Logger: homeassistant.components.calendar
Quelle: helpers/entity_platform.py:366
Integration: Kalender (Dokumentation, Probleme)
Erstmals aufgetreten: 01:08:47 (3 Vorkommnisse)
Zuletzt protokolliert: 06:21:48

Error while setting up waste_collection_schedule platform for calendar
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 366, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/waste_collection_schedule/calendar.py", line 165, in async_setup_entry
    entities = create_calendar_entries([shell], coordinator=coordinator)
  File "/config/custom_components/waste_collection_schedule/calendar.py", line 129, in create_calendar_entries
    dedicated_calendar_types = shell.get_dedicated_calendar_types()
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get_dedicated_calendar_types'


Logger: aiohttp.server
Quelle: /usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py:451
Erstmals aufgetreten: 06:21:21 (1 Vorkommnisse)
Zuletzt protokolliert: 06:21:21

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/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 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 210, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
    return await method(view, request, data, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 341, in async_configure
    result = await self._async_configure(flow_id, user_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 388, 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 491, in _async_handle_step
    result: _FlowResultT = await getattr(flow, method)(user_input)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/waste_collection_schedule/config_flow.py", line 409, in async_step_source
    return await self.async_step_args()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/waste_collection_schedule/config_flow.py", line 693, in async_step_args
    schema, module = await self.__get_arg_schema(
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self._source, self._extra_info_default_params, args_input
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/config/custom_components/waste_collection_schedule/config_flow.py", line 488, in __get_arg_schema
    module = await self.hass.async_add_executor_job(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        importlib.import_module, f"waste_collection_schedule.source.{source}"
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/source/awido_de.py", line 7, in <module>
    from waste_collection_schedule.service.ICS import ICS
  File "/config/custom_components/waste_collection_schedule/waste_collection_schedule/service/ICS.py", line 7, in <module>
    from icalevents import icalevents
  File "/usr/local/lib/python3.13/site-packages/icalevents/icalevents.py", line 3, in <module>
    from .icalparser import parse_events, Event
  File "/usr/local/lib/python3.13/site-packages/icalevents/icalparser.py", line 18, in <module>
    from icalendar.windows_to_olson import WINDOWS_TO_OLSON
ModuleNotFoundError: No module named 'icalendar.windows_to_olson'

Relevant Configuration

No response

Checklist Source Error

  • Use the example parameters for your source (often available in the documentation) (don't forget to restart Home Assistant after changing the configuration)
  • Checked that the website of your service provider is still working
  • Tested my attributes on the service provider website (if possible)
  • I have tested with the latest version of the integration (master) (for HACS in the 3 dot menu of the integration click on "Redownload" and choose master as version)

Checklist Sensor Error

  • Checked in the Home Assistant Calendar tab if the event names match the types names (if types argument is used)

Required

  • I have searched past (closed AND opened) issues to see if this bug has already been reported, and it hasn't been.
  • I understand that people give their precious time for free, and thus I've done my very best to make this problem as easy as possible to investigate.
@andyboeh
Copy link
Contributor

andyboeh commented Jan 9, 2025

Seems like this is a library problem of HA core: home-assistant/core#135077

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants