Covid cases and vaccination data sourced directly from New South Wales Health
Track daily changes in the New South Wales health districts.
Visibility in to cases, vaccinations and sources. Sourced directly from NSW Health.
This is not affiliated with, nor approved by NSW Health.
Data is sourced by screen scraping - as NSW Health does not provide this information in any other format.
https://github.com/troykelly/homeassistant-au-nsw-covid
.Integrations
add the NSW Covid
integration
This is a screen scraper. That is not allowed in Home Assistant.
There just is no other way to get this data.
One number that would be great to have is "cases in community" especially in the last 24 hours.
NSW Health does not publish this number. In a press conference, it was stated that the number is too fluid.
If you have a source of extra information that you would like to see - create an issue!
This will create a series of sensors with current NSW Health Covid data.
Keep in mind - NSW Health manually updates their website, when they please. Aunty Gladys does her briefing at 11am, and sometimes the page is not updated until late in the afternoon.
Some numbers are derived from the data. You can calculate these as a template sensor.
A calculation of total cases
- the sum of interstate
and overseas
template:
- sensor:
- name: "Covid NSW Last 24 Hours State"
unique_id: "covid_nsw_last_24_hours_state"
icon: "mdi:virus"
unit_of_measurement: "cases"
state: >
{% set total = states('sensor.covid_nsw_last_24_hours_total') | int %}
{% set overseas = states('sensor.covid_nsw_last_24_hours_overseas_source') | int %}
{% set interstate = states('sensor.covid_nsw_last_24_hours_interstate_source') | int %}
{% set out_of_state = (overseas + interstate) %}
{{ (total - out_of_state) }}
attributes:
attribution: >
{{ state_attr('sensor.covid_nsw_last_24_hours_total', 'attribution') }}
published: >
{{ state_attr('sensor.covid_nsw_last_24_hours_total', 'published') }}
Percentage of NSW population who've had second dose.
Assuming population is 6565651
template:
- sensor:
- name: "Covid NSW Fully Vaccinated"
unique_id: "covid_nsw_state_vaccination_rate"
icon: "mdi:needle"
unit_of_measurement: "%"
state: >
{% set total_population = 6565651 %}
{% set half_dose_total = (states('sensor.covid_nsw_doses') | int) / 2 %}
{% set state_second_dose_vaccinated_total = half_dose_total / total_population %}
{{ (state_second_dose_vaccinated_total * 100)|round(2, 'floor') }}
attributes:
attribution: >
{{ state_attr('sensor.covid_nsw_doses', 'attribution') }}
published: >
{{ state_attr('sensor.covid_nsw_doses', 'gp_network_doses_updated') }}
first_dose: >
{% set total_population = 6565651 %}
{% set first_dose_total = states('sensor.covid_nsw_total_first_dose_vaccine') | int %}
{% set state_first_dose_vaccinated_total = first_dose_total / total_population %}
{{ (state_first_dose_vaccinated_total * 100)|round(2, 'floor') }}
first_dose_last_24_hours: >
{% set total_population = 6565651 %}
{% set first_dose_last24 = states('sensor.covid_nsw_last_24_hours_first_dose_vaccine') | int %}
{% set state_first_dose_vaccinated_last24 = first_dose_last24 / total_population %}
{{ (state_first_dose_vaccinated_last24 * 100)|round(6, 'floor') }}
second_dose: >
{% set total_population = 6565651 %}
{% set second_dose_total = states('sensor.covid_nsw_total_second_dose_vaccine') | int %}
{% set state_second_dose_vaccinated_total = second_dose_total / total_population %}
{{ (state_second_dose_vaccinated_total * 100)|round(2, 'floor') }}
second_dose_last_24_hours: >
{% set total_population = 6565651 %}
{% set second_dose_last24 = states('sensor.covid_nsw_last_24_hours_second_dose_vaccine') | int %}
{% set state_second_dose_vaccinated_last24 = second_dose_last24 / total_population %}
{{ (state_second_dose_vaccinated_last24 * 100)|round(6, 'floor') }}
last_24_hours: >
{% set total_population = 6565651 %}
{% set second_dose_last24 = states('sensor.covid_nsw_last_24_hours_second_dose_vaccine') | int %}
{% set state_second_dose_vaccinated_last24 = second_dose_last24 / total_population %}
{{ (state_second_dose_vaccinated_last24 * 100)|round(6, 'floor') }}
© State of New South Wales NSW Ministry of Health. For current information go to www.health.nsw.gov.au
If you want to contribute to this please read the Contribution guidelines