djjudas21 / ecowitt-exporter

EcoWitt exporter for Prometheus
4 stars 3 forks source link

Add AQI #13

Closed djjudas21 closed 11 months ago

djjudas21 commented 11 months ago

The ecowitt app gives numerical measurements from the WH41 air quality sensor, but it also generates an Air Quality Index (AQI) and a "smiley face" rating system. Only the numerical measurements are made available by the ecowitt base station, so this exporter should generate some indices to export, too.

We should make it clear that this is specifically the PM 2.5 air quality index as the WH41 can't measure other pollutants.

Australia

The ecowitt app seems to calculate the AQI as described by the Australian government in NEPM

The NEPM standard calculates the AQI by

        pollutant reading
AQI =  ---------------------   * 100
            standard

where the reading for PM 2.5 is averaged over 24 hours, and the "standard" reference is 25 µg/m3.

The resultant index is then binned into the following categories:

AQI Category Colour
0-33 Very Good Blue
34-66 Good Green
67-99 Fair Yellow
100-149 Poor Orange
150-200 Very Poor Purple
200+ Hazardous Red

UK

As I'm British, this is the standard I propose making the default in the ecowitt exporter.

There is also a UK standard called DAQI which assigns the index directly based on the concentration of PM 2.5. It also uses a rolling 24-hour average.

Index Band µg/m3 Colour
1 Low 0-11 Light green
2 Low 12-23 Green
3 Low 24-35 Dark green
4 Moderate 36-41 Yellow
5 Moderate 42-47 Amber
6 Moderate 48-53 Orange
7 High 54-58 Pink
8 High 59-64 Red
9 High 65-70 Maroon
10 Very High 71+ Purple