Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AirGradient ESPHome Configurations

ESPHome yaml files for AirGradient devices to maintain the research and accuracy of AirGradient sensors, while also gaining the benefits of ESPHome/HomeAssistant for easy to use switches, buttons, configurations, and dashboards. Maintains the ability to also send data to the AirGradient Dashboard, which can also be disabled/removed to keep all data local.
ESPHome yaml files for AirGradient devices to maintain the research and accuracy of AirGradient sensors, while also gaining the benefits of ESPHome/HomeAssistant for easy to use switches, buttons, configurations, and dashboards, all controlled locally. Maintains the ability to also send data to the AirGradient Dashboard, which can also be disabled/removed to keep all data local.

<img src="image/README/1715467068556.png" width=25% height=25%>

Expand All @@ -26,9 +26,12 @@ List of available packages to customize your device and gain additional features
* Added optional substitutions to implement batch-specific PM2.5 corrections using values provided by AirGradient
[See details in the packages.md file under the PMS5003 section.](packages.md#sensor_pms5003yaml)
* Restored logging to default values as it no longer repeats messages about components taking too long to complete
* New package for upgrading DIY and Pro models to Lolin C3 Mini

## Features

Replacing the line that starts with `led_co2` with ` led_combo: !include packages/led_combo.yaml` enables combo LED bar. For more information, look at the Packages file.

Many added features can be found in HomeAssistant by going to Settings>Devices and selecting the AirGradient device. Alternatively, add `web_server:` to the config file to enable a built-in web server on the AirGradient device (Not recommended for devices based on the D1 Mini ESP8266)

- Compact single page display by default with all relevant sensor readings
Expand Down Expand Up @@ -59,7 +62,7 @@ Many added features can be found in HomeAssistant by going to Settings>Devices a

- Short press (Less than 1 second) - Toggle between F and C on display
- Long press (More than 1 second, less than 5) - Trigger manual CO2 calibration
- Leverage automation in HomeAssistant to turn on the "Blank" page and turn off all other pages to effectively disable the display output. Could also turn off the LED strip or set Brightness to 0 to eliminate output while still collecting sensor data
- Leverage automation in HomeAssistant to turn on the "Blank" page to effectively disable the display output. Could also turn off the LED strip or set Brightness to 0 to eliminate output while still collecting sensor data

## Support me

Expand Down
14 changes: 7 additions & 7 deletions configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ MQTT support has been mentioned in the AirGradient forums several times. ESPHom

After extensive discussion on the [AirGradient forum](https://forum.airgradient.com/t/concern-about-hijackable-wifi-connection/3845), it may be a good idea to remove the Captive Portal package after initial configuration, as leaving it in will default to enabling the Access Point Mode if WiFi is not available, potentially allowing an external source to reconfigure the device to a new network or upload another firmware file. Can also add a password to the ap if this functionality is desired, but want to secure it.

### Using a lolin-d3-mini in an AG Pro board
### Upgrade AirGradient DIY/Pro board to ESP32-C3

The lolin-d3-mini has a similar enough pin configuration that we're able to replace the stock D1 mini
and make some minor config changes and get the benefits of an ESP32-c3 based device without buying a
whole new motherboard.
The early DIY and Pro models were limited by ESP8266 chip that has minimal performance. The Lolin C3 Mini has the same form factor and based on the much improved ESP32-C3 chip.

1. Start with the airgradient-pro.yaml file
2. Under packages, replace 'airgradient_d1_mini_board.yaml' with 'airgradient_lolin-c3-mini_board.yaml'
3. change the `!extend config_button` section to use pin number `4` instead of `D7`
1. Purchase a Lolin C3 Mini, such as https://www.aliexpress.us/item/3256804553736450.html
1. Replace the device in your AirGradient
1. Under `packages:`, replace 'airgradient_d1_mini_board.yaml' with 'airgradient_lolin-c3-mini_board.yaml'
1. If upgrading a Pro, change the `!extend config_button` section to use pin number `4` instead of `D7`
1. Install/Upgrade ESPHome on your device


# Home Assistant Automation
Expand Down
4 changes: 2 additions & 2 deletions packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ Board configuration for devices based on the ESP32-C3 chip (AG ONE and OpenAir)

## airgradient_lolin-c3-mini_board.yaml

Board configuration for the AG Pro that has been user upgraded to use a lolin-c3-mini
Board configuration for the AG DIY/Pro that has been user upgraded to use a Lolin C3 mini, such as https://www.aliexpress.us/item/3256804553736450.html

The board is close enough pin configuration that you can directly replace the d1 mini and replace the `board` package in airgradient-pro.yaml, and replace the `D7` under the `!extend config_button` with `4`.
If upgrading a Pro, change the `!extend config_button` section to use pin number `4` instead of `D7`

## button_factory_reset.yaml

Expand Down
2 changes: 1 addition & 1 deletion packages/airgradient_lolin-c3-mini_board.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# D1 Mini esp8266 board with a Lolin C3 Mini esp32 board

substitutions:
config_version: 5.3.2
config_version: 5.3.3

esphome:
name: "${name}"
Expand Down
6 changes: 3 additions & 3 deletions packages/sensor_nowcast_aqi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ script:
- lambda: |
int nowcast_2_5 = -1;
int nowcast_10_0 = -1;
int hourly_2_5_size = std::min(12, static_cast<int>(id(pm_2_5_hourly_avg).size()));
int hourly_10_0_size = std::min(12, static_cast<int>(id(pm_10_0_hourly_avg).size()));
Expand Down Expand Up @@ -277,7 +277,7 @@ script:
// everything higher is just counted as 500
nowcast_2_5 = 500;
}
}
}
Expand Down Expand Up @@ -341,7 +341,7 @@ script:
// everything higher is just counted as 500
nowcast_10_0 = 500.0;
}
}
}
Expand Down