1
1
---
2
2
title : KinCony KC868-A4
3
3
date-published : 2023-04-19
4
- type : relay
4
+ type : automate
5
5
standard : global
6
6
board : esp32
7
7
---
@@ -41,20 +41,30 @@ board: esp32
41
41
## Basic Configuration
42
42
43
43
``` yaml
44
- # Basic Config
44
+ # Basic Config by Gaetan Caron
45
+
46
+ substitutions :
47
+ number : " 1"
48
+ device_name : kc868-a4-${number}
49
+ device_description : Kincony kc868-a4
50
+ friendly_name : kc868-a4 ${number}
51
+
45
52
esphome :
46
- name : kc868-a4
47
- platform : ESP32
53
+ name : ${device_name}
54
+ comment : ${device_description}
55
+ esp32 :
48
56
board : esp32dev
49
57
50
58
# Enable logging
51
59
logger :
52
60
53
61
# Enable Home Assistant API
54
62
api :
63
+ encryption :
64
+ key : " your api key"
55
65
56
66
ota :
57
- password : " 4d5a388de4f759bf88e71cde7a31af6f "
67
+ password : " your ota password "
58
68
59
69
wifi :
60
70
ssid : " KinCony"
@@ -63,38 +73,57 @@ wifi:
63
73
# Enable fallback hotspot (captive portal) in case wifi connection fails
64
74
ap :
65
75
ssid : " Kc868-A4 Fallback Hotspot"
66
- password : " QOU4hbAjJ5Wb"
67
-
76
+ password : " 1234Ab"
77
+ text_sensor :
78
+ - platform : wifi_info
79
+ ip_address :
80
+ name : ESP IP Address
81
+ ssid :
82
+ name : ESP Connected SSID
83
+ bssid :
84
+ name : ESP Connected BSSID
85
+ mac_address :
86
+ name : ESP Mac Wifi Address
68
87
captive_portal :
69
88
89
+ one_wire :
90
+ # enable temperature bus
91
+ - platform : gpio
92
+ pin : 13
93
+
70
94
switch :
71
95
- platform : gpio
72
- name : " light1 "
96
+ name : " Relay 1 "
73
97
pin : 2
74
98
inverted : false
75
99
76
100
- platform : gpio
77
- name : " light2 "
101
+ name : " Relay 2 "
78
102
pin : 15
79
103
inverted : false
80
104
81
105
- platform : gpio
82
- name : " light3 "
106
+ name : " Relay 3 "
83
107
pin : 5
84
108
inverted : false
85
109
86
110
- platform : gpio
87
- name : " light4 "
111
+ name : " Relay 4 "
88
112
pin : 4
89
113
inverted : false
114
+ # enable use of internal buzzer
115
+ - platform : gpio
116
+ id : buzzer
117
+ name : " buzzer"
118
+ pin : 18
90
119
91
120
binary_sensor :
92
121
- platform : gpio
93
122
name : " input1"
94
123
pin :
95
124
number : 36
96
125
inverted : true
97
-
126
+
98
127
- platform : gpio
99
128
name : " input2"
100
129
pin :
@@ -112,4 +141,117 @@ binary_sensor:
112
141
pin :
113
142
number : 14
114
143
inverted : true
144
+ # enable use of internal button
145
+ - platform : gpio
146
+ pin :
147
+ number : 0
148
+ inverted : true
149
+ mode : INPUT_PULLUP
150
+ name : " PCB Button"
151
+
152
+ sensor :
153
+ # statistic sensor for convenience
154
+ - platform : uptime
155
+ name : ${friendly_name} Uptime
156
+ unit_of_measurement : minutes
157
+ filters :
158
+ - lambda : return x / 60.0;
159
+
160
+ - platform : wifi_signal
161
+ name : ${friendly_name} Signal
162
+ update_interval : 60s
163
+
164
+ # ds18b20 on temperature external bus
165
+ - platform : dallas_temp
166
+ address : # sensor address
167
+ resolution : 12
168
+ name : " t#1"
169
+ accuracy_decimals : 3
170
+ update_interval : 1000ms
171
+ # analog input, calibrate with your board
172
+ - platform : adc
173
+ pin : 32
174
+ attenuation : auto
175
+ name : " Ain 3"
176
+ filters :
177
+ - calibrate_linear :
178
+ method : exact
179
+ datapoints :
180
+ # Map sensor value vs true value to calibrate volt
181
+ - 0.07 -> 0.0
182
+ - 0.24 -> 0.347
183
+ - 3.13 -> 4.65
184
+ update_interval : 1s
185
+
186
+ - platform : adc
187
+ pin : 33
188
+ attenuation : auto
189
+ name : " Ain 4"
190
+ filters :
191
+ - calibrate_linear :
192
+ method : exact
193
+ datapoints :
194
+ # Map sensor value vs true value to calibrate volt
195
+ - 0.07 -> 0.0
196
+ - 0.24 -> 0.347
197
+ - 3.13 -> 4.65
198
+ update_interval : 1s
199
+
200
+ - platform : adc
201
+ pin : 34
202
+ attenuation : auto
203
+ unit_of_measurement : " Ma"
204
+ name : " Ain 1"
205
+ filters :
206
+ - calibrate_linear :
207
+ method : exact
208
+ datapoints :
209
+ # Map sensor value vs true value to calibrate current
210
+ - 0.07 -> 0.0
211
+ - 0.34 -> 2.24
212
+ - 3.03 -> 20.12
213
+ update_interval : 1s
214
+
215
+
216
+ - platform : adc
217
+ pin : 35
218
+ attenuation : auto
219
+ unit_of_measurement : " Ma"
220
+ name : " Ain 2"
221
+ filters :
222
+ - calibrate_linear :
223
+ method : exact
224
+ datapoints :
225
+ # Map sensor value vs true value to calibrate current
226
+ - 0.07 -> 0.0
227
+ - 0.34 -> 2.24
228
+ - 3.03 -> 20.12
229
+ update_interval : 1s
230
+
231
+
232
+ # dac use basic
233
+ output :
234
+
235
+ - platform : esp32_dac
236
+ pin : 25
237
+ id : " Aout1"
238
+
239
+ - platform : esp32_dac
240
+ pin : 26
241
+ id : " Aout2"
242
+
243
+ light :
244
+
245
+ - platform : monochromatic
246
+ output : Aout1
247
+ name : " Aout1"
248
+ gamma_correct : 0
249
+ id : Aout_1
250
+
251
+
252
+ - platform : monochromatic
253
+ output : Aout2
254
+ name : " Aout2"
255
+ gamma_correct : 0
256
+ id : Aout_2
115
257
` ` `
0 commit comments