thebino / rki_covid

🦠 Custom integration for Home Assistant to monitor covid numbers provided by Robert-Koch Institut
Apache License 2.0
40 stars 10 forks source link

Entities empty after updates #9

Closed SpeedmaxX closed 3 years ago

SpeedmaxX commented 3 years ago

Hi, After updating HA to the current release 5.10 and 2021.1.1, there are no values left and the entities are empty.

— Hi, nach dem Update auf die aktuellen Versionen zeigen die Entitäten keine Werte mehr an.

Best regards, Markus

SpeedmaxX commented 3 years ago

2021-01-12 15:20:22 ERROR (MainThread) [custom_components.rki_covid] Error fetching rki_covid data: 2021-01-12 15:20:22 INFO (MainThread) [homeassistant.setup] Setup of domain rki_covid took 2.7 seconds

thebino commented 3 years ago

It seems, the API had an invalid certificate But it should be fixed already. Please try to update or re-install the component.

SpeedmaxX commented 3 years ago

hi, reinstall did not bring the solution ...

thebino commented 3 years ago

I just published a new version 0.2.1 which doesn't fix any issues but added the error to the log message. Can you please try to upgrade / install it and have a look into the Configuration > Logs > Full Log to see what error exactly happen for you.

SpeedmaxX commented 3 years ago

now I have: 2021-01-13 14:45:08 ERROR (MainThread) [homeassistant.setup] Setup failed for rki_covid: Integration not found.

I uninstalled, restarted, installed, restarted

thebino commented 3 years ago

1.) How did you install the integration? via HACS? 2.) Have you seen the district selection popup right after installation? 3.) Which districts have you added?

SpeedmaxX commented 3 years ago

Installed via HACS

Now, I removed the integration and have just repeated uninstall, restart and install. Then restarted hassio. Then I tried to add the integration, but it is missing now

I've chosen "Kreis Borken"

Current log:

Logger: homeassistant.components.coronavirus Source: helpers/update_coordinator.py:148 Integration: Coronavirus (COVID-19) (documentation, issues) First occurred: 14:57:20 (1 occurrences) Last logged: 14:57:20

Timeout fetching coronavirus data

thebino commented 3 years ago

This looks like anything is/was wrong with HACS since the Integration can not be found! This error has nothing to do with the component itself, rather with the installation process of HACS.

SpeedmaxX commented 3 years ago

after a full reboot I see "2021-01-13 16:08:42 DEBUG (MainThread) [custom_components.hacs] <Integration thebino/rki_covid> Running checks against 0.2.1" in the log but still cannot find the integration to configure

thebino commented 3 years ago

Can you uninstall the component and remove and re-add the HACS repository please? Perhaps something happend during loading the repository details.

P.S. If you have access to the HA Instance directly (like SSH) you can check if you find a directory custom_components/rki_covid on it.

SpeedmaxX commented 3 years ago

Hi, I already fully uninstalled ist via hacs, restarted and added it again in the latest version. the custom_components directory does NOT contain this integration, even as is shown as installed

thebino commented 3 years ago

If the folder doesn't exist or is empty, the download / installation via hacs failed. This isn't an component issue and outside my possibility to fix.

I recommend to remove and re-add the repository in hacs. If this does not help, I need to point you to the hacs support.

Whippie72 commented 3 years ago

I got similar issues after update to 0.2.1

I deinstalled via HACS to reinstall it. The folder _rkicovid is being created within _customcomponents. I restartet HA, but the integration is not shown up. I tried the installation in several ways. No chance to get it run :(

Whippie72 commented 3 years ago

For unknown reason and i did nothing else, just working on other topics, i just tried to add the integration 3 hours later. What should i say, the integration was know found and the numbers are shown ... awesome.

SpeedmaxX commented 3 years ago

Hi, it's working again. I readded the repo this morning and the folder was created. Integration is also available, again. If possible, you could perhaps add "currently infected" as a number.

Thanks for this! - from my point of view, this issue can be closed

thebino commented 3 years ago
  1. you can’t measure, when a person is “healed"
  2. people can become infected multiple times in rare cases

So what exactly is the “active cases” measuring? Are these people in a hospital, on intensive care or only quarantined?

The data are wrapped by this api and the rki don’t seem to provide these details but feel free to check the source by yourself: https://github.com/marlon360/rki-covid-api/blob/master/server/cronjobs/updateDistricts.js#L10

SpeedmaxX commented 3 years ago

Thank you for your reply. I was just looking for our district-board on https://kreis-borken.maps.arcgis.com/apps/opsdashboard/index.html#/8f5b19adff6941d0b5e65e3b3c12184e I only saw several queries on arcgis in the developer-dashboard, that's why I thought, it would easily be possible to add that sensor. But it's ok as it is.

edit: here you can see these values - it's the query for the cities in the district https://services2.arcgis.com/297hbk2d6K4DqSw4/arcgis/rest/services/Covid19_AGOL/FeatureServer/1/query?f=json&where=KOMMUNE%3D%2701%20-%20Kreis%20Borken%27&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields=*&orderByFields=DATUM%20asc&resultOffset=0&resultRecordCount=32000&resultType=standard&cacheHint=true

Whippie72 commented 3 years ago

Since this morning at 00:27 the entities do not provide any values.

Have restarted HA and find some log entries. The first entry is:

Error fetching rki_covid data: Error communicating with API: Cannot connect to host rki.marlon-lueckert.de:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1125)')]

More Entries:

Error while setting up rki_covid platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/rki_covid/sensor.py", line 53, in async_setup_entry
    sensors = [
  File "/config/custom_components/rki_covid/sensor.py", line 54, in <listcomp>
    RKICovidNumbersSensor(coordinator, district, info_type) for info_type in SENSORS
  File "/config/custom_components/rki_covid/sensor.py", line 74, in __init__
    data = coordinator.data[district]
TypeError: 'NoneType' object is not subscriptable
Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 118, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 49, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 72, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 136, in post
    return await super().post(request)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 60, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 69, in post
    result = await self._flow_mgr.async_init(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 130, in async_init
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 213, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/config/custom_components/rki_covid/config_flow.py", line 37, in async_step_user
    for case in sorted(coordinator.data.values(), key=lambda case: case.county):
AttributeError: 'NoneType' object has no attribute 'values'