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

+1 I’m also interested in the daily numbers.

Hi @dicko @schumi2004 , here’s how I do daily numbers and display with a custom lovelace card:

Step 1) Install custom hass-variables component, probably with HACS
Step 2) Define variables
Step 3) Make automations to save yesterday’s numbers to variables
(You now have the daily numbers in the variables, you can continue if you want the lovelace card)
Step 4) Install custom text element
Step 5) Add this transparent image to your www/images directory
Step 6) Add lovelace card
Step 7) Remove units on active cases number:
in customize.yaml:

sensor.czechia_coronavirus_current:
unit_of_measurement: 

(Of course, change the name to the name of your sensor.)

Step 8) See if it works with Czech numbers (takes 48 hours to calculate all the numbers)
Step 9) Customize for your country/theme

Et voila:
image

2 Likes

Revamp my corona info…

type: vertical-stack
cards:
  - type: horizontal-stack
    cards:
      - entities:
          - entities:
              - entity: sensor.worldwide_corona_percentage_recovered
                name: Recovered
              - entity: sensor.worldwide_corona_percentage_deceased
                name: Deaths
            entity: sensor.worldwide_corona_percentage_infected
            icon: 'mdi:biohazard'
            name: false
            state_header: Infected
            type: 'custom:multiple-entity-row'
        show_header_toggle: false
        title: Covid Infection Worldwide
        type: entities
  - type: horizontal-stack
    cards:
      - type: glance
        entities:
          - entity: sensor.worldwide_coronavirus_current_dot_separated
            name: Current
            icon: 'mdi:virus'
          - entity: sensor.worldwide_coronavirus_confirmed_dot_separated
            name: Confirmed
            icon: 'mdi:biohazard'
          - entity: sensor.worldwide_coronavirus_deaths_dot_separated
            name: Deaths
            icon: 'mdi:grave-stone'
          - entity: sensor.worldwide_coronavirus_recovered_dot_separated
            name: Recovered
            icon: 'mdi:shield-check'
  - type: horizontal-stack
    cards:
      - type: horizontal-stack
        cards:
          - type: horizontal-stack
            cards:
              - entities:
                  - entity: sensor.worldwide_coronavirus_current
                    color: yellow
                hours_to_show: 48
                points_per_hour: 1
                type: 'custom:mini-graph-card'
                show:
                  state: false
                  name: false
                  icon: false
          - type: horizontal-stack
            cards:
              - entities:
                  - entity: sensor.worldwide_coronavirus_confirmed
                hours_to_show: 48
                points_per_hour: 1
                type: 'custom:mini-graph-card'
                show:
                  state: false
                  name: false
                  icon: false
          - type: horizontal-stack
            cards:
              - entities:
                  - entity: sensor.worldwide_coronavirus_deaths
                    color: red
                hours_to_show: 48
                points_per_hour: 1
                type: 'custom:mini-graph-card'
                show:
                  state: false
                  name: false
                  icon: false
          - type: horizontal-stack
            cards:
              - entities:
                  - entity: sensor.worldwide_coronavirus_recovered
                    color: green
                hours_to_show: 48
                points_per_hour: 1
                type: 'custom:mini-graph-card'
                show:
                  state: false
                  name: false
                  icon: false
  - type: horizontal-stack
    cards:
      - entities:
          - entities:
              - entity: sensor.indonesia_corona_percentage_recovered
                name: Recovered
              - entity: sensor.indonesia_corona_percentage_deceased
                name: Deaths
            entity: sensor.indonesia_corona_percentage_infected
            icon: 'mdi:biohazard'
            name: false
            state_header: Infected
            type: 'custom:multiple-entity-row'
        show_header_toggle: false
        title: Covid Infection indonesia
        type: entities
  - type: horizontal-stack
    cards:
      - type: glance
        entities:
          - entity: sensor.indonesia_coronavirus_current_dot_separated
            name: Current
            icon: 'mdi:virus'
          - entity: sensor.indonesia_coronavirus_confirmed_dot_separated
            name: Confirmed
            icon: 'mdi:biohazard'
          - entity: sensor.indonesia_coronavirus_deaths_dot_separated
            name: Deaths
            icon: 'mdi:grave-stone'
          - entity: sensor.indonesia_coronavirus_recovered_dot_separated
            name: Recovered
            icon: 'mdi:shield-check'
  - type: horizontal-stack
    cards:
      - type: horizontal-stack
        cards:
          - type: horizontal-stack
            cards:
              - entities:
                  - entity: sensor.indonesia_coronavirus_current
                    color: yellow
                hours_to_show: 48
                points_per_hour: 1
                type: 'custom:mini-graph-card'
                show:
                  state: false
                  name: false
                  icon: false
          - type: horizontal-stack
            cards:
              - entities:
                  - entity: sensor.indonesia_coronavirus_confirmed
                hours_to_show: 48
                points_per_hour: 1
                type: 'custom:mini-graph-card'
                show:
                  state: false
                  name: false
                  icon: false
          - type: horizontal-stack
            cards:
              - entities:
                  - entity: sensor.indonesia_coronavirus_deaths
                    color: red
                hours_to_show: 48
                points_per_hour: 1
                type: 'custom:mini-graph-card'
                show:
                  state: false
                  name: false
                  icon: false
          - type: horizontal-stack
            cards:
              - entities:
                  - entity: sensor.indonesia_coronavirus_recovered
                    color: green
                hours_to_show: 48
                points_per_hour: 1
                type: 'custom:mini-graph-card'
                show:
                  state: false
                  name: false
                  icon: false
