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.
-
IAQI: ATMO produced this scale and formula as a way to produce a rating
- 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
