ESPhome makes integrating sensors with Home Assistant really easy. I was quite impressed that it took less than 10 minutes for the software + config, and no code at all.
Here’s some info on my DIY indoor air quality monitor:
Data from these sensors:
HM3301: PM1, PM2.5, PM10, AQI (US), CAQI(Europe).
SGP30: TVOC (Total Volatile Organic Compounds), eCO2 (equivalent calculated CO2 from TVOC).
SCD30: CO2 (using Non-Dispersive Infrared, NDIR), humidity, temperature. Better CO2 measurement than SGP30.
I bought the Grove version of these sensors, which made wiring super-easy. Suppliers were Mouser and Digikey.
NodeMCU was $4. Pack of 3 for $12 (Amazon, overseas suppliers, etc)
Mounted with 3M Command “Picture Hanging Strips”, megapack from Costco.
Research suggests mounting the sensors at the same level as people and away from doors/windows, similar to a thermostat. ie. not on the ceiling. CO2 is heavy. For example, when businesses store compressed CO2, they place their leak sensors close to the floor where CO2 settles. Mounting away from doors/windows helps to avoid drastic swings in measurements when those are opened.
![](http://donnlee.com/wp-content/uploads/2020/09/aqi_sodacan_scale_resized_IMG_8852-1024x768.jpg)
USB Powered
![](http://donnlee.com/wp-content/uploads/2020/09/2.1mm_barrel_to_usb_resized_IMG_8858-1024x768.jpg)
Monitoring Dashboard
InfluxDB integration for Home Assistant provides data for rendering in Grafana. Graph on a bad air day (smoke from wildfires):
![](http://donnlee.com/wp-content/uploads/2020/10/hass-outdoor-indoor-pm2.5-Screen-Shot-2020-10-01-at-6.59.12-PM-1024x975.png)
The next day, indoor PM2.5 resumed ~50, then there was a spike of bad air quality in the afternoon, and then dropping to 12 (indoor) after midnight. “12” is on the border of green and yellow:
![](http://donnlee.com/wp-content/uploads/2020/10/hass-grafana-good-air-at-pm2.5-12-Screen-Shot-2020-10-03-at-2.13.15-AM-1024x801.png)
Alexa Integration using Node Red
Using Home Assistant’s emulated Hue integration, I create a new virtual device called “smoke” and the approach in this thread.
This allows me to toggle the “smoke” device, which triggers a Node Red flow to get the current indoor and outdoor PM2.5 and say the results on all Echos in the house.
![](http://donnlee.com/wp-content/uploads/2020/10/nr-get-pm2.5-alexa-Screen-Shot-2020-10-03-at-11.06.57-PM-1024x263.png)
Outdoor air quality is fetched using the approach in this thread (does not require a PurpleAir device, just one shared near you).
I also have a Node Red flow that watches the HM3301 PM2.5 state, and sends notifications via Alexa and iOS if the air quality exceeds a threshold or changes more than 5, but only if a notification hasn’t been sent in the last 30m.
Carbon Monoxide (CO)
For CO (carbon monoxide), I use normal detectors that look and act like a smoke alarm.
#