Airgradient Pro 4.2

Is there any reason why I should not buy an Airgradient Pro 4.2? (

Does anyone have a complete configuration and/or complete instructions for exactly this model they can copy and paste such that their cloud integration is disabled?

I have one and am working on integrating it. Themis3000 on github has a rest integration to get the data from the sensor, but I haven’t found info on how to show the data in s dashboard yet.

Like this: AirGradient-DIY | ?

Or one of these: GitHub - ajfriesen/ESPHome-AirGradient: ESPHome config for AirGradient Air Quality Sensor , GitHub - MallocArray/airgradient_esphome: ESPHome definition for an AirGradient DIY device to send data to HomeAssistant and AirGradient servers ?

I’m using MallocArray on two pre soldered air gradient Pros 4.2

How did you mount it in whatever room/space it is you have it place and how did you route your power? E.g. a picture would be of interest.

I used the little feet that came with the unit. Cordage management with the aid of a rubber binder - plugged into a nearby outlet (in this case a Wion “smart plug” that just supplies power. The Plug was like $5 at a local hardware store - I solder up some wires to the ESP in the plug and put ESPHome on it.)

I’m still a bit confused (after reading both GitHub repos).

I’m pretty sure you have to flash the AirGradient with custom code. And maybe ESPHome helps you do it?

And looking at the instructions, I can’t use HA to do the flashing (because I’m using HA Container), and I can’t use “Install ESPHome Command Line” because I have a Mac.

This all seems very complicated.

Am I missing something?

Also, I’m not from the Arduino / hardware world so flashing is not somethign I know well. Thanks for any tips.

Esphome will allow you to put a custom image on the device. You can run esphome standalone if you wish.

If you have HA using SSL then you can connect the device to your own computer and use the browser to flash the device.

For any who find this thread.

This all turns out be be very easy.

First an explanation:

With normal devices like this (eg: Arduino), you need to customize them by writing C++ code and then pushing it to the device. (Literally overwriting the flash memory card.) It is all a bit involved.

ESPHome is a system that makes this dramatically easier.

  1. It allows you to customize your device with YAML configs based on pre-made components. For instance, you have a particular CO2 sensor? You can probably configure it with a couple lines of yaml. Want a web server on the device that tells you what is goin on? That’s ONE line: webserver:
  2. It allows you to easily push (flash) your device either plugged in over USB, or OTA (over the air).
  3. It easily integrates with HomeAssistant so it can be discovered and all its component sensors / entities added.

Note “ESP” is a brand of chips (from Espressif) but it apparently also does other chips now. These are the main microcontrollers controlling the device, so you need to find the right device.

For Air Gradient

  • Install ESPHome - I did the manual install. Extremely easy - basically pip install esphome
  • Download the proper premade AirGradient ESPHome repo - I used this one: MallocArray repo
  • From there, find the right template for YOUR device. Mine was “airgradient-one.yaml”
  • Plug your computer into your AirGradient usb. (You can also do OTA, but I’d simplify and plug in the first time.)
  • Customize your yaml file
  • Flash it: esphome run airgradient-one.yaml

It’s all remarkably easy. Great job by ESPHome and MallocArray.

If you’ve never done it it seems baffling at first, but it’s simple.


1 Like