AirGradient Forum

HA integration decimal places in PM2.5

I have ordered a couple of AirGradient ONEs just before Christmas, and have just got round to setting them up. Is anyone able to get a non-integer value of PM2.5 in µg/m³ using the official HA AirGradient integration? I know that I can change the “precision” to choose the number of decimal places I wish to round to, but regardless of which option I choose here, I always get the PM2.5 reading to the nearest whole number - although it does add the requested number of 0s after the decimal. However on the AirGradient dashboard I see PM2.5 being reported to one decimal place.

Note that I am relatively new to Home Assistant, so it’s perfectly possible I’ve missed something simple in configuring my integration. For additional context in case it helps, in the dashboard I have applied the PMS5003 correction for the batch number of my sensors, and applied the EPA correction on top of that. I set the HA integration’s configuration control option to cloud in order to pick up the configuration from the AG dashboard, and then changed back to local configuration control. So I understand that I should be seeing the same numbers on the dashboard and in HA, please correct me if I am wrong about that.

In fact you can see even at integer precision, what I see in HA does not match what I see in the dashboard, but I suspect that is due to the latency in sending data to the dashboard, though that is just a hunch and not based on any testing:

Hi @jaj ,

So, from firmware version 3.1.13, device send floating points to both airgradient server and local request. Home Assistant retrieve measures from local request, and before this PR, it always round the values to integers. And it also already merged to Home Assistant core. Maybe you could try update the integration.

2 Likes

I can confirm that the latest HA update now shows floating points.

1 Like

Thanks @Samuel_AirGradient and @yatil. I was already on the latest monitor firmware 3.1.21 on all the monitors, but I was not up-to-date with HA Core. I have now upgraded and I see that I get floating point values in the HA integration, thanks! :tada:

I have a few related questions then, about the values shown in the dashboard, although not strictly about the number of decimal places as in this topic’s title:
I have read on some other topics on the forum here that the dashboard table values are 5-minute rolling averages, is that correct? So am I right in assuming that the graphs are plots of this 5-minute rolling average at 5-minute intervals (when I have one of the 5 minute graph display dropdown options selected, which is the most granular possilbe as far as I can see)? Or are they plots of the real values sent to the dashboard from the monitors, at 5-minute intervals?