AirGradient Forum

Calibrated PM2.5 in Home Assistant?

I’m using the AirGradient integration in Home Assistant with two AG One’s and an Open Air. The two AG One’s need batch-specific PMS5003 calibrations. Is there any way to get this calibrated data into home assistant? The PM2.5 data that Home Assistant is getting from the device doesn’t match the AirGradient dashboard data.

Please make sure you have the latest HA and firmware version. As far as I know, the data should match.

I’m on the latest AirGradient firmware (3.2.0 according to the dashboard), and auto-update is selected. Home Assistant is also the latest release.

I’ll upload screenshots for comparison. Annoyingly the forum doesn’t let me attach multiple images to a single post, so I’ll have to make multiple posts. Here’s the AirGradient Dashboard for the last 24 hours:

Here’s the Home Assistant data for the same period:

I’m not sure if I have my settings correct. I do have the right PMS5003 corrections selected in the AirGradient Dashboard, but I don’t have the EPA checkbox selected. I’m not sure if that is needed or if it is recommended. In Home Assistant, I also have the device set to “Local configuration” instead of “Cloud configuration”. I’m not sure if this makes a difference. Here are screenshots of the two configurations:

I’ve also noticed that the home assistant PM2.5 data seems very spikey, with lots of zeros in-between data points. This doesn’t look right to me, compared to the AirGradient dashboard.

Thanks for the help with this issue!

-Mike

I believe you need the ha config set to cloud

As @rpirsc suggested, changing the device’s config so that configurationControl is cloud resulted in the corrections being installed on device and the device’s display switching to the calibrated values.

Looking at the source code for the AirGradient Home Assistant plugin and its corresponding Python client package, it looks like if the device produces a compensated value then the client will automatically use that as the PM2.5 reading. So no additional configuration required in Home Assistant to get the calibrated value.

Ah, so the local server docs suggest that if you’re using the Home Assistant integration the configurationControl setting may be set to local which appears to mean corrections changes you make in the dashboard don’t get applied automatically to the device itself:

If configurationControl is set to local (eg. when using Home Assistant), correction need to be set manually, see examples below

Indeed, my unit is set to local, monitorDisplayCompensatedValues is set to false and there don’t appear to be any correction algorithms configured.

I’m wondering something similar: how can I get the Plantower calibration applied to the data displayed on the unit’s display itself? Right now it just constantly reads “0”.

Walking by and looking at the unit display is the fastest, easiest way for me to check the air quality in the room.

It seems like if we can apply the calibration at the device level then the Home Assistant integration using the local API will also receive the correct data.

Thanks for the responses! After setting the configuration source to ‘cloud’, as well as updating the configs in the dashboard to enable the EPA algorithm, the numbers seem to be matching.

Thanks for pointing out the local-server docs. It’s a little disappointing that you need to factory reset if you want to set control back to local. I guess I’ll do this if I ever want to completely cut these off from the internet. I also noticed there that you can enable the batch-specific corrections locally via a PUT request, which is great, but it doesn’t look like the home assistant integration knows how to do this yet. Maybe that will become available in the future.

I’m pretty sure you can change back to local control with a local API command. I haven’t done it myself, but the HA integration can do it