Using HA to track NSW Covid case and vaccination numbers

The road to 70%

While we all wait for the 70% (80%?) mark to leave our homes again - I thought I would add the stats to our Home Assistant dashboard so we can see New South Wales’ progress.

Be warned

NSW Health does not publish this data in a consumable fashion, so this is using screen scraping - unless somebody can think of a better source for the data.

Use it yourself

All the information is here github/troykelly/homeassistant-au-nsw-covid

2 Likes

The vaccine numbers only represent the vaccines given by NSW Health - the NSW Govt publish more detailed numbers here:

1 Like

hahahaha. That woman is never going to take her jackboot off our throat…

1 Like

Do you think it would be reasonable to just half the number? ie 3,968,811 total doses == (roughly) 1.9M humans vaccinated?

There are these sources too

Thank you @bacco007 - this page had a heap of json embedded in it - a whole heap of the data doesn’t need to be scraped any more. The only problem seems to be the json files are also manually generated, as they have some still old data (not yet up to date)

1 Like

If anybody is interested in building your own integration - the json data sources are listed here:
github/troykelly/python-nswcovid/issues/18

@troykelly FYI - I updated to your latest version (using HA OS) - and it wont install, because for some reason (not your fault), jq wont install in the HA OS environment

2021-08-05 19:20:04 ERROR (SyncWorker_9) [homeassistant.util.package] Unable to install package nswcovid==0.1.1: ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python3 /usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp9efru0iy
       cwd: /tmp/pip-install-2ucy353_/jq
  Complete output (7 lines):
  running bdist_wheel
  running build
  running build_ext
  Downloading https://github.com/kkos/oniguruma/releases/download/v6.9.4/onig-6.9.4.tar.gz
  Downloaded https://github.com/kkos/oniguruma/releases/download/v6.9.4/onig-6.9.4.tar.gz
  Executing: ./configure CFLAGS=-fPIC --prefix=/tmp/pip-install-2ucy353_/jq/_deps/onig-install-6.9.4
  error: [Errno 13] Permission denied: './configure'
  ----------------------------------------
  ERROR: Failed building wheel for jq
ERROR: Could not build wheels for jq which use PEP 517 and cannot be installed directly
WARNING: You are using pip version 20.2.4; however, version 21.2.2 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.

Oh no.

I should have tested outside of the development environment.

I will have to have a look at it tomorrow - apologies!

@bacco007 The latest version removes jq

1 Like

Updated - all working again, thanks!

1 Like

That’s weird because HA OS included jq a long time ago…

Oh - it made it angry… very angry.

Anyway - I learned a new thing - jello - and it’s made it faster than using jq externally.

I just need something to parse a search - because I’m lazy and I’ve built this to be generic so I can change it as they change their pages. I load a data file and then get the relevant data sources, be they HTML, json or text and then search away…

it wont allow you to install the jq python library - there appear to be non-python dependencies missing

1 Like