Airgradient is an open air quality monitoring solution with DIY offerings utilising an ESP8266 microcontroller.
The example DIY code defaults to sending metrics to Airgradient.
This is a very simple (probably bad!) Flask app to act as a receiver for Airgradient metrics for those who change APIROOT
in the root to point to this app (as long as it's accessible).
Prometheus can then be configured to collect metrics using the exporter at /metrics
.
The app should work with multiple devices.
The metrics received are
atmp
: Temperaturerhum
: Humiditywifi
: Wifi signal strengthpm02
: Particulate Matter (PM2.5)rco2
: CO2
Each metric has an associated label of device_id
to help identify metrics for a specific device.
Run via flask in a local dev environment with eg. DEBUG=true python -m flask --app airgradient --debug run --host 0.0.0.0
.
If you use WSL2 then look at port forwarding to WSL with netsh
.
In project root directory you can build the image with docker -t <tag> build .
then run with eg. docker run -it
.