forked from 9R/esphome-miot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
zhimi.airp.mb5.yaml
272 lines (255 loc) · 5.48 KB
/
zhimi.airp.mb5.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
# https://home.miot-spec.com/spec/zhimi.airp.mb5
external_components:
source: github://dhewg/esphome-miot@main
esphome:
name: purifier
friendly_name: Air Purifier
comment: Xiaomi Smart Air Purifier 4 (zhimi.airp.mb5)
project:
name: "dhewg.esphome-miot"
version: "zhimi.airp.mb5"
esp32:
board: esp32dev
framework:
type: esp-idf
sdkconfig_options:
CONFIG_FREERTOS_UNICORE: y
advanced:
ignore_efuse_mac_crc: true
logger:
level: DEBUG
api:
encryption:
key: !secret api_encryption_key
reboot_timeout: 0s
services:
- service: mcu_command
variables:
command: string
then:
- lambda: 'id(miot_main).queue_command(command);'
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
ap:
password: !secret wifi_ap_password
captive_portal:
uart:
tx_pin: GPIO17
rx_pin: GPIO16
baud_rate: 115200
miot:
id: miot_main
miot_heartbeat_siid: 11
miot_heartbeat_piid: 4
switch:
- platform: "miot"
miot_siid: 2
miot_piid: 1
name: "Power"
icon: mdi:power
- platform: "miot"
miot_siid: 2
miot_piid: 6
name: "Ionizer"
icon: mdi:molecule
entity_category: config
- platform: "miot"
miot_siid: 6
miot_piid: 1
name: "Notification Sounds"
icon: mdi:volume-high
entity_category: config
- platform: "miot"
miot_siid: 8
miot_piid: 1
name: "Child Lock"
icon: mdi:lock
entity_category: config
binary_sensor:
- platform: "miot"
miot_siid: 9
miot_piid: 6
name: "Filter Door"
device_class: opening
entity_category: diagnostic
select:
- platform: "miot"
miot_siid: 2
miot_piid: 4
name: "Mode"
options:
0: "Auto"
1: "Sleep"
2: "Favorite"
3: "Manual"
- platform: "miot"
miot_siid: 2
miot_piid: 5
name: "Fan Level"
icon: mdi:fan
options:
1: "Low"
2: "Medium"
3: "High"
- platform: "miot"
miot_siid: 13
miot_piid: 2
name: "Display Brightness"
icon: mdi:brightness-6
entity_category: config
options:
0: "Off"
1: "Low"
2: "High"
- platform: "miot"
miot_siid: 14
miot_piid: 1
name: "Temperature Display Unit"
icon: mdi:temperature-celsius
entity_category: config
options:
1: "Celsius"
2: "Fahrenheit"
text_sensor:
- platform: "miot"
miot_siid: 1
miot_piid: 5
miot_poll: false
name: "Serial Number"
icon: mdi:numeric
entity_category: diagnostic
- platform: "miot"
miot_siid: 2
miot_piid: 2
name: "Device Fault"
icon: mdi:fan-alert
entity_category: diagnostic
filters:
- map:
- "0 -> No Faults"
- "1 -> PM2.5 Sensor Error"
- "2 -> Temperature Error"
- "3 -> Humidity Error"
- "4 -> No Filter Detected"
number:
- platform: "miot"
miot_siid: 9
miot_piid: 2
name: "Favorite Speed"
icon: mdi:speedometer
# specs claim 200-2300, but the mcu only accepts 450-2000
min_value: 450
max_value: 2000
step: 1
- platform: "miot"
miot_siid: 9
miot_piid: 4
name: "Manual Speed"
icon: mdi:speedometer
# specs claim 0-2000, but the mcu only accepts 450-2000
min_value: 450
max_value: 2000
step: 1
- platform: "miot"
miot_siid: 9
miot_piid: 5
name: "Favorite Level"
icon: mdi:speedometer
# specs claim 0-11, but the mcu only accepts 1-11
min_value: 1
max_value: 11
step: 1
- platform: "miot"
miot_siid: 9
miot_piid: 9
name: "Manual Level"
icon: mdi:speedometer
min_value: 1
max_value: 11
step: 1
sensor:
- platform: "miot"
miot_siid: 3
miot_piid: 1
name: "Relative Humidity"
unit_of_measurement: "%"
device_class: humidity
state_class: "measurement"
- platform: "miot"
miot_siid: 3
miot_piid: 4
name: "PM2.5 Density"
unit_of_measurement: "µg/m³"
device_class: pm25
state_class: "measurement"
- platform: "miot"
miot_siid: 3
miot_piid: 7
name: "Temperature"
unit_of_measurement: "°C"
device_class: temperature
accuracy_decimals: 1
state_class: "measurement"
- platform: "miot"
miot_siid: 4
miot_piid: 1
name: "Filter Life Level"
unit_of_measurement: "%"
icon: mdi:air-filter
- platform: "miot"
miot_siid: 4
miot_piid: 3
name: "Filter Used Time"
entity_category: diagnostic
unit_of_measurement: "h"
icon: mdi:air-filter
- platform: "miot"
miot_siid: 4
miot_piid: 4
name: "Filter Lifetime Remaining"
entity_category: diagnostic
unit_of_measurement: "d"
icon: mdi:air-filter
- platform: "miot"
miot_siid: 9
miot_piid: 1
name: "Motor Speed"
unit_of_measurement: "rpm"
icon: mdi:fan
- platform: "miot"
miot_siid: 11
miot_piid: 1
name: "Total Purified Volume"
unit_of_measurement: "m³"
state_class: "measurement"
- platform: "miot"
miot_siid: 11
miot_piid: 2
name: "Average AQI"
state_class: "measurement"
button:
- platform: "miot"
miot_siid: 2
miot_aiid: 1
name: "Toggle Power"
icon: mdi:power
- platform: "miot"
miot_siid: 4
miot_aiid: 1
miot_action_args: "3 0"
name: "Reset Filter Life"
icon: mdi:restart
entity_category: config
- platform: "miot"
miot_siid: 9
miot_aiid: 1
name: "Toggle Mode"
icon: mdi:cached
- platform: "miot"
miot_siid: 9
miot_aiid: 2
name: "Toggle Fan Level"
icon: mdi:approximately-equal