Note: Please, be aware that this post may contain affiliate links.
Thanks to the wonderful Folks at Home Assistant, you can now follow the progress of the Coronavirus in Home Assistant.
In this post, I’m going to show you an easy way and an easier way to display Coronavirus data for your country. Then you can keep an eye on those figures.
This is thanks to the other group of people responsible at the Johns Hopkins University.
The special integration is part of update 0.106.3, more details on it can be found on the Home Assistant Blog
You may notice that in some of the images my entities go like “sensor.uk_confirmed” instead of “sensor.uk_coronavirus_confirmed”. This is due to the updates in 0.106.4
Step 1: Add the integration
In this post, I’m going to show you how to set up the data and show you a couple of ways to display it.
Go to the Configuration page in your instance of Home Assistant, and click on “Integrations”.
Then click on the plus icon in the lower right corner, and search for the “Coronavirus” integration.
You can then either find your country or select “Worldwide” at the top, in order to get global figures. Once that’s done you will then receive the notification saying the integration was added successfully.
Step 2: Add the card
The easy option
Click on the plus icon to add a card.
If it’s just the stats your interested in, and you’re happy with the default presentation, then select the “Glance” card type.
Type “sensor.worldwide_coronavirus_” for the worldwide stats in the entities box for the worldwide stats (obviously). Or if you’re after your country then replace “worldwide” with your country code, for example, here in the UK it would be “sensor.uk_coronavirus_” (although I have used the US in the screenshots).
You have 4 statistics available to you: they are
- Confirmed cases eg sensor.uk_coronavirus_confirmed
- Current cases eg sensor.uk_coronavirus_current
- Deaths eg sensor.uk_coronavirus_deaths
- Recovered eg sensor.uk_coronavirus_recovered
Then add the same for as many countries as you added integrations.
I have gone for a more aesthetically pleasing layout, and no doubt others will pass the figures through to InfluxDB and Grafana for charts (let me know if you want me to go through this option also).
Instead of going for the “Glance” card, select “Manual card”
You can see that the icons I have used are the same ones that are in the Home Assistant Blog post linked to at the top of the page.
I have also added sections with labels instead of having several titles and/or verbose labels on the entities themselves
type: 'custom:vertical-stack-in-card' title: Coronavirus cards: - type: entities entities: - type: section label: United Kingdom - type: glance entities: - entity: sensor.uk_coronavirus_confirmed name: Confirmed icon: 'mdi:emoticon-neutral-outline' - entity: sensor.uk_coronavirus_current name: Current icon: 'mdi:emoticon-frown-outline' - entity: sensor.uk_coronavirus_deaths name: Deaths icon: 'mdi:emoticon-sad-outline' - entity: sensor.uk_coronavirus_recovered name: Recovered icon: 'mdi:emoticon-happy-outline' - type: entities entities: - type: section label: Worldwide - type: glance entities: - entity: sensor.worldwide_coronavirus_confirmed name: Confirmed icon: 'mdi:emoticon-neutral-outline' - entity: sensor.worldwide_coronavirus_current name: Current icon: 'mdi:emoticon-frown-outline' - entity: sensor.worldwide_coronavirus_deaths name: Deaths icon: 'mdi:emoticon-sad-outline' - entity: sensor.worldwide_coronavirus_recovered name: Recovered icon: 'mdi:emoticon-happy-outline' columns: 4 show_icon: true show_state: true
You can also see that I have used the “Vertical Stack In Card”, by the brilliant 16-year-old developer Ofek Ashery (Twitter link), which can be found at https://github.com/ofekashery/vertical-stack-in-card and can be added through HACS.
Step 3: Tidy up
I may even go 1 step further and remove the “people” unit of measurement, but that is for later.