*Open source plugin for WeeWX software.
A WeeWX plugin that gets its AirLink sensor readings either directly from the AirLink sensor or from a airlink-proxy service.
Copyright (C)2020 by John A Kline ([email protected])
This plugin requires Python 3.7, WeeWX 4 and the wview_extended schema
weewx-airlink requires the wview_extended in WeeWX 4 that contains pm1_0, pm2_5 and pm10_0 columns. With the weewx-airlink extension, Loop records will be populated with pm1_0, pm2_5 and pm10_0 fields that correspond to AirLink's pm_1_last, pm_2p5_last and pm_10_last fields.
In addition to pm1_0, pm2_5 and pm10_0, AQI variables are also available
(even though they are not in the database) via WeeWX 4's
XTypes.
pm2_5_aqi is automatically computed from pm2_5 and can be used in reports
($current.pm2_5_aqi
, $day.pm2_5_aqi
) and in graphs
([[[[pm2_5_aqi]]]
). Also available is
is the RGBint value
$current.pm2_5_aqi_color
(useful for displaying AQI in the appropriate color
(e.g., green for AQIs <= 50).
PM2.5 concentrations are corrected with the US EPA correction for PurpleAir sensors. This is a presumptious decision. The AirLink sensor tracks remarkably well to a like positioned PurpleAir sensor's PM 2.5 atm readings (sample size == 1), but, the EPA correction is based on PM 2.5 cf_1 readings. The AirLink really needs its own EPA correction, but that is not likely to happen any time soon. In practice, at higher concentrations of PM 2.5 particles, the AirLink reports lower levels than the PurpleAir.
The following is an real world example of how well the PM2.5 concentrations track
between PuprleAir's PM 2.5 cf_1 readings and AirLink's PM 2.5 readings. The sensors
are located beside each other.
As of v1.1, the EPA correction is the 2021 version. See: https://www.epa.gov/sites/default/files/2021-05/documents/toolsresourceswebinar_purpleairsmoke_210519b.pdf
The pm1_0
, pm2_5
, pm10_0
, 'pm2_5_aqi' and 'pm2_5_aqi_color' fields are
available for reporting and graphs, the following additional
fields are inserted into loop records (useful for real time updating):
pm1_0_1m
: PM1 1 minute average
pm2_5_1m
: PM2.5 1 minute average
pm10_0_1m
: PM10 1 minute average
pm2_5_1m_aqi
: PM2.5 1m AQI
pm2_5_1m_aqi_color
: PM2.5 1m AQI color
pm2_5_nowcast
: : PM2.5 NowCast
pm2_5_nowcast_aqi
: PM2.5 NowCast AQI
pm2_5_nowcast_aqi_color
: PM2.5 NowCast AQI color
pm10_0_nowcast
: PM10 NowCast
A skin is provided to show a sample report:
If you don't meet the following requirements, do not install this extension.
- WeeWX 4
- Using WeeWX 4's new wview_extended schema.
- Python 3.7 or greater
-
Download the lastest release, weewx-airlink-1.1.zip, from the GitHub Repository.
-
Run the following command.
sudo /home/weewx/bin/wee_extension --install weewx-airlink-1.1.zip
Note: this command assumes weewx is installed in /home/weewx. If it's installed elsewhere, adjust the path of wee_extension accordingly.
-
Edit the
AirLink
section of weewx.conf (which was created by the install above). In particular, change the hostname in the section labeled Sensor1 to be a name resolvable to the IP address of an AirLink sensor or the IP address of an AirLink sensor. More sensors can be specified. For example, to add a second AirLink sensor, enable the Sensor2 section and specify the hostname. There is no limit to how many sensors can be configured; but the numbering must be consecutive. The order in which sensors are interrogated is low numbers to high. Once a sensor replies, no further sensors are interrogated for the current polling round.Note: The port can be specified because this extension also works with the airlink-proxy service. That service typcially uses port 8000.
[AirLink] [[Sensor1]] enable = true hostname = airlink port = 80 timeout = 2 [[Sensor2]] enable = false hostname = airlink2 port = 80 timeout = 2
-
Restart WeeWX
-
To check for a successful install, wait for a reporting cycle, then navigate in a browser to the WeeWX site and add /airlink to the end of the URL (e.g., http://weewx-machine/weewx/airlink). The PM2.5 and AQI graphs will fill in over time.
Note: Although the examples below show the use of $current, aggregates are also
supported (e.g., the high PM2.5 for the week can be presented with $week.pm2_5.max
.
To show the PM2.5 reading, use the following:
$current.pm2_5
To show the Air Quality Index:
$current.pm2_5_aqi
To get the RGBINT color of the current Air Quality Index:
#set $color = int($current.pm2_5_aqi_color.raw)
#set $blue = $color & 255
#set $green = ($color >> 8) & 255
#set $red = ($color >> 16) & 255
To show the PM1.0 reading, use the following:
$current.pm1_0
To show the PM10.0 reading, use the following:
$current.pm10_0
weewx-airlink is licensed under the GNU Public License v3.