-
Notifications
You must be signed in to change notification settings - Fork 26
/
daikin-bry88ab151k-ch2o.yaml
349 lines (332 loc) · 7.13 KB
/
daikin-bry88ab151k-ch2o.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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
esphome:
name: daikin-air-sensor
project:
name: "DAIKIN.BRY88AB151K"
version: "PM2105" #根据PM2.5传感器型号选择,方便后续OTA查找文件
# version: "PM2005"
name_add_mac_suffix: true
includes:
- "ze08-ch2o.h"
- "cm1106.h"
- "pm2105.h" #根据PM2.5传感器型号选择
# - "pm2005.h"
esp32:
board: nodemcu-32s
wifi:
# ssid: 'L' #填写自己的WiFi及密码
# password: '1234567890'
ap:
ssid: "DAIKIN Fallback Hotspot"
captive_portal:
api:
reboot_timeout: 0s
ota:
web_server:
port: 80
logger:
logs:
sgp30: WARN
hdc1080: WARN
sensor: WARN
component: ERROR
# bluetooth_proxy: #需要蓝牙代理功能可以打开
# active: true
# esp32_ble_tracker:
uart:
- id: cm1106_uart
rx_pin: 16
tx_pin: 17
baud_rate: 9600
- id: uart_ze08
tx_pin: 18
rx_pin: 5
baud_rate: 9600
i2c:
- id: pm25_bus
sda: 23
scl: 22
scan: true
- id: th_bus
sda: 19
scl: 21
scan: true
custom_component:
- lambda: |-
auto ze08 = new WinsenZE08Sensor(id(uart_ze08), id(ze08_ch2o));
App.register_component(ze08);
return {ze08};
sensor:
- platform: template
name: "DAIKIN CH2O Sensor"
id: ze08_ch2o
device_class: volatile_organic_compounds
state_class: measurement
unit_of_measurement: "µg/m³"
accuracy_decimals: 0
- platform: custom
lambda: |-
auto cm1106Sensor = new CM1106Sensor(id(cm1106_uart), 10000);
App.register_component(cm1106Sensor);
return {cm1106Sensor};
sensors:
- name: "DAIKIN CO2 Sensor"
id: co2sensor
device_class: carbon_dioxide
state_class: measurement
unit_of_measurement: "ppm"
- platform: custom
lambda: |-
auto pm25 = new pm2005();
App.register_component(pm25);
return {pm25};
sensors:
- name: "DAIKIN PM2.5 Sensor"
id: pm25sensor
device_class: pm25
state_class: measurement
unit_of_measurement: "µg/m³"
- platform: sgp30
i2c_id: th_bus
compensation:
temperature_source: temperature
humidity_source: humidity
eco2:
id: eco2sensor
internal: true
tvoc:
name: "DAIKIN TVOC Sensor"
id: tvocsensor
device_class: volatile_organic_compounds
unit_of_measurement: "µg/m³"
filters:
- throttle: 15s
- lambda: |-
if (x * id(tvocmultiply).state > id(tvocmax).state) {
return id(tvocmax).state;
} else {
return x * id(tvocmultiply).state;
}
- platform: hdc1080
i2c_id: th_bus
update_interval: 15s
temperature:
name: "DAIKIN Temperature Sensor"
id: temperature
filters:
- lambda: return x - id(temperatureoffset).state;
humidity:
name: "DAIKIN Humidity Sensor"
id: humidity
filters:
- lambda: return x * id(humiditymultiply).state;
- clamp:
max_value: 100
- platform: wifi_signal
name: "DAIKIN Signal"
switch:
- platform: template
name: "DAIKIN LED Indicator"
restore_mode: RESTORE_DEFAULT_OFF
icon: mdi:led-off
id: indicator
optimistic: true
- platform: custom
lambda: |-
auto cm1106Calib = new CM1106CalibrateSwitch(id(cm1106_uart));
App.register_component(cm1106Calib);
return {cm1106Calib};
switches:
id: calibration
internal: true
- platform: gpio
pin: 4
id: co2led
internal: true
- platform: gpio
pin: 32
id: tvocch2oled
internal: true
- platform: gpio
pin: 33
id: pm25led
internal: true
status_led:
pin: 25
number:
- platform: template
name: "DAIKIN Threshold CO2"
entity_category: "config"
id: co2threshold
optimistic: true
unit_of_measurement: "ppm"
min_value: 400
max_value: 5000
step: 100
initial_value: 1000
restore_value: true
- platform: template
name: "DAIKIN Threshold PM2.5"
entity_category: "config"
id: pm25threshold
optimistic: true
unit_of_measurement: "µg/m³"
min_value: 0
max_value: 200
step: 10
initial_value: 50
restore_value: true
- platform: template
name: "DAIKIN Threshold CH2O"
entity_category: "config"
id: ch2othreshold
optimistic: true
unit_of_measurement: "µg/m³"
min_value: 10
max_value: 200
step: 10
initial_value: 100
restore_value: true
- platform: template
name: "DAIKIN Threshold TVOC"
entity_category: "config"
id: tvocthreshold
optimistic: true
unit_of_measurement: "µg/m³"
min_value: 0
max_value: 20000
step: 1000
initial_value: 1000
restore_value: true
- platform: template
name: "DAIKIN TVOC MAX"
entity_category: "config"
id: tvocmax
optimistic: true
unit_of_measurement: "µg/m³"
min_value: 5000
max_value: 20000
step: 1000
initial_value: 10000
restore_value: true
- platform: template
name: "DAIKIN TVOC Multiply"
entity_category: "config"
id: tvocmultiply
optimistic: true
min_value: 1
max_value: 5
step: 0.1
initial_value: 3
restore_value: true
- platform: template
name: "DAIKIN Humidity Multiply"
entity_category: "config"
id: humiditymultiply
optimistic: true
min_value: 1
max_value: 1.6
step: 0.01
initial_value: 1.4
restore_value: true
- platform: template
name: "DAIKIN Temperature Offset"
entity_category: "config"
id: temperatureoffset
optimistic: true
min_value: 0
max_value: 10
step: 0.1
initial_value: 6
restore_value: true
binary_sensor:
- platform: template
internal: true
id: tvocch2olambda
lambda: |-
if (id(indicator).state == true) {
if (id(ze08_ch2o).state > id(ch2othreshold).state || id(tvocsensor).state > id(tvocthreshold).state) {
return true;
} else {
return false;
}
} else {
return false;
}
on_press:
then:
- switch.turn_on: tvocch2oled
on_release:
then:
- switch.turn_off: tvocch2oled
- platform: template
internal: true
id: co2lambda
lambda: |-
if (id(indicator).state == true) {
if (id(co2sensor).state > id(co2threshold).state) {
return true;
} else {
return false;
}
} else {
return false;
}
on_press:
then:
- switch.turn_on: co2led
on_release:
then:
- switch.turn_off: co2led
- platform: template
internal: true
id: pm25lambda
lambda: |-
if (id(indicator).state == true) {
if (id(pm25sensor).state > id(pm25threshold).state) {
return true;
} else {
return false;
}
} else {
return false;
}
on_press:
then:
- switch.turn_on: pm25led
on_release:
then:
- switch.turn_off: pm25led
- platform: template
internal: true
id: co2_calibration
lambda: |-
if (id(co2sensor).state == 400) {
return true;
} else {
return false;
}
filters:
- delayed_on: 5min #CO2持续400ppm并保持5分钟会自动校准
on_press:
then:
- switch.turn_on: calibration
- platform: gpio
pin: 34
id: RESET
internal: true
on_press:
then:
- button.press: reset
button:
- platform: restart
name: "DAIKIN Restart"
entity_category: "diagnostic"
- platform: factory_reset
id: reset
internal: true
- platform: template
name: "DAIKIN CO2 Calibration" #按下后会将当前环境CO2浓度设置为基准400ppm,按下时请确保放入室外或此时CO2浓度足够低
entity_category: "diagnostic"
on_press:
then:
- switch.turn_on: calibration