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

This is a topic about the 0.106 release, which includes an integration for tracking COVID-19 statistics. It’s not a forum for posting your views on the pandemic. It is a forum with a code of conduct that excludes personal attacks, such as the ones you posted.

4 Likes

Hello. Does anyone happen to know how to retrieve data from this site as a sensor? Perhaps for the parameters below for Slovenia. Thanks

https://covid-19-apis.herokuapp.com/allUpdate

{"Active_Cases/1M_pop":"8,647","#":"70","Total_Deaths":"5,603","Total_Tests":"2,083,466","New_Cases/1M_pop":"","Tot_Cases/_1M_pop":"224,373","1_Death_every_X_ppl":"371","New_Recovered":"","Continent":"Europe","New_Deaths/1M_pop":"","Deaths/_1M_pop":"2,695","1_Case_every_X_ppl":"4","New_Cases":"","Active_Cases":"17,980","Serious,_Critical":"173","Country,_Other":"Slovenia","Population":"2,079,367","Total_Cases":"466,554","Tests/_1M_pop":"1,001,971","New_Deaths":"","1_Test_every_X_ppl":"1","Total_Recovered":"442,971"},

I found a solution. Only the prime is not over yet.

#======================================        
#                         Covid-19 Svet
#======================================
  - platform: rest
    name: covid_world
    resource: https://covid-19-apis.herokuapp.com/allUpdate
    json_attributes_path: '$.[?(@["Country,_Other"]=="World")]'
    json_attributes:
      - Active_Cases
      - New_Cases
      - Total_Cases
      - Total_Recovered
      - Total_Deaths
      - Total_Tests
      - 1_Death_every_X_ppl
      - New_Recovered
      - New_Deaths
      - Deaths
      - 1_Case_every_X_ppl
      - Serious,_Critical
      - Population
      - Tests/_1M_pop
      - 1_Test_every_X_ppl
    value_template: 'Covid-19 Svet'

  - platform: template
    sensors:
      covid_world_active_cases:
        value_template: '{{ states.sensor.covid_world.attributes["Active_Cases"] | replace(",","")| int | round(0) }}'
        unit_of_measurement: ' '
      covid_world_new_cases:
        value_template: '{{ states.sensor.covid_world.attributes["New_Cases"] | replace(",","")| int | round(0) }}'
        unit_of_measurement: ' '
      covid_world_total_cases:
          value_template: '{{ states.sensor.covid_world.attributes["Total_Cases"] | replace(",","")| int | round(0) }}'
          unit_of_measurement: ' '
      covid_world_total_recovered:
          value_template: '{{ states.sensor.covid_world.attributes["Total_Recovered"] | replace(",","")| int | round(0) }}'
          unit_of_measurement: ' '
      covid_world_total_deaths:
          value_template: '{{ states.sensor.covid_world.attributes["Total_Deaths"] | replace(",","")| int | round(0) }}'
          unit_of_measurement: ' '

Hi all, it looks like the covid-19-apis.herokuapp.com api is dead now… Is there any other alternative or is it time to give up on tracking covid finally?

Maybe time to forget the whole covid era :stuck_out_tongue:

2 Likes

What is this “covid” thing that you are talking about? :wink:

4 Likes