06-21-2025, 09:40 AM
I also have a question. I have 2 Kincony A16v3 devices now. Can I use GPIO40 & 41 for wiegand input?
Am I correct that these are described as GPIO2 & 3 on screenshot https://devices.esphome.io/devices/KinCony-KC868-A16v3?
Is there a board picture of all pins please? I only see the link with inputs but no link with GPIO.
wiegand:
- id: mykeypad
d0: GPIO40
d1: GPIO41
on_key:
- lambda: ESP_LOGI("KEY", "received key %d", x);
on_tag:
then:
- lambda: ESP_LOGI("TAG", "received tag %s", x.c_str());
- if:
condition:
lambda: |-
return x=="2";
then:
switch.toggle: "a16v3_output3"
- if:
condition:
lambda: |-
return x=="3";
then:
switch.toggle: "a16v3_output4"
on_raw:
- lambda: ESP_LOGI("RAW", "received raw %d bits, value %llx", bits, value);
# Example configuration entry
key_collector:
- id: pincode_reader
source_id: mykeypad
min_length: 3
max_length: 3
end_keys: "#"
end_key_required: true
back_keys: "*"
clear_keys: "C"
# allowed_keys: "0123456789"
timeout: 5s
on_progress:
- logger.log:
format: "input progress: '%s', started by '%c'"
args: [ 'x.c_str()', "(start == 0 ? '~' : start)" ]
on_result:
- logger.log:
format: "input result: '%s', started by '%c', ended by '%c'"
args: [ 'x.c_str()', "(start == 0 ? '~' : start)", "(end == 0 ? '~' : end)" ]
- if:
condition:
lambda: |-
return x=="101";
then:
switch.toggle: "a16v3_output3"
- if:
condition:
lambda: |-
return x=="102";
then:
switch.toggle: "a16v3_output4"
on_timeout:
- logger.log:
format: "input timeout: '%s', started by '%c'"
args: [ 'x.c_str()', "(start == 0 ? '~' : start)" ]
Am I correct that these are described as GPIO2 & 3 on screenshot https://devices.esphome.io/devices/KinCony-KC868-A16v3?
Is there a board picture of all pins please? I only see the link with inputs but no link with GPIO.
wiegand:
- id: mykeypad
d0: GPIO40
d1: GPIO41
on_key:
- lambda: ESP_LOGI("KEY", "received key %d", x);
on_tag:
then:
- lambda: ESP_LOGI("TAG", "received tag %s", x.c_str());
- if:
condition:
lambda: |-
return x=="2";
then:
switch.toggle: "a16v3_output3"
- if:
condition:
lambda: |-
return x=="3";
then:
switch.toggle: "a16v3_output4"
on_raw:
- lambda: ESP_LOGI("RAW", "received raw %d bits, value %llx", bits, value);
# Example configuration entry
key_collector:
- id: pincode_reader
source_id: mykeypad
min_length: 3
max_length: 3
end_keys: "#"
end_key_required: true
back_keys: "*"
clear_keys: "C"
# allowed_keys: "0123456789"
timeout: 5s
on_progress:
- logger.log:
format: "input progress: '%s', started by '%c'"
args: [ 'x.c_str()', "(start == 0 ? '~' : start)" ]
on_result:
- logger.log:
format: "input result: '%s', started by '%c', ended by '%c'"
args: [ 'x.c_str()', "(start == 0 ? '~' : start)", "(end == 0 ? '~' : end)" ]
- if:
condition:
lambda: |-
return x=="101";
then:
switch.toggle: "a16v3_output3"
- if:
condition:
lambda: |-
return x=="102";
then:
switch.toggle: "a16v3_output4"
on_timeout:
- logger.log:
format: "input timeout: '%s', started by '%c'"
args: [ 'x.c_str()', "(start == 0 ? '~' : start)" ]

