Skip to content

Commit 7b1b432

Browse files
authored
Update index.md
example code of more peripheral
1 parent 4b6b066 commit 7b1b432

File tree

1 file changed

+154
-12
lines changed
  • src/docs/devices/KinCony-KC868-A4

1 file changed

+154
-12
lines changed

src/docs/devices/KinCony-KC868-A4/index.md

Lines changed: 154 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: KinCony KC868-A4
33
date-published: 2023-04-19
4-
type: relay
4+
type: automate
55
standard: global
66
board: esp32
77
---
@@ -41,20 +41,30 @@ board: esp32
4141
## Basic Configuration
4242

4343
```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+
4552
esphome:
46-
name: kc868-a4
47-
platform: ESP32
53+
name: ${device_name}
54+
comment: ${device_description}
55+
esp32:
4856
board: esp32dev
4957

5058
# Enable logging
5159
logger:
5260

5361
# Enable Home Assistant API
5462
api:
63+
encryption:
64+
key: "your api key"
5565

5666
ota:
57-
password: "4d5a388de4f759bf88e71cde7a31af6f"
67+
password: "your ota password"
5868

5969
wifi:
6070
ssid: "KinCony"
@@ -63,38 +73,57 @@ wifi:
6373
# Enable fallback hotspot (captive portal) in case wifi connection fails
6474
ap:
6575
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
6887
captive_portal:
6988

89+
one_wire:
90+
#enable temperature bus
91+
- platform: gpio
92+
pin: 13
93+
7094
switch:
7195
- platform: gpio
72-
name: "light1"
96+
name: "Relay 1"
7397
pin: 2
7498
inverted: false
7599

76100
- platform: gpio
77-
name: "light2"
101+
name: "Relay 2"
78102
pin: 15
79103
inverted: false
80104

81105
- platform: gpio
82-
name: "light3"
106+
name: "Relay 3"
83107
pin: 5
84108
inverted: false
85109

86110
- platform: gpio
87-
name: "light4"
111+
name: "Relay 4"
88112
pin: 4
89113
inverted: false
114+
# enable use of internal buzzer
115+
- platform: gpio
116+
id: buzzer
117+
name: "buzzer"
118+
pin: 18
90119

91120
binary_sensor:
92121
- platform: gpio
93122
name: "input1"
94123
pin:
95124
number: 36
96125
inverted: true
97-
126+
98127
- platform: gpio
99128
name: "input2"
100129
pin:
@@ -112,4 +141,117 @@ binary_sensor:
112141
pin:
113142
number: 14
114143
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
115257
```

0 commit comments

Comments
 (0)