-
Notifications
You must be signed in to change notification settings - Fork 0
/
air-gradient.yaml
200 lines (184 loc) · 5.08 KB
/
air-gradient.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
esphome:
name: "air-gradient-01"
libraries:
- SPI
- Wire
- Adafruit_Sensor=https://github.com/adafruit/Adafruit_Sensor.git
- Adafruit_BusIO=https://github.com/adafruit/Adafruit_BusIO.git
- Adafruit_LPS2x=https://github.com/adafruit/Adafruit_LPS2X.git
project:
name: "AirGradient.Extended"
version: "1.0.0"
external_components:
# Use the LPS22 Sensor External Component from our GitHub
- source: github://AeroSteveO/Air-Gradient-Extended
components: [ lps22_sensor ]
refresh: 0s
esp8266:
board: esp01_1m
framework:
version: latest
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
platform: esphome
dashboard_import:
package_import_url: github://AeroSteveO/Air-Gradient-Extended/air-gradient.yaml
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
power_save_mode: none
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esphome-Web-ABCDEFG"
password: "password_here"
captive_portal:
i2c:
sda: 04
scl: 05
uart:
- rx_pin: 14
tx_pin: 12
baud_rate: 9600
id: uart_1
- rx_pin: 02
tx_pin: 00
baud_rate: 9600
id: uart_2
binary_sensor:
- platform: status
name: "Air Gradient Status"
sensor:
- platform: lps22_sensor
temperature:
name: "LPS22 Temperature"
unit_of_measurement: °C
accuracy_decimals: 1
pressure:
name: "Pressure"
unit_of_measurement: hPa
accuracy_decimals: 2
id: pres
- platform: template
name: "Pressure Above Sea Level"
unit_of_measurement: hPa
accuracy_decimals: 2
lambda: !lambda |-
return(id(pres).state - 1013.25);
- platform: sht3xd
temperature:
id: temp
name: "Temperature"
humidity:
id: humidity
name: "Humidity"
address: 0x44
update_interval: 5s
- platform: sgp30
eco2:
id: wco2
name: "eCO2"
accuracy_decimals: 1
tvoc:
id: tvoc
name: "TVOC"
accuracy_decimals: 1
store_baseline: yes
address: 0x58
update_interval: 1s
compensation:
temperature_source: temp
humidity_source: humidity
eco2_baseline:
name: "eCO2 Baseline"
tvoc_baseline:
name: "TVOC Baseline"
- platform: pmsx003
type: PMSX003
uart_id: uart_1
pm_1_0:
name: "Particulate Matter <1.0µm Concentration"
id: pm10
filters:
- sliding_window_moving_average:
window_size: 5
send_every: 5
pm_2_5:
name: "Particulate Matter <2.5µm Concentration"
id: pm25
filters:
- sliding_window_moving_average:
window_size: 5
send_every: 5
pm_10_0:
name: "Particulate Matter <10.0µm Concentration"
id: pm100
filters:
- sliding_window_moving_average:
window_size: 5
send_every: 5
- platform: senseair
uart_id: uart_2
co2:
id: co2
name: "SenseAir CO2 Value"
update_interval: 20s
font:
- file: "font/productsans.ttf"
id: product
size: 18
glyphs: |
0123456789 .
- file: "font/Roboto-Light.ttf"
id: unit
size: 9
glyphs: |
!"%°RPHF hpabmgµ³/
- file: "font/Roboto-Light.ttf"
id: label
size: 10
glyphs: |
HTPCVDOM25 abcdeilmnoprstuxy.
display:
- platform: ssd1306_i2c
model: "SSD1306 64x48"
rotation: "180°"
id: main_screen
pages:
- id: page1
lambda: |-
it.printf(39, 45, id(product), TextAlign::BOTTOM_RIGHT, "%.1f", (id(temp).state * 1.8) + 32);
it.printf(39, 32, id(unit), TextAlign::BOTTOM_LEFT, "°F");
it.printf(5, 2, id(label), TextAlign::TOP_LEFT, "Temperature");
- id: page2
lambda: |-
it.printf(39, 45, id(product), TextAlign::BOTTOM_RIGHT, "%.1f", id(humidity).state);
it.printf(39, 32, id(unit), TextAlign::BOTTOM_LEFT, "%% RH");
it.printf(5, 2, id(label), TextAlign::TOP_LEFT, "Humidity");
- id: page3
lambda: |-
it.printf(39, 45, id(product), TextAlign::BOTTOM_RIGHT, "%.0f", id(co2).state);
it.printf(39, 32, id(unit), TextAlign::BOTTOM_LEFT, "ppm");
it.printf(5, 2, id(label), TextAlign::TOP_LEFT, "CO2");
- id: page4
lambda: |-
it.printf(39, 45, id(product), TextAlign::BOTTOM_RIGHT, "%.0f", id(pm25).state);
it.printf(39, 32, id(unit), TextAlign::BOTTOM_LEFT, "µg/m³");
it.printf(5, 2, id(label), TextAlign::TOP_LEFT, "PM2.5");
- id: page5
lambda: |-
it.printf(39, 45, id(product), TextAlign::BOTTOM_RIGHT, "%.0f", id(tvoc).state);
it.printf(39, 32, id(unit), TextAlign::BOTTOM_LEFT, "ppb");
it.printf(5, 2, id(label), TextAlign::TOP_LEFT, "TVOC");
- id: page6
lambda: |-
it.printf(39, 45, id(product), TextAlign::BOTTOM_RIGHT, "%.0f", id(pres).state);
it.printf(39, 32, id(unit), TextAlign::BOTTOM_LEFT, "hPa");
it.printf(5, 2, id(label), TextAlign::TOP_LEFT, "Pressure");
interval:
- interval: 8s
then:
- display.page.show_next: main_screen
- component.update: main_screen