Local Home Assistant Integration for AirGradient devices

For those following along at home, based on some additional testing and the behaviour with the stock firmware it looks like one of my sensors has failed and that there was nothing wrong with Malloc’s ESPhome firmware.

[11:50:20]Firmware Version: 3.1.1
[11:50:25]Can not detect S8 on Serial1, try on Serial0
[11:50:25]CO2 S8 sensor not found
[11:50:25]Can not detect S8 run mode ‘PPT’
[11:50:25]Init SGP41 failuire
[11:50:25]SGP sensor not found
[11:50:25]Can not detect SGP run mode ‘O-1PP’
[11:50:28]Found PMS 1 on Serial0
[11:50:32]PMS2 sensor not found
[11:50:32]Firmware Mode: O-1P

Did you get the fully assembled unit or the kit? If the kit, can you post some photo how you assembled it so that we can check if the cables were connected correctly. Also the cables have to put firmly into the plugs.

Hi Achim,

It was the presoldered kit I put together.

I dismantled it to check and the cable had come out of one of the sensors entirely (not out of the joard, out of the sensor). I put it back in, it doesn’t seem like a really snug fit but the sensor is now working again. I’m assuming it fell out when I sat it upside down on the bench to upgrade the firmware.

So all working at the moment but obviously need to be careful moving it.

You need to really press the cable tightly into the blue PM modules. I use my fingernails and press on the white plastic of the cable plug to push it in. Normally these connections are very solid.

Integration with Home Assistant… perfect for the AG One and for the Open Air too!

Only One question: Is not posible now ask for a CO2 calibration as previously we can launch from the ESPHome version?

Over the next few HA updates we will add all configuration possibilities also directly into HA.

This will include the CO2 calibration.

1 Like

Will we be able to eventually, or already today, control the LED bar on the AG indoor unit? I am looking to get one of these for my daughter’s bedroom and mount it near her sleeping space but don’t want the LEDs to distract her at night. I’d like to be able to toggle them on/off with a switch in HA so when we put her to bed the unit is dark but still collecting data of course to use for automations. Thanks!

With the stock firmware, this capability is already present. You have to configure the time under the Dashboard website>Place>LED & Display
AirGradient

If you are using the ESPHome firmware, all of the pieces are there, but no instructions on how to create an automation to do it yet, but coming soon.
To turn off the display/LEDs it would be something like this, and then the inverse to turn it back on

Here is a short preview about configuration that is natively integrated into HA. It is not yet in HA Beta or Release. Just a preview from our developer.

image

A few things still missing, but just to give you an update.

1 Like

I noticed my O-1PST monitor doesn’t show temperature history correctly in Home Assistant. I removed and re-added it to see if it made a difference without any luck. The O-1PST shows graphs normally on the airgradient dashboard.

My other 3 indoor monitors work ok.

Looks like you had one significant dip to ~-1000 and it throwing off your entire graph. If you change the graph time to only the last 4 hours, I bet it shows correctly and once that dip ages out, your graph will look normal.

I think I saw someone else mention erratic temp readings and it was being fixed in an upcoming firmware.

1 Like

Good catch… so something is causing the ocassional “bump” down to -1000.00 C. I look forward for the next firmware to resolve that.

We will fix this on the firmware side.
See: Ignore parameter values out of range · Issue #190 · airgradienthq/arduino · GitHub

Is this coming for DIY Pro PCB 3.7 as well, or is it just for the ONE? Our ESPHome firmware has always been randomly flaky/randomly freezes after a couple days for some reason, so really looking forward to the possibility of a native integration.

Hello!!

I began to investigate and learn about the integrations of IoT devices using HA and being able to have AirGradient monitors locally online, here is a summary of what I observed and learned:

I have two Open Air monitors, (1 model O-1PP Firmware Version: 0.6.4 and 1 model O-1PS Firmware Version: 3.1.4)

When I configure my HA for the first time and activate the corresponding services, the model with firmware 3.1.4 is automatically detected. Not so the other one. So I tried several times to update following your instructions through the ESPHome service, but I ended up giving up and installing the latest version of the firmware directly from the firmware session but when detecting the monitor, it told me that version 3.1.1 was required; so I proceeded to install the recommended firmware and now it was recognized in HA.

But, this morning when I check the versions of the monitors, I realize that both now have the same version 3.1.4 and are both online in my HA. I understand that one has been updated remotely (OTA), is that correct?

These are just observations and comments about my experience setting up an integration in HA.

I’ve found my DIY Pro also occasionally crashes with ESPhome firmware. Not often enough to investigate though… maybe once every 2-4 weeks.

My DIY Open Air has been stable.

Hi Luciano, nice to see you here in the forum!

Yes the observations you made are as they should be.

1 Like

The push button of PCB3.7 is currently not supported but it will be compatible with Home Assistant and you should be able to make all configuration changes directly from Home Assistant.

More information on how to flash this version is here:

Thanks! Tried it on a few of our 3.7s, seems to work alright, though the server connection seems a bit flaky, the entities going “unavailable” pretty frequently. But it’s better than the crashes I was seeing with ESPHome, since I’d have to manually power cycle them. That got old fast.

Will this all be coming out for v3.3 as well?

I’ve been observing reboots with ESPHome and the ESP8266 devices ever since the beginning, but other than resetting the TVOC index, it hasn’t overall impacted the functionality.

The latest release is working much better for the newer devices with the ESP32-C3 chips due to a watchdog timeout extension option that isn’t available for the lower end chips