>>> Join Us in the Fight Against Air Pollution

AirGradient Forum

New AirGradient Arduino Library Version 3

Thanks. I think I initially flashed by connecting to my laptop.

I’m looking at my yaml, it doesn’t have a similar structure. Things defined like “- platform: sht4x” / “- platform: sgp4x” etc. rather than packages. So I don’t imagine that doing an ESPHome install would do anything except re-install the support for basic ESPHome sensors/etc.

Wondering if starting from scratch would be an easier way to go. To do that, I can just grab your yaml linked above and replace mine, putting in my “substitutions” and ESP API key, right?

I did make some small adjustments to mine - pretty much just dropping the brightness on the LEDs to a lower brightness for OK CO2 ranges. Would I have to give that up?

You could do it as a whole new device, I wouldn’t think going from “scratch” would be required, but I certainly did reorganize several things.

I would probably copy everything from my current configuration to the bottom of your current one, match up the name and friendly name, and then see if you need to copy over any of the API/OTA/Wifi sections

In the latest config, you get a slider bar in to adjust the LED brightness, display contrast, manually trigger CO2 calibration, and more. The LED is a global LED brightness though, not setting it dimmer for OK and brighter for orange/red

1 Like

If the purple led only shows up occasionally you can ignore it. We will fix this in the next firmware update. If it’s permanently on, it means that the monitor is not correctly set up on the dashboard.

Just wanted to drop by to say thanks. I was able to update today without any issues.

I copied in your YAML and moved over my substitutions/api key/wifi stuff and installed that.

I had to clean up some orphaned entities that changed names, but no biggie at all. Thanks for the help!

1 Like

Thanks for the updated firmware. Is there any reason for forking some of the libraries? Are there any changes to them other than whitespace and renamings?

The following libraries have been integrated into this library for ease of use

The s8 library is missing from the list.

@MallocArray does the ESPHome version use unmodified libraries?

Reason for integrating were basically: Firstly we wanted to make it easier for beginners to avoid installing too many libraries and secondly ensure that we all work with exactly the same version. Thirdly a few libraries needed some patching.

In the ESPHome configs, everything does come from the ESPHome server, but there are some compensations, such as the AirGradient researched adjustments to the temp/humidity in the outdoor sensors with PMS5003T sensors and currently a minimum value for the CO2 sensor, since those under 350 are likely to be invalid readings, but there is discussion if the minimum should be removed so it can go as low as the sensor is reporting, even if it isn’t accurate

Reason for integrating were basically: Firstly we wanted to make it easier for beginners to avoid installing too many libraries and secondly ensure that we all work with exactly the same version. Thirdly a few libraries needed some patching.

Thanks. Are the patches also going to be submitted to libraries upstream?

Anyway, I basically want to run my AirGradient One v9 with a local server (or no server at all) but also receive patches for anything related to sensors. What’s the best way to do that? I don’t need anything fancy, just something that logs sensor readings.

Originally, I was going to track changes from the AirGradient repo but it looks like there might big changes that don’t affect sensors mixed in with sensor related changes. I already have a server up since the previous version only POSTs data. I know I can also read data off the serial console.

In the ESPHome configs, everything does come from the ESPHome server, but there are some compensations, such as the AirGradient researched adjustments to the temp/humidity in the outdoor sensors with PMS5003T sensors and currently a minimum value for the CO2 sensor, since those under 350 are likely to be invalid readings, but there is discussion if the minimum should be removed so it can go as low as the sensor is reporting, even if it isn’t accurate

Are there compensations for the indoor monitors? Do you plan on tracking all sensor updates from the main AirGradient repo in the future as well?

I don’t think I’ve seen a CO2 reading below 350 on my One v9 so far.

There aren’t any current compensation algorithms for the indoor sensors as I believe there aren’t any needed at this time, but my intention is to follow whatever AirGradient research shows and implements in their code.

A CO2 reading below 350 would be very uncommon under normal circumstances, but I’ve had situations where I keep one device in a basement where it never gets down to ambient levels around 400, so the automatic calibration ends up with some incorrect values and when I take it outside to get it calibrated, I get readings in the 200s which isn’t really valid, hence the lower limit code.

Since you are waiting to use the device without the AirGradient dashboard, you could just leave it off the wireless, or use the ESPHome config I maintain and flip the switch to not upload to AirGradient Dashboard, or you can modify either the Arduino or ESPHome configs to meet your needs, but you would have to monitor for any code changes to implement into your config.

Yes the indoor monitor does not need compensation algorithms because it has a much better airflow and thus less internal heat up than the outdoor monitor.