-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome-center-v02.yaml
352 lines (335 loc) · 9.61 KB
/
home-center-v02.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
350
351
substitutions:
devicename: home-center-v02
mqttTopicPre: "homeCenterV02"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_pw
fast_connect: true
ap:
ssid: ${devicename}
password: !secret ap_pw
# captive_portal:
# web_server:
# port: !secret web_port
# auth:
# username: !secret web_user
# password: !secret web_pw
api:
password: !secret api_pw
ota:
password: !secret ota_pw
logger:
level: DEBUG
esphome:
name: ${devicename}
platform: ESP32
board: esp-wrover-kit
# esp32_ble_tracker:
# scan_parameters:
# interval: 320ms
# window: 160ms
mqtt:
broker: 192.168.50.10
remote_receiver:
- id: receiver_433M
pin:
number: GPIO19
tolerance: 50%
filter: 500us
idle: 3ms
- id: receiver_38K
pin:
number: GPIO16
inverted: True
# dump: all
on_lg:
receiver_id: receiver_38K
then:
- lambda: |-
if (x.data & 0x10000000) {
id(climate_switch).publish_state(true);
} else {
id(climate_switch).publish_state(false);
}
# status_led:
# pin:
# number: GPIO13
# inverted: yes
binary_sensor:
- platform: gpio
name: "门"
device_class: door
pin:
number: GPIO23
mode: INPUT_PULLUP
filters:
- delayed_on: 100ms
- delayed_off: 100ms
- platform: gpio
name: "门2"
device_class: door
pin:
number: GPIO4
mode: INPUT_PULLUP
filters:
- delayed_on: 100ms
- delayed_off: 100ms
- platform: remote_receiver
receiver_id: receiver_433M
name: "rf1"
filters:
- delayed_off: 240ms
rc_switch_raw:
code: "000001000101111011010001"
on_multi_click:
- timing:
- ON for at most 1s
- OFF for at least 300ms
then:
- logger.log: "dot"
- mqtt.publish:
topic: ${mqttTopicPre}/rf1/dot
payload: "dot"
invalid_cooldown: 0s
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for at most 1s
- OFF for at least 300ms
then:
- logger.log: "dot dot"
- mqtt.publish:
topic: ${mqttTopicPre}/rf1/dotdot
payload: "dotdot"
invalid_cooldown: 0s
- timing:
- ON for at least 2s
then:
- logger.log: "dash"
- mqtt.publish:
topic: ${mqttTopicPre}/rf1/dash
payload: "dash"
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for at least 2s
then:
- logger.log: "dot dash"
- mqtt.publish:
topic: ${mqttTopicPre}/rf1/dotdash
payload: "dotdash"
invalid_cooldown: 0s
- platform: remote_receiver
receiver_id: receiver_433M
name: "rf2"
filters:
- delayed_off: 240ms
rc_switch_raw:
code: "111110000001111011010001"
on_multi_click:
- timing:
- ON for at most 1s
- OFF for at least 300ms
then:
- logger.log: "dot"
- mqtt.publish:
topic: ${mqttTopicPre}/rf2/dot
payload: "dot"
invalid_cooldown: 0s
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for at most 1s
- OFF for at least 300ms
then:
- logger.log: "dot dot"
- mqtt.publish:
topic: ${mqttTopicPre}/rf2/dotdot
payload: "dotdot"
invalid_cooldown: 0s
- timing:
- ON for at least 2s
then:
- logger.log: "dash"
- mqtt.publish:
topic: ${mqttTopicPre}/rf2/dash
payload: "dash"
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for at least 2s
then:
- logger.log: "dot dash"
- mqtt.publish:
topic: ${mqttTopicPre}/rf2/dotdash
payload: "dotdash"
invalid_cooldown: 0s
- platform: remote_receiver
receiver_id: receiver_433M
name: "rf3"
filters:
- delayed_off: 240ms
rc_switch_raw:
code: "111001111101011110100001"
on_multi_click:
- timing:
- ON for at most 1s
- OFF for at least 300ms
then:
- logger.log: "dot"
- mqtt.publish:
topic: ${mqttTopicPre}/rf3/dot
payload: "dot"
invalid_cooldown: 0s
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for at most 1s
- OFF for at least 300ms
then:
- logger.log: "dot dot"
- mqtt.publish:
topic: ${mqttTopicPre}/rf3/dotdot
payload: "dotdot"
invalid_cooldown: 0s
- timing:
- ON for at least 2s
then:
- logger.log: "dash"
- mqtt.publish:
topic: ${mqttTopicPre}/rf3/dash
payload: "dash"
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for at least 2s
then:
- logger.log: "dot dash"
- mqtt.publish:
topic: ${mqttTopicPre}/rf3/dotdash
payload: "dotdash"
invalid_cooldown: 0s
- platform: remote_receiver
receiver_id: receiver_433M
name: "rf3"
filters:
- delayed_off: 240ms
rc_switch_raw:
code: "111011110101001110100001"
on_multi_click:
- timing:
- ON for at most 1s
- OFF for at least 300ms
then:
- logger.log: "dot"
- mqtt.publish:
topic: ${mqttTopicPre}/rf4/dot
payload: "dot"
invalid_cooldown: 0s
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for at most 1s
- OFF for at least 300ms
then:
- logger.log: "dot dot"
- mqtt.publish:
topic: ${mqttTopicPre}/rf4/dotdot
payload: "dotdot"
invalid_cooldown: 0s
- timing:
- ON for at least 2s
then:
- logger.log: "dash"
- mqtt.publish:
topic: ${mqttTopicPre}/rf4/dash
payload: "dash"
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for at least 2s
then:
- logger.log: "dot dash"
- mqtt.publish:
topic: ${mqttTopicPre}/rf4/dotdash
payload: "dotdash"
invalid_cooldown: 0s
# sensor:
# - platform: xiaomi_cgg1
# mac_address: "58:2D:34:10:41:3B"
# temperature:
# name: "CGG1 Temperature"
# humidity:
# name: "CGG1 Humidity"
# icon: mdi:water-percent
# battery_level:
# name: "CGG1 Battery"
# icon: mdi:battery-80
# - platform: xiaomi_miscale2
# mac_address: '5C:CA:D3:5D:A1:C6'
# weight:
# name: "Scale Weight"
# id: weight_miscale
# on_value:
# then:
# - lambda: |-
# if (id(weight_miscale).state >= 60 && id(weight_miscale).state < 80) {
# return id(weight_kay).publish_state(x);}
# else if (id(weight_miscale).state >= 40 && id(weight_miscale).state < 60) {
# return id(weight_ruby).publish_state(x);}
# impedance:
# name: "Scale Impedance"
# id: impedance_xiaomi
# on_value:
# then:
# - lambda: |-
# if (id(weight_miscale).state >= 60 && id(weight_miscale).state < 80) {
# return id(impedance_kay).publish_state(x);}
# else if (id(weight_miscale).state >= 40 && id(weight_miscale).state < 60) {
# return id(impedance_ruby).publish_state(x);}
# - platform: template
# name: Weight Kay
# id: weight_kay
# unit_of_measurement: 'kg'
# icon: mdi:weight-kilogram
# accuracy_decimals: 2
# - platform: template
# name: Impedance Kay
# id: impedance_kay
# unit_of_measurement: 'ohm'
# icon: mdi:omega
# accuracy_decimals: 0
# - platform: template
# name: Weight Ruby
# id: weight_ruby
# unit_of_measurement: 'kg'
# icon: mdi:weight-kilogram
# accuracy_decimals: 2
# - platform: template
# name: Impedance Ruby
# id: impedance_ruby
# unit_of_measurement: 'ohm'
# icon: mdi:omega
# accuracy_decimals: 0
remote_transmitter:
pin: GPIO14
# Infrared remotes use a 50% carrier signal
carrier_duty_percent: 50%
switch:
- platform: template
name: "空调"
icon: mdi:air-conditioner
id: climate_switch
optimistic: true
turn_on_action:
remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
code: [9000, -4500, 560, -560, 560, -560, 560, -560, 560, -1680, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -1680, 560, -1680, 560, -1680, 560, -560, 560, -560,
560, -560, 560, -1680, 560, -1680, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -1680, 560, -560, 560, -560,
560, -560, 560, -560, 560, -560, 560, -1680, 560, -1680, 560, -560, 560, -560, 560, -560, 560, -560, 560, -10080]
turn_off_action:
remote_transmitter.transmit_raw:
carrier_frequency: 38kHz
code: [9000, -4500, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -1680, 560, -1680, 560, -1680, 560, -560, 560, -560,
560, -560, 560, -1680, 560, -1680, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -560, 560, -1680, 560, -560, 560, -560,
560, -560, 560, -560, 560, -560, 560, -1680, 560, -1680, 560, -560, 560, -560, 560, -560, 560, -560, 560, -10080]