AirGradient Forum

Raw vs compensated variables

Hello, I’m pulling data off of my devices using prometheus. For temperature and humidity there are two variables: a normal one and a “compensated” one. I’m trying to find information about what the compensated one actually is.

Is the compensated one with the corrections listed here: Calibration Algorithms already applied? Or is it some other sort of correction?

Basically, because I’m plotting the data in grafana, I need to know if I need to try to correct the data after the fact using operations in grafana, or if the compensated values from the unit are already corrected in accordance with the formulas on your website.

Thanks

Compensated is the value after the selected compensation algorithms have been applied. If you have you device controlled by the cloud, you can select which corrections are applied there and it will push the config down to your device, such as the batch corrections and/or the EPA corrections.

If you are using local control, you can send a command to the local API endpoint to enable the same options.

1 Like

Can you elaborate on the local control API option?

Also, you say if I change on the cloud it will push to the device. Just to confirm, on the dashboard on the airgradient website, it says the corrections will be applied to incoming data. Are you sure that prometheus can scrape the corrected data directly from the device?

Information about the local server is here:
arduino/docs/local-server.md at master · airgradienthq/arduino

The section Avoiding Conflicts with Configuration on AirGradient Server talks about setting configurationControl to local or cloud for where the configuration comes from.

I would start with comparing the regular and compensated values and see if they are different. If they always match, then you likely aren’t getting the compensations applied in your graphana, but it all depends on what device you are using, what endpoint you are querying for grafana, what batch your sensors are, etc.

Interesting. I’m using /metrics instead of the local server API. In fact, I don’t even see /metrics documented on the page you linked. The variables output by the local server API are different than the ones on /metrics too.

Looks like airgradient_pm2d5_ugm3{} in /metrics is the same as pm02Compensated in /measures/current but rounded up to the nearest whole number?

EDIT: Tried to point prometheus at the /measure/current page, and it doesn’t look like it can parse that data by default. Any ideas on how to either get prometheus to parse it? Or to align /metrics with /measures/current so the data fields are the same?