michaelahern / homebridge-airthings

A Homebridge plugin for Airthings air quality monitors via the Airthings Consumer API.
ISC License
38 stars 6 forks source link

VOC is not accurate #37

Closed Morac2 closed 6 months ago

Morac2 commented 1 year ago

The VOC µg/m³ value as reported by the AirThings dashboard does not match the µg/m³ value as reported in Home.

Looking at the code it looks like the calculation is completely wrong.

According to https://www.breeze-technologies.de/blog/air-pollution-how-to-convert-between-mgm3-µgm3-ppm-ppb/

Concentration (µg/m3) = molecular weight x concentration (ppb) ÷ 24.45

The code is doing some weird calculation involving temperate and pressure.

https://github.com/michaelahern/homebridge-airthings/blob/5198e29f42b56ec2ae1c19d2e9237b4e339d5525/src/plugin.ts#L257

image image image

The molecular weight can be calculated by comparing values in the dashboard when set to ppb and µg/m3. By my calculation it is 55.653

image image
michaelahern commented 6 months ago

Version 1.1 includes updated VOC conversion logic that mirrors the Airthings logic. Thank you for raising!