Coronavirus broke

To humour you I restarted just now and yes it survives a restart. Still working fine.

Odd. After reinstalling the coronavirus integration and selecting US did also see the entity names changed. Woke up this morning and Wordwide was working and US was showing unavailable. Removed and added again and my lovelace card started up again.

Looks like Broke again.

2020-03-07 14:10:58 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 278, in async_add_entities
    for entity in new_entities
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 275, in <listcomp>
    self._async_add_entity(
  File "/usr/src/homeassistant/homeassistant/components/coronavirus/sensor.py", line 15, in <genexpr>
    for info_type in ("confirmed", "recovered", "deaths", "current")
  File "/usr/src/homeassistant/homeassistant/components/coronavirus/sensor.py", line 30, in __init__
    self.name = f"{coordinator.data[country].country} Coronavirus {info_type}"
TypeError: 'NoneType' object is not subscriptable

Bet if I install AGAIN it will come back. Love this integration but having some minor challenges.

I blame Trump!

Gotta be some kind of conspiracy. Now I can’t even add it back in. I select coronavirus integration and a little window opens probably to pick the location and then the main integration list comes back on top of it and can’t add another one. Pick something else and those seem to work.

AttributeError: 'NoneType' object has no attribute 'values'
2020-03-07 14:45:15 ERROR (MainThread) [aiohttp.server] 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
AttributeError: 'NoneType' object has no attribute 'values'

Maybe try another one.
I think the data sources change now that there’s more traffic.

Thanks was just about to try this and Worldwide started working again. So tried adding my US one back in and worked this time.

image

Ugh, think I’ll just wait and hope things get fixed for a while before finding another integration.

image

Mine is broken as well. Removed integration and upon adding it back it only allows worldwide as a selection option.

which is the polling update interval? Can it be changed?

Quit for me a couple of hours ago. I was able to reinstall it for US, but still “unavailable”.

Edit: It’s back

Coronavirus Integration via NR straight from WHO. Import the below config and change the country name node.

[{"id":"10cbe271.08c8ae","type":"www-request","z":"39d45ee1.7a82b2","name":"","method":"GET","ret":"txt","url":"https://services.arcgis.com/5T5nSi527N4F7luB/arcgis/rest/services/COVID_19_CasesByCountry(pt)_VIEW/FeatureServer/0/query?f=json&where=1%3D1&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields=*&orderByFields=cum_conf%20desc&resultOffset=0&resultRecordCount=115&cacheHint=true","follow-redirects":true,"persistent-http":true,"tls":"","x":510,"y":200,"wires":[["4e4d99e0.686f28"]]},{"id":"b15d752e.3c4af8","type":"inject","z":"39d45ee1.7a82b2","name":"","topic":"","payload":"","payloadType":"date","repeat":"1800","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":200,"wires":[["6e45df48.472e5"]]},{"id":"4e4d99e0.686f28","type":"json","z":"39d45ee1.7a82b2","name":"Convert to object","property":"payload","action":"","pretty":false,"x":730,"y":200,"wires":[["cbb8b069.848d5"]]},{"id":"cbb8b069.848d5","type":"function","z":"39d45ee1.7a82b2","name":"calculate","func":"obj = msg.payload;\ncountry = flow.get(\"country\");\nvar errorProp = 'error';\nif(obj.hasOwnProperty(errorProp)){\n    msg.payload = {'total_cases': '0', 'total_death': '0', 'total_cases_country': '0', 'total_cases_country_death': '0'}\n}\nelse\n{\n    total_cases = 0;\n    total_death = 0;\n    total_cases_country = 0;\n    total_cases_country_death = 0;\n    \n    for (const key of obj.features) \n    {   total_cases = total_cases + key.attributes.cum_conf;\n        total_death = total_death + key.attributes.cum_death;\n\n        if(key.attributes.ADM0_NAME == country)\n            {\n                total_cases_country = total_cases_country + key.attributes.cum_conf;\n                total_cases_country_death = total_cases_country_death + key.attributes.cum_death;\n            }\n    }\n    msg.payload = {'total_cases': total_cases, 'total_death': total_death, 'total_cases_country': total_cases_country, 'total_cases_country_death': total_cases_country_death}\n}\n\nreturn msg;","outputs":1,"noerr":0,"x":940,"y":200,"wires":[["5967ddab.b63364","be521acc.58ee48","93a9cbb8.aea688","890ca730.2bd008"]]},{"id":"6e45df48.472e5","type":"change","z":"39d45ee1.7a82b2","name":"Country Name","rules":[{"t":"set","p":"country","pt":"flow","to":"INDIA","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":200,"wires":[["10cbe271.08c8ae"]]},{"id":"f1c50216.cdb31","type":"comment","z":"39d45ee1.7a82b2","name":"Fetch COVID19 Cases","info":"","x":140,"y":160,"wires":[]},{"id":"5967ddab.b63364","type":"ha-entity","z":"39d45ee1.7a82b2","name":"Covid19 Wordwide","server":"82494656.b2ac98","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Covid19 Wordwide Cases"},{"property":"device_class","value":"none"},{"property":"icon","value":"mdi:biohazard"},{"property":"unit_of_measurement","value":""}],"state":"payload.total_cases","stateType":"msg","attributes":[{"property":"name","value":"covid19","valueType":"str"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1190,"y":80,"wires":[[]]},{"id":"be521acc.58ee48","type":"ha-entity","z":"39d45ee1.7a82b2","name":"Covid19 Wordwide Deaths","server":"82494656.b2ac98","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Covid19 Wordwide Deaths"},{"property":"device_class","value":"none"},{"property":"icon","value":"mdi:emoticon-dead"},{"property":"unit_of_measurement","value":""}],"state":"payload.total_death","stateType":"msg","attributes":[{"property":"name","value":"covid19_death","valueType":"str"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1220,"y":140,"wires":[[]]},{"id":"93a9cbb8.aea688","type":"ha-entity","z":"39d45ee1.7a82b2","name":"Covid19 Country Specific","server":"82494656.b2ac98","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Covid19 India Cases"},{"property":"device_class","value":"none"},{"property":"icon","value":"mdi:biohazard"},{"property":"unit_of_measurement","value":""}],"state":"payload.total_cases_country","stateType":"msg","attributes":[{"property":"name","value":"covid19_india","valueType":"str"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1210,"y":200,"wires":[[]]},{"id":"890ca730.2bd008","type":"ha-entity","z":"39d45ee1.7a82b2","name":"Covid19 Country Specific Deaths","server":"82494656.b2ac98","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"Covid19 India Deaths"},{"property":"device_class","value":"none"},{"property":"icon","value":"mdi:emoticon-dead"},{"property":"unit_of_measurement","value":""}],"state":"payload.total_cases_country_death","stateType":"msg","attributes":[{"property":"name","value":"covid19_india_death","valueType":"str"}],"resend":true,"outputLocation":"","outputLocationType":"none","inputOverride":"allow","x":1240,"y":260,"wires":[[]]},{"id":"82494656.b2ac98","type":"server","z":"","name":"Home Assistant"}]

image

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?