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

temp2

I went for the same approach with Custom Mini Graph Card roo

Below is lovelace code if anyone interested.

cards:
  - cards:
      - animate: true
        icon: 'mdi:allergy'
        decimals: 0
        entities:
          - entity: sensor.worldwide_coronavirus_confirmed
            name: Confirmed
            color: green
          - entity: sensor.worldwide_coronavirus_current
            name: Current
            color: blue
          - entity: sensor.worldwide_coronavirus_recovered
            name: Recovered
            color: pink
          - entity: sensor.worldwide_coronavirus_deaths
            name: Deaths
            color: red
        extrema: true
        font_size: 100
        font_size_header: 15
        hour24: true
        hours_to_show: 240
        line_color: '#E53935'
        name: Worldwide Corona
        points_per_hour: 5
        show:
          fill: fade
          points: false
        type: 'custom:mini-graph-card'
      - animate: true
        icon: 'mdi:allergy'
        decimals: 0
        entities:
          - entity: sensor.uk_coronavirus_confirmed
            name: Confirmed
            color: green
          - entity: sensor.uk_coronavirus_current
            name: Current
            color: blue
          - entity: sensor.uk_coronavirus_recovered
            name: Recovered
            color: pink
          - entity: sensor.uk_coronavirus_deaths
            name: Deaths
            color: red
        extrema: true
        font_size: 100
        font_size_header: 15
        hour24: true
        hours_to_show: 240
        line_color: '#E53935'
        name: UK Corona
        points_per_hour: 5
        show:
          fill: fade
          points: false
        type: 'custom:mini-graph-card'
    type: horizontal-stack
type: vertical-stack
7 Likes

The covid tracker is kinda useless in some countries. Here in the Czech Republic, it gave me 4 confirmed patients yesterday, 52 today and now down to 1. That’s clearly wrong.

First confirmed case in Slovakia

Just for information: the interesting relation is total confirmed to recovered. As long as the increase of total confirmed is higher then recovered, we are in a situation getting worse. The peak is reached, when the number of recovered people is same then new confirmed. You can watch the chinese totals. The total recovered is getting nearer to the total confirmed. They seem to have reached the peak and the situation is getting under control.
Just my 2 cents

Maybe a bit off topic, but i think it’s good that we all look at the bigger picture too:

1 Like

I really like this Corona Virus integration, now I don’t have to search online for for an accurate count.

But I wish the sensor came with some historical data from the last couple months.

2 Likes

How do you add thousands separator to a sensor value? For readability purposes, of course.

2 Likes

Here is my attempt for worldwide and some countries

For me the integration only works a few hoursand then I get unavailable 


This entity is currently unavailable and is an orphan to a removed, changed or dysfunctional integration or device.
If the entity is no longer in use, you can clean it up by removing it.

No idea, but if you find it I’d love to do it too.

Or it could be condense down like, 100,645 could just be 101k

1 Like

Will you share the code?

1 Like

what type element you use?

I like your theme. Can you share some more pictures of your lovelace?

@maurizio53 @poudenes

Here is the code for one graph, you have to duplicate to the other three

- type: entities
  title: Coronavirus COVID-19
  entities:
    - type: 'custom:hui-horizontal-stack-card'
      style:
          "div":
            mini-graph-card:
              $: |
                ha-card {
                  border: 1px solid var(--dark-primary-color);
                }
      cards:
        - type: 'custom:mini-graph-card'
          name: Confirmados
          style: |
            .state__time {
              display: none;
            }
          entities:
            - entity: sensor.worldwide_coronavirus_confirmed
              name: Total
            - entity: sensor.mainland_china_coronavirus_confirmed
              name: China
            - entity: sensor.italy_coronavirus_confirmed
              name: ItĂĄlia
            - entity: sensor.france_coronavirus_confirmed
              name: França
            - entity: sensor.spain_coronavirus_confirmed
              name: Espanha
            - entity: sensor.portugal_coronavirus_confirmed
              name: Portugal
          unit: pessoas
          font_size_header: 11
          font_size: 60
          bar_spacing: 8
          height: 120
          aggregate_func: last
          fixed_value: true
          group_by: date
          show:
            graph: bar
            icon: false
            legend: false
            average: false
            extrema: false
            labels: false
            labels_secondary: false 
            
            ## CONTINUE ADDING AS MANY GRAPHS YOU WANT
1 Like

Where did you get : hui-horizontal-stack-card ?

Honestly I don’t know. Maybe it’s part of HA core

This is a trick to use core cards (horizontal-stack) as an entity in a entities card.
But i think this will no longer work in the future.
https://github.com/home-assistant/frontend/issues/4984
The change was reverted in 0.106.x, but will probably come back in 0.107.x :slightly_frowning_face:

Please let me tell you about my opinion of the bigger picture. In my “advanced democratic universal health coverage european” country (more or less what we would expect to be the ideal condition) there are currently 16 million people that have been confined in their neighbourhood and I expect that number to swell very quickly. Schools are closed for two weeks but I am sure that will be prolonged to at least the end of March. Families are stuck, social contacts are awkward to say the least and the impact on economy is already felt very hard.
I think the “just another flu” or “look at the bigger picture” (why didn’t that video include the great Permian extinction and the mega asteroids which wiped out dinoasaurs? :slight_smile: :slight_smile: are minimizing a huge medical (speaking as a medical doctor), social and economical problem and the fake sense of security is a big part of why this pandemic is spreading so far.

4 Likes

Off topic but, WHAT!

I have just written a huge user interface that relies on this!
Is it really not going to work in future?
Is there an alternative?

Sure!

Here’s my yaml for these Coronavirus card stacks. It’s two different card 1. World 2. US Only

cards:
  - cards:
      - entities:
          - entity: sensor.us_coronavirus_confirmed
            name: Confirmed Cases
        hours_to_show: 68
        icon: 'mdi:biohazard'
        line_color: '#B4A0FF'
        name: Confirmed Cases
        show:
          icon: true
          icon_adaptive_color: true
          labels: false
        type: 'custom:mini-graph-card'
    type: horizontal-stack
  - cards:
      - entities:
          - entity: sensor.us_coronavirus_current
            name: Current
        font_size: 75
        hours_to_show: 68
        icon: 'mdi:biohazard'
        line_color: '#B4A0FF'
        line_width: 8
        name: Current
        show:
          icon: false
        type: 'custom:mini-graph-card'
      - entities:
          - entity: sensor.us_coronavirus_recovered
            name: Recovered
        font_size: 75
        hours_to_show: 68
        icon: 'mdi:biohazard'
        line_color: '#00BA72'
        line_width: 8
        name: Recovered
        show:
          icon: false
        type: 'custom:mini-graph-card'
      - entities:
          - entity: sensor.us_coronavirus_deaths
            name: Deaths
        font_size: 75
        hours_to_show: 68
        icon: 'mdi:biohazard'
        line_color: '#F56476'
        line_width: 8
        name: Deaths
        show:
          icon: false
        type: 'custom:mini-graph-card'
    type: horizontal-stack
title: Corona Virus (USA)
type: vertical-stack
4 Likes