AirGradient Forum

HomeAssistant addon wrong PM values when Airgradient dashboard is OK

This should help

Check out Set Configuration Parameters.

Looks like you want to set your display to show the compensated values and you may want to enable the compensations, as it is recommended.

The Dashboard is both for viewing graphs but it also does all of the configuration of your ConfigurationControl is set to Cloud. This makes it easier to see and set your config.

When you add to Home Assistant it changes the Configuration control to local so HA can configure the setting all locally or you can use Curl.

So it depends on how you want to manage it.

You can use the dashboard and cloud control and still get local graphs in Home Assistant

2 Likes

Thanks!

I have now set “monitorDisplayCompensatedValues” to “true” in “/config”, and will check using “/measures/current” if I see any further discrepancies, but it sounds like this was what I was missing - i.e. the device display was showing the raw values while the HA entities were using the compensated values.

If this was my issue, I would suggest that “monitorDisplayCompensatedValues” is set to true by default, or perhaps it’s added as something that people might want to configure when they integrate with Home Assistant in the HA documentation here:

Better still, it could be configured automatically by the integration, maybe as part of the “config flow” setup in HA with a (default ticked) checkbox to “show matching compensated values on display” (or something along those lines) and the same option being made available to set/change in the HA device page for the AirGradient (i.e. like the “Post data to Airgradient” option in the Configuration on the device page, there would be a “Show compensated values on monitor display” checkbox as well).

PS: It would be useful if the local server API documentation was linked from the main AirGradient website, perhaps on this page:
https://www.airgradient.com/integrations/

Following up on this as I must still be missing something (maybe the “corrections” object?); I have “monitorDisplayCompensatedValues” set to true in /config, but I’m still seeing inconsistent values between the physical display on my AirGradient device, the Home Assistant entity and even those reported on /measures/current.

For example, here were the values I observed earlier today for PM2.5 (ug/m3):

  • device display: 18; Home Assistant: 11.02; /measures/current: “pm02” 18.17 “pm02Standard” 18.17 “pm02Compensated” 11.19
  • device display: 21; Home Assistant: 11.82; /measures/current: “pm02” 18.33 “pm02Standard” 18.33 “pm02Compensated” 11.27

It appears that the device display is generally closer to the “raw” or “standard” (uncompensated?) values, whereas HA is closer to the “compensated”, but it doesn’t align perfectly and the inconsistency between the device display and HA makes me question which one I should use as they can’t both be correct. In any case, I would suggest that the default behaviour should be that the (main) HA entity matches what is shown on the device display, and if there are other values (raw/compensated/etc.) they can have separate entities in HA.

Following up again on this (prompted by the “Works with Home Assistant” announcement: AirGradient Is Now Works With Home Assistant! Congratulations on that BTW!) - any thoughts on the discrepancies I continue to see? Should I cross-post it to the official Home Assistant integration GitHub?

Any further thoughts/ideas on this?
I noticed this thread which sounds similar:

My “Configuration source” in the Home Assistant integration for my AirGraident ONE is set to “Local”, should I set it to “Cloud”? (even though I only use the device via Home Assistant and by looking at the screen on the AirGradient ONE device itself)

If you have configured it in the AirGradient Dashboard site, then changing your HA configuration source to Cloud will pull the configuration from the cloud, which can then more easily apply the corrections.

If you don’t want to use the AirGradient Dashboard, then you have to make a local API call to turn on the desired directions.

There are some details in the GitHub repo about using the local server. [quote=“alextwe23, post:26, topic:3618, full:true”]
Any further thoughts/ideas on this?
I noticed this thread which sounds similar:

My “Configuration source” in the Home Assistant integration for my AirGraident ONE is set to “Local”, should I set it to “Cloud”? (even though I only use the device via Home Assistant and by looking at the screen on the AirGradient ONE device itself)
[/quote]

Very complicated thread! I also had trouble with different numbers on the AirGradient Dashboard, Home Assistant and AirGradient One Monitor Screen. I have a simple solution. Comments above may be correct, but include things like “local API call” and “GitHub repo” which are beyond my expertise and patience with setting up a simple device. So for any who want a simple solution here goes: First realize that calibration can be done online using the online AirGradient Dashboard. First, integrate the AirGradient monitor (AG1) into Home Assistant (HA). Next configure the AG1 (the monitor) in HA to post data to AirGradient and set the Configuration Source to Cloud. Next set up an AirGradient online account with the AG1 monitor. Calibrate the AG1 monitor in the AirGradient Dashboard (in the cloud). After some time all numbers were roughly the same for me. (PM0.3 particle number bounces around so 30 particles in HA is within tolerance of 35 on the Airgradient Dashboard and PM2.5 of 0.3 in HA is within tolerance of 0.2 on the Airgradient Dashboard and 0 on the AG1 display.) Now if you want, use HA to set the AG1 configuration back to local and turn off Post data to Airgradient. Your data is now local and HA will show the same numbers as the AG1 display. The numbers roughly correspond with the numbers on another monitor I have. The AG1 is not an expensive reference monitor and changes in the numbers are more relevant than the absolute values for me. So this is good enough - in fact it’s great!