core: Coronavirus (COVID-19) integration no longer reports current or recovered numbers for Czechia
The problem
So I have a nice little card I made on my dashboard which shows me the current number of coronavirus cases which gives me some idea of which direction things are heading. Unfortunately the coronavirus integration recently stopped reporting this information as well as the number of recovered cases. It does still, however, report the total number of cases since the beginning of time (not useful), and the number of deaths (depressing).
This problem started on August 5th… I suspect something changed in the API then. It does not align with my upgrade timing.
I have the following options enabled which appear to be the only ones available:
Enable newly added entities.
If newly discovered devices for Coronavirus (COVID-19) should be automatically added.
Enable polling for updates.
If Home Assistant should automatically poll Coronavirus (COVID-19) entities for updates
What is version of Home Assistant Core has the issue?
2021.8.5
What was the last working version of Home Assistant Core?
2021.5.4
What type of installation are you running?
Home Assistant Supervised
Integration causing the issue
coronavirus
Link to integration documentation on our website
https://www.home-assistant.io/integrations/coronavirus/
Example YAML snippet
No YAML, configured via UI
Anything in the logs that might be useful for us?
2021-08-13 22:29:55 DEBUG (MainThread) [homeassistant.components.coronavirus] Finished fetching coronavirus data in 3.735 seconds
2021-08-13 22:29:55 INFO (MainThread) [homeassistant.setup] Setup of domain coronavirus took 3.7 seconds
2021-08-13 22:29:56 DEBUG (MainThread) [homeassistant.bootstrap] Integration remaining: {'sensor.darksky': 5.426368, 'sensor.imap_email_content_3': 5.425897, 'input_text': 4.571587, 'coronavirus': 4.543789, 'bmw_connected_drive': 4.529214, 'input_select': 4.496135, 'notify': 4.493103, 'airvisual': 4.355119, 'smartweather': 4.325923, 'evohome': 4.320189, 'input_boolean': 4.275713, 'input_number': 4.274723, 'accuweather': 3.886144, 'timer': 3.851471, 'alarm_control_panel.mqtt': 3.694026, 'withings': 3.442679, 'xbox': 3.178649, 'alexa_media': 2.969407, 'hacs': 2.920878, 'frigate': 2.280413, 'device_tracker.life360': 2.267438, 'sensor.airvisual': 1.766412, 'sensor.speedtestdotnet': 1.527749, 'sensor.airvisual_2': 0.68246}
2021-08-13 22:29:57 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=coronavirus>
2021-08-13 22:29:58 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.coronavirus
2021-08-13 22:29:58 DEBUG (MainThread) [homeassistant.bootstrap] Integration remaining: {'sensor.darksky': 7.508326, 'sensor.imap_email_content_3': 7.507855, 'input_text': 6.653545, 'bmw_connected_drive': 6.611172, 'input_select': 6.578093, 'smartweather': 6.407881, 'evohome': 6.402147, 'input_boolean': 6.357671, 'input_number': 6.356681, 'accuweather': 5.968102, 'timer': 5.933429, 'alarm_control_panel.mqtt': 5.775984, 'withings': 5.524637, 'xbox': 5.260607, 'alexa_media': 5.051365, 'hacs': 5.002836, 'frigate': 4.362371, 'sensor.airvisual': 3.84837, 'sensor.speedtestdotnet': 3.609707, 'sensor.airvisual_2': 2.764418, 'sensor.coronavirus': 0.014359}
2021-08-13 22:29:58 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.czechia_coronavirus_confirmed, old_state=None, new_state=<state sensor.czechia_coronavirus_confirmed=1675868; attribution=Data provided by Johns Hopkins, unit_of_measurement=people, friendly_name=Czechia Coronavirus confirmed, icon=mdi:emoticon-neutral-outline @ 2021-08-13T22:29:58.635047+02:00>>
2021-08-13 22:29:58 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.czechia_coronavirus_current, old_state=None, new_state=<state sensor.czechia_coronavirus_current=unknown; attribution=Data provided by Johns Hopkins, unit_of_measurement=None, friendly_name=COVID-19 in CZ, icon=mdi:virus-outline @ 2021-08-13T22:29:58.635387+02:00>>
2021-08-13 22:29:58 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.czechia_coronavirus_recovered, old_state=None, new_state=<state sensor.czechia_coronavirus_recovered=unknown; attribution=Data provided by Johns Hopkins, unit_of_measurement=people, friendly_name=Czechia Coronavirus recovered, icon=mdi:emoticon-happy-outline @ 2021-08-13T22:29:58.635621+02:00>>
2021-08-13 22:29:58 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=sensor.czechia_coronavirus_deaths, old_state=None, new_state=<state sensor.czechia_coronavirus_deaths=30372; attribution=Data provided by Johns Hopkins, unit_of_measurement=people, friendly_name=Czechia Coronavirus deaths, icon=mdi:emoticon-cry-outline @ 2021-08-13T22:29:58.635843+02:00>>
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 40 (1 by maintainers)
The API used to fetch the active and new cases has a problem with country ids not being fixed (#https://github.com/yudeep-rajbhandari/covid-19-api/issues/3). Naturally, this leads to inconsistent results and jumps in sensor readings when, say Panama is suddenly substituted with Venezuela. The snippet below relies on the aggregated country list endpoint (https://covid-19-apis.herokuapp.com/allUpdate) and parses the results for the country of your choice. Simply replace ‘world’ with another country. A nice benefit is that you can parse data for multiple countries within a single query.
Current cases is by far the most useful metric for tracking how active the virus is in a given place at a current time. I’ve had it on my dashboard for the last 2 years, and I have a very good idea how bad things are and which direction things are headed on a daily basis just from this number and new cases per day. That’s all I really need to track where we are and where we are headed at any given time. I don’t really care how many of those are people who’ve had it twice or had it for a long time. I just care if they can infect me.
here’s my temporary fix using https://rapidapi.com/ronanren/api/worldometers API
delete corona virus integration from config -> integrations and this will replace it so you’ll get the same history data
remember to replace all <YOUR API KEY>(1) and <your country>(10)
Here’s my final version which correctly casts the values to int in case you want to chart them. You can add the additional sensors you want from the list of json properties in my post above. You can uncomment out the units if you want them, for me it just clutters up my card.
Just fyi, I’ve always been running at 6 hrs (21600 s) and I gives quite enough data detail for me when working
The problem is not determining which statistic is the “most valuable”. The problem is that all too often anymore, “science” has an agenda which is not scientific. I think what people are pointing out is that we’d like to see the raw data and make our own decisions as to what is relevant. Whenever “the science” starts restricting certain sets of information, it’s no longer “science” anymore. True science looks at all the data and lets people disagree.
Once those who possess the data start withholding certain data points, you end up with a climate chart shaped like a hockey stick…
Just curious what current and recovered numbers tell you?! It is complete nonsense especially if you take into account that a person can be infected/become sick more than once, “long COVID” etc. These two parameters are gone for a good reason.