0.106.3: Coronavirus integration (COVID-19), track the outbreak

OK, I understand that as I believe the data comes from John Hopkins. One would think that they would still be carrying the US current case count. From what I gathered a couple of days ago the recovered cases has been dropped from the integration, but that doesn’t explain why current cases just disappeared several months ago as well. More puzzling is that there doesn’t seem to be others with this issue as I would expect there are a lot of US users using it. ???

I am seeing unknown for current and recovered for Australia and unknown for world. It was working a week ago.

Its been broken for quite a while. :sob:

1 Like

Hi folks, there are a couple custom solutions in the thread below while we are waiting for the official integration to get fixed (if ever).

1 Like

@scstraus, Thanks for the alternate solution! I will add this.

1 Like

Hi all

the solution proposed above by @scstraus works. However, the API which scrapes data from worldometers.info does not factor in that countries are ranked based on some criteria, which leads to country-specific json queries (e.g. https://covid-19-apis.herokuapp.com/update/country/23) to point towards a different country when such a displacement occurs.

The snippet below uses the all countries aggregate endpoint (https://covid-19-apis.herokuapp.com/allUpdate) and finds the correct country. So far, it appears to work. If you want to get data for another country, simply substitute ‘world’ with a country of your choice. You can also add additional attributes from the json response if that’s your thing.

rest:
  - scan_interval: 3600
    resource: https://covid-19-apis.herokuapp.com/allUpdate
    timeout: 60
    sensor:
      - name: covid_world
        json_attributes_path: '$.[?(@["Country,_Other"]=="World")]'
        json_attributes:
          - Active_Cases
          - New_Cases
          - Total_Cases
          - Total_Recovered
          - Total_Deaths
        value_template: 'Covid World'
      - name: covid_world_active_cases
        value_template: '{{ states.sensor.covid_world.attributes["Active_Cases"] | replace(",","")| int | round(0) }}'
        unit_of_measurement: '#'
      - name: covid_world_new_cases
        value_template: '{{ states.sensor.covid_world.attributes["New_Cases"] | replace(",","")| int | round(0) }}'
        unit_of_measurement: '#'
      - name: covid_world_total_cases
        value_template: '{{ states.sensor.covid_world.attributes["Total_Cases"] | replace(",","")| int | round(0) }}'
        unit_of_measurement: '#'
      - name: covid_world_total_recovered
        value_template: '{{ states.sensor.covid_world.attributes["Total_Recovered"] | replace(",","")| int | round(0) }}'
        unit_of_measurement: '#'
      - name: covid_world_total_deaths
        value_template: '{{ states.sensor.covid_world.attributes["Total_Deaths"] | replace(",","")| int | round(0) }}'
        unit_of_measurement: '#'

Combine this with the covid vaccination tracker here: COVID-19 Vaccination Tracker - #9 by Florian.Schmidt and you can have all the info you need.

3 Likes

Nice find @hfalev. So far the reordering has only happened once to me, but I will be glad to not have it happen again :wink: .

Indeed, for countries further down the list it happens quite often resulting in some very jittery plots.

Has the covid tracker gone offline and is there a backup source for this info? Does anyone maintain the Heroku page?

I found it to be quite dead, and no one wants to support that integration anymore… I ended up writing my own simple tracker for the USA, maybe you will find this useful?

-Jim

this didnt age well

Please do not revive a thread to start an argument. @roussell do not respond. Thanks.

1 Like

What is your *.yaml configuration?

my yaml already included?

So you only have it installed Coronavirus (COVID-19) integration and the selected country of Indonesia and the Worldwide?

do you have any additional settings in the * .yaml (configuration or sensor) file?

You need to have additional settings under the sensors!

sensor.worldwide_corona_percentage_recovered
sensor.worldwide_corona_percentage_deceased
sensor.worldwide_corona_percentage_infected

and so on with other sensors. In configuration.yaml under sensor:
Or you have a special sensor.yaml file and settings in it.

Some make inferences based on data (what, why, and where the matter goes). People who have done their doctorates in pubs, hairdressers, psychiatrists, etc. And they firmly believe that the earth is flat, for the reason that they cannot fly. How to help such people if they do not want help?

Let’s keep it on topic please

2 Likes

With all due respect this thread is titled “Coronavirus”.

Are you saying that talking about coronavirus is not appropriate ? ,

I’m new to the HA forum but is this really how tight and regulated it is… ? Wow…

No personal views or comments allowed. ?

Do you live in the UK or China … Really ?