Skip to content

Commit 7722e4b

Browse files
committed
Rearrange README into separate files
1 parent 8051016 commit 7722e4b

File tree

4 files changed

+144
-127
lines changed

4 files changed

+144
-127
lines changed

README.md

Lines changed: 17 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,31 @@
22

33
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.
44

5+
<img src="image/README/1715467068556.png" width=25% height=25%>
6+
7+
## [Installation](/installation.md)
8+
9+
## [Configuration](/configuration.md)
10+
511
## Breaking Changes
612

7-
* 5.0.0 is a major version upgrade as switching to esp-idf is not fully supported via OTA. Highly recommend doing one USB flash of 4.1.0 and later to the AirGradient ONE and OpenAir devices to reformat the storage to support esp-idf. Future updates can be done Over-The-Air without issue.
8-
* It not done, the device is likely to reboot at some point and switch to the standby partition, returning to a version prior to 4.1.0
13+
* 5.0.0 is a major version upgrade as switching to esp-idf is not fully supported via OTA. Highly recommend doing one USB flash of 5.0.0 and later to the AirGradient ONE and OpenAir devices to reformat the storage to support esp-idf. Future updates can be done Over-The-Air without issue.
14+
* It not done, the device is likely to reboot at some point and switch to the standby partition, returning to a version prior to 5.0.0
915
* [Seeing an Old Firmware Version After Update? Here&#39;s Why &amp; How to Fix It · Issue #1821 · Blackymas/NSPanel_HA_Blueprint](https://github.com/Blackymas/NSPanel_HA_Blueprint/issues/1821)
1016
* [Read/Write bootloader, partition table and any partition via OTA by angelnu · Pull Request #5535 · esphome/esphome](https://github.com/esphome/esphome/pull/5535)
1117
* Aware of errors in the logs stating `esp_task_wdt_reconfigure(615): Invalid arguments`
1218
* Tracking [Watchdog config hardcoded core mask · Issue #6767 · esphome/issues](https://github.com/esphome/issues/issues/6767)
13-
* 4.1.0 switches ONE and OpenAir models (based on ESP32) to the esp-idf framework, freeing up some memory and allowing other advanced features such as bluetooth_proxy and esp32_improv. If the previous Arduino framework is desired, change the board to `airgradient_esp32-c3_board-arduino.yaml`
19+
* 5.0.0 switches ONE and OpenAir models (based on ESP32) to the esp-idf framework, freeing up some memory and allowing other advanced features such as bluetooth_proxy and esp32_improv. If the previous Arduino framework is desired, change the board to `airgradient_esp32-c3_board-arduino.yaml`
1420
* If attempting to add BT and BLE support, may need to remove the captive_portal package to free up enough space [Issue #115](https://github.com/MallocArray/airgradient_esphome/issues/115)
15-
* Remove substitution line such as `config_version: 2.0.5` from the main file, as this has been moved into the board package file
16-
* Updated to 4.0.0 versions, skipping 3.x to avoid confusion with current AirGradient official firmware
17-
* Now defaulting to https for AirGradient API communication. If older devices (DIY and Pro models) go into constant reboots, switch to the api package `airgradient_api_d1_mini_insecure.yaml` to revert to the original communication method
1821

1922
## Changes
2023

21-
* Support for ESPHome 2025.2 and later due to changes to esp32_rmt_led_strip
22-
* Added extended timeout for API upload on ONE and OpenAir models to reduce reboots
23-
* Applied correction algorithms for PM2.5 provided by AirGradient
24-
* https://www.airgradient.com/documentation/correction-algorithms/
25-
* Updated API upload to follow current structure including both raw and corrected values
26-
* Moved config_version substitution into the board package so it can be updated without manual change to main config file. Please remove the line starting with `config_version:` from your personal files
27-
* Split captive portal config to a separate package. Can be removed if not using the portal or if defining wifi networks in your config file, which results in a small memory savings
28-
* Removed safe_mode package by default. Very few use cases for it
29-
* Added commented out packages for extended_life configs to make it easier to enable if desired
30-
* Added commented out package for SHT30 temp sensor in AG Pro file to make it easier to switch to if desired
31-
* Added new sensor options for raw values for PM2.5, temp, and humidity in some device configurations, and added AirGradient provided correction algorithms to the standard sensors
32-
* AG DIY Basic display config changed to same font as other models, downloading from gfonts instead of using local file
24+
* Added optional package for using LED bar on AirGradient ONE to reflect TVOC values
25+
* Added examples of Home Assistant automation to disable the display and LED at a scheduled time in configuration.md
3326

3427
## Features
3528

36-
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 (No recommended for devices based on the D1 Mini ESP8266)
29+
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)
3730

3831
- Compact single page display by default with all relevant sensor readings
3932
- Display Contrast slider to dim the display
@@ -65,117 +58,14 @@ Many added features can be found in HomeAssistant by going to Settings>Devices a
6558
- Long press (More than 1 second, less than 5) - Trigger manual CO2 calibration
6659
- 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
6760

68-
## Installation
69-
70-
### Standard
71-
72-
* In ESPHome web interface, click New Device. Give any name. Select any model of board, and click Skip on the final page to not install at this time. Click Edit on the new entry and replace with the contents of the .yaml file for your model.
73-
* Alternatively, copy the .yaml file from the main folder for your model in this repo and place it in the `config` folder of your ESPHome.
74-
* Make any desired changes to the substitutions to name the devices for your use case
75-
* Install to the device using one of the ESPHome options.
76-
77-
> Note: by default ESPHome only syncs remote repositories that the packages are referencing once per day, so if changes are made to the repository, you may not get the updated config for up to 1 day after it is published. You can remove the contents of the folder config/.esphome/packages to force it to update sooner
78-
79-
> Note: setting `add_mac_suffix: "true"` allows for multiple devices on your network at the same time and report as unique entries even if your `name:` field is duplicated, but it can cause ESPHome to not detect devices as Online after installing, since ESPHome is looking for only the `name:` field and the actual device name has the MAC address added to the end
80-
>
81-
> One way to resolve this is to change `add_mac_suffix: "false"` so the device name will match exactly. If you have multiple devices, make sure to change the `name: `field to be unique for each device
82-
>
83-
> Another alternative is to add a static IP to the wifi configuration and configure ESPHome to ping the device by IP instead of hostname
84-
>
85-
> [Dashboard status light not working across subnets/zones · Issue #641 · esphome/issues (github.com)](https://github.com/esphome/issues/issues/641#issuecomment-534156628)
86-
>
87-
> Example for static IP
88-
>
89-
> ```yaml
90-
> wifi:
91-
> ssid: !secret wifi_ssid
92-
> password: !secret wifi_password
93-
> manual_ip:
94-
> static_ip: 192.168.1.121
95-
> gateway: 192.168.1.1
96-
> subnet: 255.255.255.0
97-
> dns1: 192.168.1.1
98-
> ```
99-
100-
### ESPHome Web install
101-
102-
Install a compiled file to your device all with just a browser and USB cable, no ESPHome install required.
103-
104-
Save the appropriate .bin file and go to [https://web.esphome.io/](https://web.esphome.io/) in your browser to connect your ESP device and send the .bin file to it
105-
106-
> In some cases, the device may encounter errors using the web flash tool. Steps to put the device in a special boot flash mode can be found here:
107-
> [https://forum.airgradient.com/t/airgradient-one-not-working-after-flashing-with-arduino/1326/4 ](https://forum.airgradient.com/t/airgradient-one-not-working-after-flashing-with-arduino/1326/4)
108-
109-
### Full YAML file
110-
111-
The `full_config` folder contains a single yaml file per model that contains the full standalone configuration, created by the `esphome config` command. This adds in all of the optional parameters, so is much longer than the minimum configuration, but the single file contains all needed information to be completely independent from this repo.
112-
113-
Copy the full config file to your personal ESPhome config file and customize as desired, then install to your device.
114-
115-
## Troubleshooting
116-
117-
If some sensors are not showing valid readings after installing or upgrading, please remove the power cable from the device entirely for 5-10 seconds, then reconnect. Many issues are resolved with a full power reset, as the software reset does not fully clear some situations.
118-
119-
## Configuration
120-
121-
If all original sensors (PMS5003, Senseair S8, SHT4x) are connected, configuration files should be ready for use.
122-
123-
If some sensors are not installed, comment or remove the associated sections under `packages:`
124-
125-
The PMS5003 sensor by default collects readings every second. Since this device has a limited lifespan, it is possible to extend the life by collecting readings less frequently, although this could impact the accuracy of the readings collected, since there will not be constant airflow through the device when the fan shuts down. To collect readings every 2 minutes, change the line for the pms5003 sensor to `sensor_pms5003_extended_life.yaml`
126-
127-
> See [PMSX003 Particulate Matter Sensor — ESPHome](https://esphome.io/components/sensor/pmsx003.html#sensor-longevity) for more information
128-
129-
To add your WiFi SSID and password, add your SSID and password information, per ESPHome specifications
130-
131-
```yaml
132-
wifi:
133-
ssid: NachoWiFi
134-
password: 123456123456
135-
```
136-
137-
## Modification
138-
139-
#### Using local packages
140-
141-
By default, packages are referencing this GitHub repository, allowing you to do a new Install from ESPHome dashboard to get the latest modifications without downloading other files, but does require an Internet connection. If you wish to have more control over modifications or only reference local files, copy the `packages` folder to your local ESPHome folder in a `packages` subfolder and replace `github://MallocArray/airgradient_esphome/packages `with `!include packages`
142-
143-
```yaml
144-
# Example
145-
board: github://MallocArray/airgradient_esphome/packages/sensor_s8.yaml
146-
# becomes
147-
board: !include packages/sensor_s8.yaml
148-
```
149-
150-
#### Using Extend feature
151-
152-
Rather than download an individual package and update the reference to it, you may also use the [Extend](https://esphome.io/guides/configuration-types.html#extend) option to make minor modifications without editing the packages file. This only works for items with and `id:` defined
153-
154-
> Example: adding this to the main file for your device will change the pin number in the config_button package, while maintaining all other settings defined in the package
155-
>
156-
> ```
157-
> binary_sensor:
158-
> - id: !extend config_button
159-
> pin:
160-
> number: D7
161-
> ```
162-
163-
#### Copy and Paste
164-
165-
It is also possible to copy the contents of a package file and paste it directly into your YAML file. Do note that sections cannot be duplicated, so if multiple sections like `interval` are pasted in, they must be combined into a single entry when using this method.
166-
167-
#### Adding other packages
168-
169-
Several additional packages are available in the `packages` folder that can be added or removed as needed. See the [Packages page](/packages.md) for more information about available options.
61+
## Support me
17062

171-
## Additional Information
63+
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/O5O31C8PHG)
17264

173-
MQTT support has been mentioned in the AirGradient forums several times. ESPHome supports this by adding a few lines to the main yaml file. Add the relevant information for your configuration. Read more about it here:
174-
[https://esphome.io/components/mqtt.html](https://esphome.io/components/mqtt.html)
65+
[![PayPal](https://img.shields.io/badge/PayPal-00457C?style=for-the-badge&logo=paypal&logoColor=white)](https://paypal.me/mallocarray)
17566

17667
## Todo list
17768

178-
Several more features are planned to be added to this repo
69+
More features are planned to be added to this repo
17970

180-
- [ ] Explore options for disabling display/LED during certain times (May be differed to HomeAssistant Automation)
181-
- [X] Standardize font on AirGradient Basic display to match Pro
71+
- [ ] PMS5003 model specific correction algorithms

configuration.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Configuration
2+
3+
If all original sensors (PMS5003, Senseair S8, SHT4x) are connected, configuration files should be ready for use.
4+
5+
If some sensors are not installed, comment or remove the associated sections under `packages:`
6+
7+
The PMS5003 sensor by default collects readings every second. Since this device has a limited lifespan, it is possible to extend the life by collecting readings less frequently, although this could impact the accuracy of the readings collected, since there will not be constant airflow through the device when the fan shuts down. To collect readings every 2 minutes, change the line for the pms5003 sensor to `sensor_pms5003_extended_life.yaml`
8+
9+
> See [PMSX003 Particulate Matter Sensor — ESPHome](https://esphome.io/components/sensor/pmsx003.html#sensor-longevity) for more information
10+
11+
To add your WiFi SSID and password, add your SSID and password information, per ESPHome specifications
12+
13+
```yaml
14+
wifi:
15+
ssid: NachoWiFi
16+
password: 123456123456
17+
```
18+
19+
# Modification
20+
21+
### Using local packages
22+
23+
By default, packages are referencing this GitHub repository, allowing you to do a new Install from ESPHome dashboard to get the latest modifications without downloading other files, but does require an Internet connection. If you wish to have more control over modifications or only reference local files, copy the `packages` folder to your local ESPHome folder in a `packages` subfolder and replace `github://MallocArray/airgradient_esphome/packages `with `!include packages`
24+
25+
```yaml
26+
# Example
27+
board: github://MallocArray/airgradient_esphome/packages/sensor_s8.yaml
28+
# becomes
29+
board: !include packages/sensor_s8.yaml
30+
```
31+
32+
### Using Extend feature
33+
34+
Rather than download an individual package and update the reference to it, you may also use the [Extend](https://esphome.io/guides/configuration-types.html#extend) option to make minor modifications without editing the packages file. This only works for items with and `id:` defined
35+
36+
> Example: adding this to the main file for your device will change the pin number in the config_button package, while maintaining all other settings defined in the package
37+
38+
```
39+
binary_sensor:
40+
- id: !extend config_button
41+
pin:
42+
number: D7
43+
```
44+
45+
### Copy and Paste
46+
47+
It is also possible to copy the contents of a package file and paste it directly into your YAML file. Do note that sections cannot be duplicated, so if multiple sections like `interval` are pasted in, they must be combined into a single entry when using this method.
48+
49+
### Adding other packages
50+
51+
Several additional packages are available in the `packages` folder that can be added or removed as needed. See the [Packages page](/packages.md) for more information about available options.
52+
53+
### Additional Information
54+
55+
MQTT support has been mentioned in the AirGradient forums several times. ESPHome supports this by adding a few lines to the main yaml file. Add the relevant information for your configuration. Read more about it here:
56+
[https://esphome.io/components/mqtt.html](https://esphome.io/components/mqtt.html)
57+
58+
# Home Assistant Automation
59+
60+
Pairing ESPHome with Home Assistant opens a multitude of opportunities to create custom actions tailored to your liking
61+
62+
## Disable Display and LED based on time
63+
64+
1. In Home Assistant, navigate to Settings>Automations and scenes
65+
2. Click "Create Automation" button, then "Create new automation"
66+
1. When
67+
1. Add Trigger>Time>Mode>Fixed Time
68+
2. Set to your desired time to turn off the display and/or LED
69+
2. Then do
70+
1. Add Action>Device>Select your AirGradient from the ESPHome Integration
71+
2. In the Action field, select "Turn on `<Your AirGradient Name> Display Blank Page`"
72+
1. For the base config with only the single page display package, this will set the display to show an empty page
73+
2. If using the multi_page package, may need to add additional actions to turn off the other enabled pages
74+
3. Repeat action for "Turn Off `<Your AirGradient Name> LED Strip`" (If applicable)
75+
3. Click the Save button and give it a name, such as "AirGradient Night Mode"
76+
3. Repeat with a new Automation, with the actions reversed (Turn off Display Blank Page and turn on LED Strip), at the desired time with a name such as "AirGradient Night Mode Off"
77+
![automation](image/configuration/2025-03-20-205242.png)
27.9 KB
Loading

0 commit comments

Comments
 (0)