Coronavirus broke

Mine isn’t. Family stopped looking at it. Super cool but you know “users”, if they try something a couple times and doesn’t give them what they want go elsewhere. I don’t get how the worldwide version seems to mostly work but the US and unsure of other locations, keeps failing. Are they from different places?

Mine is fully working now

Worldwide was working. I added mine back in just a few ago and US came back. Reloaded the page and bam!!! Working awesome!!!

image

Errors like this all the time.

2020-03-09 18:03:11 ERROR (MainThread) [homeassistant.components.coronavirus] Unexpected error fetching coronavirus data: 'features'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 115, in async_refresh
    self.data = await self.update_method()
  File "/usr/src/homeassistant/homeassistant/components/coronavirus/__init__.py", line 81, in async_get_cases
    aiohttp_client.async_get_clientsession(hass)
  File "/usr/local/lib/python3.7/site-packages/coronavirus/__init__.py", line 81, in get_cases
    for item in data["features"]:
KeyError: 'features'

I can’t even get this integration to add. I followed the instructions and get a message that “not all integrations can be configured via the UI”.

Logger: aiohttp.server
First occured: 4:04:16 PM (6 occurences)
Last logged: 4:05:20 PM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 39, in real_ip_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 135, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 123, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 130, in post
    return await super().post(request)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 50, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 62, in post
    handler, context={"source": config_entries.SOURCE_USER}
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 109, in async_init
    result = await self._async_handle_step(flow, flow.init_step, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 172, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/coronavirus/config_flow.py", line 30, in async_step_user
    coordinator.data.values(), key=lambda case: case.country
TypeError: '<' not supported between instances of 'str' and 'NoneType'

Yep, its also like this for me as well after the 106.6 change, was working fine, deleted the integration, restarted and all that good stuff, same error message as above…

I just upgraded to 106.6 from .2 and I don’t even see the Coronavirus integration in the list.

I’m still on HA 0.106.5 and the Coronavirus integration was working fine last night, this morning all sensors showing as unavailable. Haven’t changed anything since it was working…

found this in the HA log:

Logger: homeassistant.components.coronavirus
Integration: coronavirus (documentation, issues)
First occured: 7:31:46 AM (2 occurences)
Last logged: 8:31:47 AM

Unexpected error fetching coronavirus data: ‘features’

Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py”, line 115, in async_refresh self.data = await self.update_method() File “/usr/src/homeassistant/homeassistant/components/coronavirus/init.py”, line 81, in async_get_cases aiohttp_client.async_get_clientsession(hass) File “/usr/local/lib/python3.7/site-packages/coronavirus/init.py”, line 81, in get_cases for item in data[“features”]: KeyError: ‘features’

I’m on 0.106.3 and all is working. Must be an issue with versions above that?

Update: without doing anything, it started working again… :thinking:

Yep, it’s an odd one. I’ve gone a couple days now since the last update of the integration without it going down. Knock on wood.

Comment Removed.

Interesting. I have been using the Coronavirus add-on since it was made available and have have had no issues like that. I’m monitoring US and worldwide. The only issue I noticed was today where it shows 1600 cases then dropped to 1286 then went up to over 2000. During this time, the number on the Johns Hopkins site also went up to 1600, down to 1286 then up to over 2000 so it was properly reading that data. I’m currently running 0.107.0b1.

Yeah mine screwed up today for the first time as well but it’s not HA it’s an issue with the source. Mines come good again now.

I’d like to say it’s comical but it’s not. You look at the graph, looks like people are dying and coming back to life.

image

1 Like

Everyone in the US that recovered died at once it would seem
image

1 Like

SparkyDave,

Love your layout of your card. Can you post config of that card?

1 Like

Sure, no problem. You will need the custom mini graph card and a couple of template sensors to provide the mortality rates, posted below.

lovelace:

- type: vertical-stack
        cards:
          - type: entities
            show_header_toggle: false
            header:
              type: picture
              image: 'https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcS7ovkoWSZdub9adLaiuFEdXYUzjZ6bSSNXPA6vT3z3gmCccuMr'
            entities:
              - sensor.australia_coronavirus_confirmed
              - sensor.australia_coronavirus_current
              - sensor.australia_coronavirus_deaths
              - sensor.australia_coronavirus_recovered
              - sensor.coronavirus_australia_mortality
              - type: divider
              - sensor.worldwide_coronavirus_confirmed
              - sensor.worldwide_coronavirus_current
              - sensor.worldwide_coronavirus_deaths
              - sensor.worldwide_coronavirus_recovered
              - sensor.coronavirus_worldwide_mortality
          - type: 'custom:mini-graph-card'
            name: Coronavirus Mortality Rate (%)
            entities:
              - entity: sensor.coronavirus_australia_mortality
              - entity: sensor.coronavirus_worldwide_mortality
            show:
              state: false
              labels: true
            lower_bound: 0
            upper_bound: 5
            points_per_hour: 6
            hours_to_show: 240
            height: 150

template sensors:

sensor:
  - platform: template
    sensors:
      coronavirus_australia_mortality:
        friendly_name: "Australian Coronavirus Mortality Rate"
        unit_of_measurement: '%'
        value_template: "{{ '%.2f'|format(((states('sensor.australia_coronavirus_deaths') | float * 100) / (states('sensor.australia_coronavirus_confirmed') | float ))) }}"
      coronavirus_worldwide_mortality:
        friendly_name: "Worldwide Coronavirus Mortality Rate"
        unit_of_measurement: '%'
        value_template: "{{ '%.2f'|format(((states('sensor.worldwide_coronavirus_deaths') | float * 100) / (states('sensor.worldwide_coronavirus_confirmed') | float ))) }}"

EDIT: I just realised that my previous post didn’t have the graph, so here it is. You can leave out the graph and vertical stack if you want it to look like my old post. I will probably join them together better now that the ‘stack-in-card’ is available

1 Like

Thanks it took some bending around but I got it to work great. I have not used the stack-in-card yet either.

For those in the US, is it just me or has the total number of recovered shown up as 0 for a while now?

Try reloaded the integration but no joy. Doesn’t look like the entity name changed in the integration either so not that.

I’ve got the same issue, recovered has been reset to zero for the past 4 maybe 5 days.