AirGradient Forum

Announcement: airgradient-to-influx

I’ve written a Python script to read data from the Airgradient local API and transfer it to InfluxDB. I realize most people are using Home Assistant for this purpose, however that’s not something I’m running at the moment. I have also seen a few efforts where the InfluxDB send capability is added to the device firmware itself. That looks nice and minimal, however I haven’t been working with Arduino before and so it looked more complex to set up and maintain. This Python script can run anywhere in your local network you can install Python. (I’m using a NAS at the moment.)

The repository also includes a Grafana dashboard that can be imported to display the data.

I’d love any feedback that people might have on the script or the dasbhoard.

Regarding the script, one question I have is about appropriate sampling and averaging times. The script can be configured to collect samples every period seconds and average and upload to Influx every n samples. What are reasonable values here? For now I’m running with a 10-second sampling interval and averaging over 5 minutes. I have the impression that the particle values jump around a lot while the 10 seconds is overkill for everything else.

Also regarding particle values, there are quite many provided on the local API. The PM 2.5 compensated value is considered the most important so I include that. But for the others I elected to save only the count values as it wasn’t clear what the difference between ‘atmospheric’ and ‘standard’ is and what should be done about it. When plotting in Grafana from my environment it’s clear that the small particle counts (0.3 and 1 µm) track closely with one another while the 5 and 10 µm are showing a low signal to noise ratio. It’s been mentioned that the Plantower 5003 sensor is not the most reliable for 10 µm particles but I still want to see whether anything changes if things get really dusty at some point.

Thanks to the Airgradient team for providing a solid device with an open, documented API for getting the data!