-
Notifications
You must be signed in to change notification settings - Fork 1
/
tuya.yaml
261 lines (252 loc) · 12.4 KB
/
tuya.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
external_components:
- source:
type: local
path: components
components: [ tuya_rf ]
esphome:
name: tuya
bk72xx:
board: cbu
framework:
version: latest
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable logging
logger:
web_server:
version: 3
# Enable Home Assistant API
api:
reboot_timeout: 0s
ota:
platform: esphome
password: !secret ota_password
#status led
output:
platform: gpio
id: status
pin: P9
#reset button, it has an external pull-down in my board
binary_sensor:
- platform: gpio
id: reset_button
pin: P23
#rf transmitter and receiver
tuya_rf:
id: rf
receiver_disabled: true
dump: raw
#for the ir leds
remote_transmitter:
id: ir
pin: P7
carrier_duty_percent: 50%
#for the ir receiver
remote_receiver:
pin:
number: P8
inverted: true
dump: nec
button:
- platform: template
name: irtest
web_server_sorting_weight: 1000
on_press:
- remote_transmitter.transmit_nec:
transmitter_id: ir
address: 0xFA05
command: 0xEB14
command_repeats: 1
- platform: template
name: turn off receiver
web_server_sorting_weight: 1010
on_press:
- tuya_rf.turn_off_receiver:
- platform: template
name: turn on receiver
web_server_sorting_weight: 1020
on_press:
- tuya_rf.turn_on_receiver:
- platform: template
name: play/pause
web_server_sorting_weight: 10
on_press:
- output.turn_on: status
- remote_transmitter.transmit_raw:
transmitter_id: rf
repeat:
times: 7
wait_time: 0s
#code: [6042,-1106,391,-1106,391,-391,1106,-333,1106,-391,1106,-391,1106,-333,1106,-391,1106,-391,1106,-1106,391,-1106,391,-391,1106,-1106,391,-1106,391,-391,1106,-1106,391,-391,1106,-1106,391,-391,1106,-1106,391,-1106,391,-1106,391,-391,1106,-391,1106,-1106,391,-391,1106,-391,1106,-391,1106,-1106,333,-1106]
code: [6027, -1093, 375, -1145, 355, -375, 1093, -406, 1094, -389, 1079, -406, 1094, -374, 1114, -386, 1094, -374, 1094, -1145, 354, -1096, 373, -406, 1094, -1145, 323, -1125, 375, -375, 1114, -1104, 375, -406, 1094, -1114, 354, -406, 1093, -1125,
344, -1145, 386, -1093, 375, -375, 1114, -355, 1093, -1125, 406, -344, 1145, -355, 1124, -344, 1125, -1114, 386, -1093]
- output.turn_off: status
- platform: template
name: 1
web_server_sorting_weight: 20
on_press:
- output.turn_on: status
- remote_transmitter.transmit_raw:
transmitter_id: rf
repeat:
times: 7
wait_time: 0s
#code: [6750,-1106,391,-1106,391,-391,1106,-391,1106,-391,1106,-391,1106,-391,1106,-391,1106,-391,1106,-1106,332,-1106,391,-391,1106,-1106,391,-1106,391,-391,1106,-1106,391,-391,1106,-1106,332,-391,1106,-1106,391,-1106,391,-1106,391,-1106,391,-1106,391,-391,1106,-1106,391,-391,1106,-391,1106,-391,1106,-391]
code: [6744, -1115, 386, -1095, 375, -375, 1125, -348, 1099, -398, 1126, -344, 1107, -424, 1094, -344, 1126, -375, 1146, -1107, 352, -1096, 394, -345, 1144, -1075, 406, -1095, 378, -379, 1118, -1095, 375, -409, 1112, -1073, 376, -375, 1125, -1115,
354, -1094, 407, -1094, 375, -1115, 386, -1094, 375, -406, 1115, -1105, 388, -362, 1094, -376, 1115, -385, 1094, -376]
- output.turn_off: status
- platform: template
name: 2
web_server_sorting_weight: 30
on_press:
- output.turn_on: status
- remote_transmitter.transmit_raw:
transmitter_id: rf
repeat:
times: 7
wait_time: 0s
#code: [6013,-1093,387,-1093,341,-387,1093,-387,1093,-387,1128,-341,1128,-387,1093,-387,1093,-387,1128,-1093,387,-1093,387,-387,1093,-1093,387,-1093,387,-387,1128,-1093,387,-387,1128,-1093,387,-387,1093,-1128,387,-1093,387,-1093,387,-1093,387,-387,1093,-387,1128,-1093,387,-387,1093,-387,1093,-387,1093,-1093]
code: [6061, -1095, 344, -1146, 354, -375, 1095, -406, 1129, -349, 1117, -375, 1126, -344, 1146, -354, 1126, -375, 1094, -1115, 386, -1097, 372, -375, 1129, -1100, 366, -1094, 407, -344, 1146, -1074, 409, -341, 1125, -1115, 386, -344, 1125, -1094,
407, -1115, 354, -1126, 375, -1099, 391, -354, 1126, -375, 1094, -1146, 386, -344, 1126, -375, 1094, -378, 1100, -1117]
- output.turn_off: status
- platform: template
name: 3
web_server_sorting_weight: 40
on_press:
- output.turn_on: status
- remote_transmitter.transmit_raw:
transmitter_id: rf
repeat:
times: 7
wait_time: 0s
#code: [6803,-1105,379,-1105,379,-379,1105,-379,1105,-379,1105,-379,1105,-379,1105,-379,1105,-379,1105,-1105,379,-1105,379,-379,1105,-1105,379,-1105,379,-379,1105,-1105,379,-379,1105,-1105,379,-379,1105,-1105,379,-1105,379,-1105,379,-379,1105,-1105,379,-379,1105,-1105,379,-379,1105,-379,1105,-1105,379,-379]
code: [6768, -1079, 406, -1094, 376, -396, 1073, -406, 1095, -375, 1146, -323, 1126, -375, 1126, -344, 1161, -370, 1095, -1094, 375, -1115, 386, -344, 1125, -1095, 427, -1073, 375, -375, 1126, -1115, 354, -375, 1126, -1094, 376, -375, 1140, -1080,
375, -1094, 410, -1099, 367, -406, 1095, -1105, 364, -406, 1094, -1095, 375, -406, 1115, -355, 1125, -1095, 375, -390]
- output.turn_off: status
- platform: template
name: 4
web_server_sorting_weight: 50
on_press:
- output.turn_on: status
- remote_transmitter.transmit_raw:
transmitter_id: rf
repeat:
times: 7
wait_time: 0s
#code: [6005,-1105,379,-1105,379,-379,1105,-379,1105,-379,1105,-379,1105,-379,1105,-379,1105,-379,1105,-1105,379,-1105,379,-379,1105,-1105,379,-1105,379,-379,1105,-1105,379,-379,1105,-1105,379,-379,1105,-1105,379,-1105,379,-1105,379,-379,1105,-379,1105,-379,1105,-1105,379,-379,1105,-379,1105,-1105,379,-1105]
code: [6034, -1115, 386, -1094, 375, -375, 1104, -400, 1091, -375, 1094, -407, 1115, -354, 1095, -406, 1094, -374, 1116, -1105, 375, -1094, 411, -385, 1080, -1095, 406, -1098, 380, -367, 1094, -1125, 376, -375, 1146, -1073, 379, -372, 1094, -1144,
357, -1094, 406, -1095, 389, -361, 1125, -376, 1094, -406, 1115, -1075, 374, -406, 1094, -386, 1084, -1094, 406, -1126]
- output.turn_off: status
- platform: template
name: 5
web_server_sorting_weight: 60
on_press:
- output.turn_on: status
- remote_transmitter.transmit_raw:
transmitter_id: rf
repeat:
times: 7
wait_time: 0s
#code: [6816,-1105,379,-1105,379,-379,1105,-379,1105,-379,1105,-379,1105,-379,1105,-379,1105,-379,1105,-1105,379,-1105,379,-379,1105,-1105,379,-1105,379,-379,1105,-1105,379,-379,1105,-1105,379,-379,1105,-1105,379,-1105,379,-379,1105,-1105,379,-1105,379,-379,1105,-1105,379,-379,1105,-1105,379,-379,1105,-379]
code: [6784, -1094, 375, -1115, 386, -344, 1126, -375, 1135, -334, 1094, -407, 1094, -407, 1115, -354, 1126, -344, 1125, -1115, 386, -1094, 375, -375, 1126, -1108, 361, -1094, 407, -344, 1146, -1073, 407, -344, 1125, -1115, 386, -344, 1125, -1094,
422, -1100, 354, -406, 1095, -1094, 389, -1080, 407, -344, 1156, -1115, 355, -375, 1094, -1126, 375, -388, 1081, -407]
- output.turn_off: status
- platform: template
name: 6
web_server_sorting_weight: 70
on_press:
- output.turn_on: status
- remote_transmitter.transmit_raw:
transmitter_id: rf
repeat:
times: 7
wait_time: 0s
#code: [5933,-1104,379,-1104,379,-379,1104,-379,1104,-379,1104,-379,1104,-379,1104,-379,1104,-379,1104,-1104,379,-1104,379,-379,1104,-1104,379,-1104,379,-379,1104,-1104,379,-379,1104,-1104,379,-379,1104,-1104,379,-1104,379,-379,1104,-1104,379,-379,1104,-379,1104,-1104,379,-379,1104,-1104,379,-379,1104,-1104]
code: [6034, -1115, 386, -1125, 344, -407, 1097, -386, 1080, -407, 1094, -375, 1115, -386, 1097, -372, 1094, -407, 1115, -1104, 344, -1126, 375, -396, 1074, -1094, 406, -1099, 391, -386, 1094, -1126, 344, -406, 1115, -1105, 344, -406, 1095, -1146,
323, -1106, 395, -375, 1129, -1097, 369, -375, 1126, -375, 1146, -1073, 376, -406, 1094, -1115, 355, -375, 1125, -1095]
- output.turn_off: status
- platform: template
name: random
web_server_sorting_weight: 80
on_press:
- output.turn_on: status
- remote_transmitter.transmit_raw:
transmitter_id: rf
repeat:
times: 7
wait_time: 0s
code: [6046,-1103,380,-1103,380,-380,1103,-380,1103,-380,1103,-380,1103,-380,1103,-380,1103,-380,1103,-1103,380,-1103,380,-380,1103,-1103,380,-1103,380,-380,1103,-1103,380,-380,1103,-1103,380,-380,1103,-1103,380,-1103,380,-380,1103,-380,1103,-380,1103,-380,1103,-1103,380,-380,1103,-1103,380,-1103,380,-1103]
- output.turn_off: status
- platform: template
name: invert
web_server_sorting_weight: 90
on_press:
- output.turn_on: status
- remote_transmitter.transmit_raw:
transmitter_id: rf
repeat:
times: 7
wait_time: 0s
code: [6728,-1105,333,-1105,388,-388,1105,-388,1105,-388,1105,-388,1105,-388,1105,-388,1105,-388,1105,-1105,388,-1105,388,-388,1105,-1105,388,-1105,388,-388,1105,-1105,388,-388,1105,-1105,388,-388,1105,-1105,388,-1105,388,-388,1105,-388,1105,-1105,333,-388,1105,-1105,388,-388,1105,-1105,388,-1105,388,-333]
- output.turn_off: status
- platform: template
name: 1h
web_server_sorting_weight: 100
on_press:
- output.turn_on: status
- remote_transmitter.transmit_raw:
transmitter_id: rf
repeat:
times: 7
wait_time: 0s
code: [6068,-1106,390,-1106,390,-390,1106,-390,1106,-390,1106,-390,1106,-390,1106,-390,1106,-390,1106,-1106,390,-1106,332,-390,1106,-1106,332,-1106,390,-390,1106,-1106,390,-390,1106,-1106,332,-390,1106,-1106,390,-332,1106,-1106,390,-390,1106,-390,1106,-1106,390,-390,1106,-1106,332,-390,1106,-1106,390,-1106]
- output.turn_off: status
- platform: template
name: 2h
web_server_sorting_weight: 110
on_press:
- output.turn_on: status
- remote_transmitter.transmit_raw:
transmitter_id: rf
repeat:
times: 7
wait_time: 0s
code: [6698,-1108,392,-1108,392,-392,1108,-392,1108,-392,1108,-392,1108,-331,1108,-392,1108,-392,1108,-1108,392,-1108,331,-392,1108,-1108,392,-1108,392,-392,1108,-1108,392,-392,1108,-1108,392,-392,1108,-1108,392,-392,1108,-392,1108,-392,1108,-1108,392,-1108,392,-392,1108,-1108,392,-1108,392,-1108,392,-331]
- output.turn_off: status
- platform: template
name: 4h
web_server_sorting_weight: 120
on_press:
- output.turn_on: status
- remote_transmitter.transmit_raw:
transmitter_id: rf
repeat:
times: 7
wait_time: 0s
code: [6713,-1103,380,-1103,380,-380,1103,-380,1103,-380,1103,-380,1103,-380,1103,-380,1103,-380,1103,-1103,380,-1103,380,-380,1103,-1103,380,-1103,380,-380,1103,-1103,380,-380,1103,-1103,380,-380,1103,-1103,380,-380,1103,-380,1103,-1103,380,-1103,380,-1103,380,-380,1103,-1103,380,-1103,380,-380,1103,-380]
- output.turn_off: status
- platform: template
name: 8h
web_server_sorting_weight: 130
on_press:
- output.turn_on: status
- remote_transmitter.transmit_raw:
transmitter_id: rf
repeat:
times: 7
wait_time: 0s
code: [6041,-1104,379,-1104,379,-379,1104,-379,1104,-379,1104,-379,1104,-379,1104,-379,1104,-379,1104,-1104,379,-1104,379,-379,1104,-1104,379,-1104,379,-379,1104,-1104,379,-379,1104,-1104,379,-379,1104,-1104,379,-1104,379,-379,1104,-1104,379,-379,1104,-1104,379,-379,1104,-379,1104,-1104,379,-379,1104,-1104]
- output.turn_off: status
- platform: template
name: luz
web_server_sorting_weight: 140
on_press:
- output.turn_on: status
- remote_transmitter.transmit_raw:
transmitter_id: rf
repeat:
times: 7
wait_time: 0s
code: [6756,-1105,379,-1105,379,-379,1105,-379,1105,-379,1105,-379,1105,-379,1105,-379,1105,-379,1105,-1105,379,-1105,379,-379,1105,-1105,379,-1105,379,-379,1105,-1105,379,-379,1105,-1105,379,-379,1105,-1105,379,-379,1105,-1105,379,-379,1105,-1105,379,-1105,379,-379,1105,-1105,379,-379,1105,-1105,379,-379]
- output.turn_off: status