2 Likes

Nice @KingRichard! Fancy sharing the YAML?

how do i get the new confirmed cases within the last 24h or since the last update (wich is equal cause they update once a day)? i tried using trigger_from wich doesn’t work no do i have a plan to save the actual number becoming yesterdays number to calculate it.

That’s worked for me:

  - platform: statistics
    name: covid
    entity_id: sensor.bulgaria_coronavirus_confirmed
    sampling_size: 20000000
    max_age:
      hours: 43
  - platform: template
    sensors:
      covid_today:
        value_template: '{{ state_attr("sensor.covid","change")|int }}'
        friendly_name: 'CovID today'
1 Like

Tnx Pavel, it works. I didn’t see the possibility to solve this over the statistics, you opened my eyes. greetings, chris

I’ve been using the COVID-19 integration since shortly after it was first release. I’ve only ever had it configured to follow the US and everything worked fine until about a month or so ago when the current and recovered sensors went “unknown”. I have secondary sensors that formats all 4 of the provided sensors, but the actual provided for those two have stopped working. Am I the only one seeing this as it seems those values are not being provided. I’ve tried deleting and re-adding the integration, but it’s still the same.

State: unknown
attribution: Data provided by Johns Hopkins
unit_of_measurement: people
friendly_name: US Coronavirus current
icon: 'mdi:emoticon-sad-outline'

State: unknown
attribution: Data provided by Johns Hopkins
unit_of_measurement: people
friendly_name: US Coronavirus recovered
icon: 'mdi:emoticon-happy-outline'
2 Likes

Same thing happened to me. Let me know if you find a solution!

I haven’t gotten any new data on my sensors in the last 48 hours, even though it’s been updated on the Johns Hopkins site to include new data. Anyone else?

Same here. No new data for 3 days now.

Same here as well.

Also no (particular) new data for last days with custom data retrieval via Coronatracker api (only US, India, Russia, Brazil).
Go figure…
So I guess that problem is not on HA side as two data providers exhibit the same pattern :frowning:
Best, JR
PS This is the latest I got on my selection (last column is date):
COVID_bad_data

Started working again today.

Anyone else? Still not working for me and it’s been this way for months. Still the same as I posted in 235 above. :frowning_face:

image
Fine here and the local one is also updating

I’d like to display a daily cases / deaths chart similar to this one within Home Assistant. I have the mini-graph card installed. Could I follow steps 1-3 in @scstraus post and simply display that within?

Yep should work. Though I didn’t know about the statistics component, this looks like it’s more elegant, but I haven’t personally tried it since mine is working already.

Same for me

Here also the sensors say “Unknown”. No updates for me…