There’s a daily file I could possibly scrape for data, but I’m curious what the best route in getting this data displayed in HA. The two obstacles I need to overcome, in my opinion are:
- Pointing the data to a new URL depending on the day, due to the format of the JSON file: . https://www.dph.illinois.gov/sites/default/files/COVID19/COVID19CountyResultsYYYYMMDD.json
- Ingesting this data and transforming / reading it into a sensor
It’s a bit trickier than that. I changed the date in that URL to today’s date (20200330) and it failed because they don’t have today’s data ready yet. It works if I use yesterday’s date 20200329. That means you need to download the previous day’s data (which involves some date math).
The second challenge is that the RESTful sensor integration uses json_attributes to extract attributes from the received data and it’s not very flexible, especially given the complexity of this data. That means it limits you to using value_template to acquire one value (that will represent the sensor’s state) from the received data.
Maybe it would be just as useful and maybe easier to grab the map here and put it in an iframe card? Just not sure how to get the source url for the map.
Weird…I don’t see that when I open the page. It’s just a big empty space there. And I didn’t see any reference to it looking in the page source code either.