AirGradient Forum

Home Assistant Integration: Local Indoor and Outdoor Air Quality (AQI, NowCast, IAQI)

A few years ago, I picked up some AirGradient devices to keep an eye on the air in and out of my house (especially as “smoke season” has become a bit too common here in the PNW US). Because AirGradient didn’t yet have a Home Assistant integration, I also started helping out with the ESPHome firmware, eventually contributing the on-device AQI calculations for the popular version from @MallocArray.

The biggest problem with on-device calculations for slow metrics like AQI is that the calculation buffer is lost when the device is rebooted or the firmware is updated. To recover, NowCast needs at least 2 hours worth of data, and the daily AQI is 18 (or a full day if following the official midnight-to-midnight calculation).

I’ve been talking about figuring out how to move these calculations into Home Assistant itself for years, so I finally worked up the motivation to do so over the last couple weeks. This also gave me a chance to look into indoor air quality metrics. This first release of the integration provides the following sensors, along with some additional info like official category names and color codes:

  • Indoor Sensors
    • IAQI: ATMO produced this scale and formula as a way to produce a rating
      similar to AQI, but for indoor spaces.
  • Outdoor Sensors
    • EPA NowCast AQI: This is what most people think of when they hear “AQI.”
    • EPA AQI: Intended as a general air quality score spread across an entire day.

You can find all of the info about the plugin at github, including planned future work and a few items I’m looking for help with. Installation is currently via HACS as a custom repository:

In case you would prefer to follow updates there, I also cross-posted this to the Home Assistant community forum: Local Indoor and Outdoor Air Quality (AQI, NowCast, IAQI) - #2 by ex-nerd - Custom Integrations - Home Assistant Community

2 Likes

Hi @ex-nerd, thank you for contributing to the community.

I haven’t played around a lot, but thank you so much for sharing this with us!

2 Likes

Thanks for sharing @ex-nerd! For indoor data, you could check out the GO IAQS which we’ve implemented too:

https://www.airgradient.com/professional/go-aqs-simulator/

It is also already available in the AirGradient dashboard as a score. In a firmware update coming out soon, you can also use it as a basis for LED color coding. See here, for GO IAQS technical implementation: GO IAQS Starter Score Technical Implementation Paper

ATMO’s IAQI is based on the following research paper:

https://www.researchgate.net/publication/315006128_Development_of_indoor_environmental_index_Air_quality_index_and_thermal_comfort_index

The breakpoints, I believe, are adjusted to their own AQS (Air Quality Score) where the breakpoints for PM are quite outdated. I would refrain from using these. (Source: I used to work at ATMO)

3 Likes

Thanks. I’ve only just started looking into other scores and hadn’t found that one. (FYI, your link to the white paper is broken). I’ve added it to my to-do list.

I don’t have the new hardware with LEDs but now that I can load air quality stuff in Home Assistant, I’m considering re-flashing my AirGradient devices back to your firmware. There’s some sort of IO bus bug with ESPHome where sensors stop reporting in and the device needs to be fully rebooted to fix it.

2 Likes

@ex-nerd, thanks for informing us about the link. In the meantime, you can access the white paper via the official GO AQS’s website: https://goaqs.org/

2 Likes

For what it is worth, the sensor issues seem to happen most with ESPHome and the older circuit board and/or ESP8266. I haven’t had it with my newer ONE device.
I also swapped the ESP8266 in an older device for an ESP C3 Mini that is the same form factor and I haven’t had the sensors stop reporting with it either.

Yup. The two old DIY Pro models I have work great but my original AirGradient Outdoor O-1PP has been hit or miss after each ESPHome update (more miss than hit). I may give this one to my parents and order one of the new ones so I can play with the new sensors.

@ex-nerd anyway, I saw that you have a plan to support more sensors. Please let me know if I can help test it. The current AirGradient Open Air and ONE (for sure, I have both!) have these entities:

Hopefully, we’ll see the Open Air Max O-M-1PPSTON (with NO2 and O3 supports) compatible with Home Assistant sometime in the future.

1 Like

Thanks for this!
It was easy to set up with my AirGradient ONE and using your gauge example provides a nice visual indicator for the relevant raw sensors:

1 Like

Recently, I’ve also found this custom gauge, which is incredibly helpful for viewing multi-pollutant: GitHub - selvalt7/modern-circular-gauge: Modern circular gauge card for Home Assistant · GitHub

image

Not only for air quality metrics though, but I also use it for almost everything I have on my HA dashboard, like my PC monitor, electrical voltage, current, etc.

2 Likes