Thursday, March 19, 2020

EASY and FAST Corona Virus dashboard in Home Assistant

I had setup the Plex integration for Home Assistant in the traditional way and had planned to try out the new way of integrating through the (vastly) improved interface for a long time. Seeing that there was quite some accumulation of Android Debug Bridge Server errors, wanted to correct that as well. I have to admit that I couldn't make much progress with the Rock64 running on Android TV 7.1 after the latest flashing, though it was working earlier and decided to wait.

For the Plex part, it was quite a breeze. After the setup, the Plex sensor, Plex media player and other mediaplayers connected to Plex were added. Config as below.

  • delete or rename the plex.conf
  • delete the config.yaml entries for plex:
  • remove any integrations
  • add an integration via integrations page.
It looks like this after the integrations were detected.
  

That was quick. Something struck the eye as I was going thru the list of new integrations and there was an item "Coronavirus". Since this is something in everyone's mind, I was curious and added the integration, which asks for the country name and then adds 4 items (confirmed, current, recovered, deaths) in each country as a sensor. The unit is people, of course.

After that, the states page shows 4 new entries, like so:

Added 2 more countries: UAE and Switzerland just for reference coz my brother stays in UAE and Switzerland is where my colleagues are. Now i have 12 sensors, GREAT!

There are various ways to have this in a graph, depending whether if it is on a web dashboard, mobile console or app. The lowest hanging fruit was the lovelace for my consoles running that. It was fairly easy setting up this card. My config below for the confirmed cases in 3 countries.

      - type: history-graph
        title: ''
        hours_to_show: 80
        entities:
          - entity: sensor.india_coronavirus_confirmed
            name: IN
          - entity: sensor.switzerland_coronavirus_confirmed
            name: CH
          - entity: sensor.united_arab_emirates_coronavirus_confirmed
            name: UAE
The dashboard in the mobile app looks useful!

The next plan is to have the Grafana chart pulling info from InfluxDB which offers infinite customization options. A sneak preview of what's cooking. 


No comments: