forked from dashdrum/esphome
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathair_quality.yaml
168 lines (148 loc) · 4.04 KB
/
air_quality.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
substitutions:
device_name: air_quality
upper_device_name: Air Quality
esphome:
name: $device_name
platform: ESP32
board: wemos_d1_mini32
wifi: !include include/wifi_iot.yaml
captive_portal:
web_server:
port: 80
# Enable logging
logger:
level: ERROR
# baud_rate: 0
# Enable Home Assistant API
# api:
ota:
mqtt: !include include/mqtt.yaml
button:
- platform: restart
name: $upper_device_name Restart
i2c:
# uart:
# rx_pin: GPIO3
# baud_rate: 9600
# id: uart_1
sensor:
# - platform: pmsx003
# type: PMSX003
# uart_id: uart_1
# pm_1_0:
# name: "Particulate Matter <1.0µm Concentration"
# pm_2_5:
# name: "Particulate Matter <2.5µm Concentration"
# pm_10_0:
# name: "Particulate Matter <10.0µm Concentration"
- platform: wifi_signal
name: $upper_device_name WiFi Signal
update_interval: 30min
expire_after: 90min
icon: mdi:wifi
- platform: sgp30
eco2:
name: $upper_device_name eCO2
id: eco2
accuracy_decimals: 0
filters:
- delta: 11.0
tvoc:
name: $upper_device_name TVOC
id: tvoc
accuracy_decimals: 0
filters:
- delta: 10.0
address: 0x58
update_interval: 1s
compensation:
temperature_source: temp
humidity_source: humid
baseline:
eco2_baseline: 0x8A4A
tvoc_baseline: 0x9019
- platform: am2320
temperature:
name: $upper_device_name Temperature
id: temp
accuracy_decimals: 2
expire_after: 60min
device_class: temperature
humidity:
name: $upper_device_name Humidity
id: humid
icon: mdi:water-percent
expire_after: 60min
address: 0x5c
update_interval: 10min
- platform: template
id: tempf
lambda: |-
if (id(temp).state) {
return (id(temp).state * 9/5) + 32;
} else {
return {};
}
update_interval: 10min
font:
- file: 'fonts/arial.ttf'
id: font1
size: 12
- file: 'fonts/arial.ttf'
id: font2
size: 24
- file: 'fonts/arial.ttf'
id: font3
size: 10
display:
- platform: ssd1306_i2c
model: "SSD1306 64x48"
reset_pin: D0
address: 0x3C
id: screen
pages:
- id: tvoc_page
lambda: |-
it.print(0,0, id(font1), TextAlign::TOP_LEFT, "TVOC:");
// Print TVOC value
if (id(tvoc).has_state()) {
it.printf(32,13, id(font2), TextAlign::TOP_CENTER, " %.0f", id(tvoc).state);
it.print(64,48, id(font3), TextAlign::BOTTOM_RIGHT, "ppb");
}
- id: eco2_page
lambda: |-
it.print(0,0, id(font1), TextAlign::TOP_LEFT, "eCO2:");
// Print eCO2 value
if (id(eco2).has_state()) {
it.printf(32,13, id(font2), TextAlign::TOP_CENTER, " %.0f", id(eco2).state);
it.print(64,48, id(font3), TextAlign::BOTTOM_RIGHT, "ppm");
}
- id: temp_page
lambda: |-
it.print(0,0, id(font1), TextAlign::TOP_LEFT, "Temp:");
// Print temperature
if (id(tempf).has_state()) {
it.printf(32,13, id(font2), TextAlign::TOP_CENTER, " %.0f", id(tempf).state);
it.print(64,48, id(font3), TextAlign::BOTTOM_RIGHT, "°F");
}
- id: tempc_page
lambda: |-
it.print(0,0, id(font1), TextAlign::TOP_LEFT, "Temp:");
// Print temperature
if (id(temp).has_state()) {
it.printf(32,13, id(font2), TextAlign::TOP_CENTER, " %.0f", id(temp).state);
it.print(64,48, id(font3), TextAlign::BOTTOM_RIGHT, "°C");
}
- id: humid_page
lambda: |-
it.print(0,0, id(font1), TextAlign::TOP_LEFT, "Humidity:");
// Print Humidity
if (id(humid).has_state()) {
it.printf(32,13, id(font2), TextAlign::TOP_CENTER, " %.0f", id(humid).state);
it.print(64,48, id(font3), TextAlign::BOTTOM_RIGHT, "%");
}
interval:
- interval: 2.5s
then:
- display.page.show_next: screen
- component.update: screen