I created a User-Defined Plugin for Meteobridge that reads PM2.5 data from an existing Purpleair station, and publishes calculated U.S. EPA Air Quality Index values as a separate Meteobridge station.
Features
The plugin provides:
- Instantaneous PM2.5 AQI-equivalent
- EPA particulate NowCast AQI
- Current PM2.5 concentration
- NowCast PM2.5 concentration
- Numeric EPA air-quality category
- Optional EPA U.S.-wide PurpleAir correction
- Stale and invalid sensor-data rejection
- Plugin health and error reporting
- Persistent history for NowCast calculations
- EPA 2024 PM2.5 AQI breakpoints
Supported Meteobridge Platforms
This plugin was developed under Meteobridge VM edition.
This release requires a Meteobridge platform with a local scripts directory and writable local storage.
Supported platforms:
- Meteobridge PRO, including the original red and black models
- Meteobridge PRO2
- Meteobridge NANO SD
- Meteobridge Raspberry Pi
- Meteobridge VM
- Original TP-Link, D-Link, or other router hardware flashed with Meteobridge
- Meteobridge NANO without the SD storage option
There is no single-file or URL-only edition.
Installation
No installer, service, cron job, or /root/datafeed modification is required.
You can download the code at https://github.com/AZChris83/MBPurpleAirAQI
Make configuration adjustments as needed and detailed below in meteobridge-aqi.conf FIRST
Then, copy these two files into the Meteobridge scripts directory:
Code: Select all
meteobridge-aqi.plugin
meteobridge-aqi.conf
- Open the Meteobridge Weather Station configuration.
- Add an additional station.
- Select User-Defined Plugin as the station type.
- Select meteobridge-aqi.plugin.
- Save the configuration.
- Restart the station process if requested.
PM2.5 Source Configuration
For a PurpleAir connected as Meteobridge Station 1:
Code: Select all
SOURCE_STATION=1
PM25_SENSOR="air1pm"
Code: Select all
air1!1pm
A fully qualified sensor name can also be entered directly:
Code: Select all
PM25_SENSOR="air1!1pm"
The plugin publishes:
- data0num: Instantaneous AQI-equivalent
- data1num: EPA NowCast AQI
- data2num: AQI category code
- data3num: Current PM2.5 concentration
- data4num: NowCast PM2.5 concentration
- data5num: Plugin status code
Category codes:
Code: Select all
0 = Good
1 = Moderate
2 = Unhealthy for Sensitive Groups
3 = Unhealthy
4 = Very Unhealthy
5 = Hazardous
Code: Select all
0 = Healthy
1 = PM2.5 source missing, invalid, stale, or unreachable
2 = Humidity unavailable while PurpleAir correction requires it
3 = Configuration or storage error
EPA 2024 PM2.5 Breakpoints
Code: Select all
PM2.5 µg/m³ AQI Category
0.0 to 9.0 0 to 50 Good
9.1 to 35.4 51 to 100 Moderate
35.5 to 55.4 101 to 150 Unhealthy for Sensitive Groups
55.5 to 125.4 151 to 200 Unhealthy
125.5 to 225.4 201 to 300 Very Unhealthy
225.5 to 325.4 301 to 500 Hazardous
PurpleAir Correction
The optional EPA U.S.-wide PurpleAir correction is disabled by default. It should only be enabled when the selected field is raw PurpleAir PM2.5 CF=1 data.
If PurpleAir or Meteobridge has already corrected the selected value, enabling the plugin correction would apply it twice and produce an incorrect result.
Requirements
- A supported Meteobridge platform
- User-Defined Plugin station support
- An existing PM2.5 sensor visible to Meteobridge
- A local scripts directory
- Writable local storage
- POSIX shell and awk
- curl or wget
- No Python dependency
The instantaneous result is an AQI-equivalent based on the latest PM2.5 measurement. It is not the official EPA 24-hour AQI.
EPA NowCast is generally the better value for representing current health conditions because it uses weighted hourly averages.
This plugin is not a regulatory monitor. Results may differ from AirNow because of sensor hardware, placement, correction methods, quality control, and averaging periods.
The plugin is released under the MIT License - AI did assist in programming this plugin FYI.
ENJOY!
