While the existing coronavirus integration in HA is really helpful to pull in data for countries, the source it’s pulling its data from does not provide granularity down to county or even state level for Germany. At least for the state of Hessen however the Hessisches Ministerium für Soziales und Integration (ministry of social affairs) provides the data on their website.
So I sat down and wrote my first integration ever, “Coronavirus Hessen”, copying heavily from the existing integration and the web scraper component:
Installation instructions are in the README, HACS works too if you add the repo as a custom repository.
Maybe this helps someone else
Like the official integration you can create sensors for all of Hessen or individual counties as listed on the ministry’s page, via HA’s own Integrations menu. It uses one updater for all configured sensors, with a scan interval of 12h, since the ministry only updates the page once per day anyhow and I didn’t want to cause too much traffic with polling. I’ll see how well that works in practice, I might yet change it to 6h or something.
Also, since this is my first integration, I’m happy for any kind of pointers on how to do things better where possible. I’m taking this as an opportunity to learn the ropes around HA development as well I would be especially interested into any hints regarding the two TODO items I listed in the README