ESPHome Kincony AC868-A16 Setup
How to set up Kincony AC868-A16 with external toggle switches and relay board for HomeAssistant.
Using Wifi Networks
1. Install ESPHome Builder
- In Home Assistant, go to Add-ons → add ESPHome Builder.
2. Configure Wi-Fi Secrets
Click Secrets (upper right in ESPHome Builder tab) and add:
# Your Wi-Fi SSID and password
wifi_ssid: "wifi-name"
wifi_password: "wifi-password"For multiple Wi-Fi networks:
# Your Wi-Fi SSID and password
1_wifi_ssid: "TheNameOfNetwork"
1_wifi_password: "PasswordOfNetwork"
2_wifi_ssid: "TheNameOfNetwork"
2_wifi_password: "PasswordOfNetwork"
3. Create New Device
- Click + New Device → Continue.
- Enter a name, select ESP32, click Skip.
- Open the new device → EDIT.
- Add the configuration at the end after the captive_portal line:
captive_portal:
uart:
- id: rs485
tx_pin: GPIO13
rx_pin: GPIO16
baud_rate: 9600
remote_receiver:
pin:
number: GPIO2
ignore_strapping_warning: true
remote_transmitter:
pin:
number: GPIO15
ignore_strapping_warning: true
carrier_duty_percent: 100%
i2c:
sda: GPIO4
scl:
number: GPIO5
ignore_strapping_warning: true
pcf8574:
- id: inputs_1_8
address: 0x22
pcf8575: false
- id: inputs_9_16
address: 0x21
pcf8575: false
- id: outputs_1_8
address: 0x24
pcf8575: false
- id: outputs_9_16
address: 0x25
pcf8575: false
binary_sensor:
- platform: gpio
name: "KC868-A16-HT1"
pin:
number: GPIO32
inverted: true
- platform: gpio
name: "KC868-A16-HT2"
pin:
number: GPIO33
inverted: true
- platform: gpio
name: "KC868-A16-HT3"
pin:
number: GPIO14
inverted: true
- platform: gpio
name: "KC868-A16-X01"
pin:
pcf8574: inputs_1_8
number: 0
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y01
on_release:
then:
- switch.turn_off: out_y01
- platform: gpio
name: "KC868-A16-X02"
pin:
pcf8574: inputs_1_8
number: 1
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y02
on_release:
then:
- switch.turn_off: out_y02
- platform: gpio
name: "KC868-A16-X03"
pin:
pcf8574: inputs_1_8
number: 2
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y03
on_release:
then:
- switch.turn_off: out_y03
- platform: gpio
name: "KC868-A16-X04"
pin:
pcf8574: inputs_1_8
number: 3
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y04
on_release:
then:
- switch.turn_off: out_y04
- platform: gpio
name: "KC868-A16-X05"
pin:
pcf8574: inputs_1_8
number: 4
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y05
on_release:
then:
- switch.turn_off: out_y05
- platform: gpio
name: "KC868-A16-X06"
pin:
pcf8574: inputs_1_8
number: 5
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y06
on_release:
then:
- switch.turn_off: out_y06
- platform: gpio
name: "KC868-A16-X07"
pin:
pcf8574: inputs_1_8
number: 6
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y07
on_release:
then:
- switch.turn_off: out_y07
- platform: gpio
name: "KC868-A16-X08"
pin:
pcf8574: inputs_1_8
number: 7
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y08
on_release:
then:
- switch.turn_off: out_y08
- platform: gpio
name: "KC868-A16-X09"
pin:
pcf8574: inputs_9_16
number: 0
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y09
on_release:
then:
- switch.turn_off: out_y09
- platform: gpio
name: "KC868-A16-X10"
pin:
pcf8574: inputs_9_16
number: 1
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y10
on_release:
then:
- switch.turn_off: out_y10
- platform: gpio
name: "KC868-A16-X11"
pin:
pcf8574: inputs_9_16
number: 2
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y11
on_release:
then:
- switch.turn_off: out_y11
- platform: gpio
name: "KC868-A16-X12"
pin:
pcf8574: inputs_9_16
number: 3
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y12
on_release:
then:
- switch.turn_off: out_y12
- platform: gpio
name: "KC868-A16-X13"
pin:
pcf8574: inputs_9_16
number: 4
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y13
on_release:
then:
- switch.turn_off: out_y13
- platform: gpio
name: "KC868-A16-X14"
pin:
pcf8574: inputs_9_16
number: 5
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y14
on_release:
then:
- switch.turn_off: out_y14
- platform: gpio
name: "KC868-A16-X15"
pin:
pcf8574: inputs_9_16
number: 6
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y15
on_release:
then:
- switch.turn_off: out_y15
- platform: gpio
name: "KC868-A16-X16"
pin:
pcf8574: inputs_9_16
number: 7
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y16
on_release:
then:
- switch.turn_off: out_y16
switch:
- platform: gpio
name: "KC868-A16-Y01"
id: out_y01
pin:
pcf8574: outputs_1_8
number: 0
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y02"
id: out_y02
pin:
pcf8574: outputs_1_8
number: 1
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y03"
id: out_y03
pin:
pcf8574: outputs_1_8
number: 2
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y04"
id: out_y04
pin:
pcf8574: outputs_1_8
number: 3
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y05"
id: out_y05
pin:
pcf8574: outputs_1_8
number: 4
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y06"
id: out_y06
pin:
pcf8574: outputs_1_8
number: 5
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y07"
id: out_y07
pin:
pcf8574: outputs_1_8
number: 6
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y08"
id: out_y08
pin:
pcf8574: outputs_1_8
number: 7
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y09"
id: out_y09
pin:
pcf8574: outputs_9_16
number: 0
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y10"
id: out_y10
pin:
pcf8574: outputs_9_16
number: 1
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y11"
id: out_y11
pin:
pcf8574: outputs_9_16
number: 2
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y12"
id: out_y12
pin:
pcf8574: outputs_9_16
number: 3
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y13"
id: out_y13
pin:
pcf8574: outputs_9_16
number: 4
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y14"
id: out_y14
pin:
pcf8574: outputs_9_16
number: 5
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y15"
id: out_y15
pin:
pcf8574: outputs_9_16
number: 6
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y16"
id: out_y16
pin:
pcf8574: outputs_9_16
number: 7
mode: OUTPUT
inverted: true4. Build & Flash
- Select your device → INSTALL → choose
somename.factory.bin. - Click Save → Install → Manual Download.
- Select Factory format to download
somename.factory.bin. - Go to web.esphome.io.
- Connect ESP32 via USB,
- Select CP2102 USB to UART in the pop up window.
- Click CONNECT.
- If needed, install CP2102 USB to UART driver (for Windows).
- (CP2102 drivers download page)
Windows drivers - Click on INSTALL Select the previously downloaded somename.factory.bin file.
5. Add to Home Assistant
- Restart Home Assistant.
- Your new device will appear online in ESPHome tab.
- Go to Settings → Devices & Services.
- Click ESPHome → device should be Discovered.
- Click Add → Submit.
Kincony_KC868 example .yaml config for physical toggle switches.
esphome:
name: surgery
friendly_name: KINCONY-KC868-A16
compile_process_limit: 1
esp32:
board: esp32dev
framework:
type: esp-idf
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "encryption-key-to-modify"
ota:
- platform: esphome
password: "555089cdcb5a90cb738dcf4eb13933ff"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Custom Fallback Hotspot"
password: "K0WROEmdy0lU"
captive_portal:
uart:
- id: rs485
tx_pin: GPIO13
rx_pin: GPIO16
baud_rate: 9600
remote_receiver:
pin:
number: GPIO2
ignore_strapping_warning: true
remote_transmitter:
pin:
number: GPIO15
ignore_strapping_warning: true
carrier_duty_percent: 100%
i2c:
sda: GPIO4
scl:
number: GPIO5
ignore_strapping_warning: true
pcf8574:
- id: inputs_1_8
address: 0x22
pcf8575: false
- id: inputs_9_16
address: 0x21
pcf8575: false
- id: outputs_1_8
address: 0x24
pcf8575: false
- id: outputs_9_16
address: 0x25
pcf8575: false
binary_sensor:
- platform: gpio
name: "KC868-A16-HT1"
pin:
number: GPIO32
inverted: true
- platform: gpio
name: "KC868-A16-HT2"
pin:
number: GPIO33
inverted: true
- platform: gpio
name: "KC868-A16-HT3"
pin:
number: GPIO14
inverted: true
- platform: gpio
name: "KC868-A16-X01"
pin:
pcf8574: inputs_1_8
number: 0
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y01
on_release:
then:
- switch.turn_off: out_y01
- platform: gpio
name: "KC868-A16-X02"
pin:
pcf8574: inputs_1_8
number: 1
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y02
on_release:
then:
- switch.turn_off: out_y02
- platform: gpio
name: "KC868-A16-X03"
pin:
pcf8574: inputs_1_8
number: 2
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y03
on_release:
then:
- switch.turn_off: out_y03
- platform: gpio
name: "KC868-A16-X04"
pin:
pcf8574: inputs_1_8
number: 3
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y04
on_release:
then:
- switch.turn_off: out_y04
- platform: gpio
name: "KC868-A16-X05"
pin:
pcf8574: inputs_1_8
number: 4
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y05
on_release:
then:
- switch.turn_off: out_y05
- platform: gpio
name: "KC868-A16-X06"
pin:
pcf8574: inputs_1_8
number: 5
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y06
on_release:
then:
- switch.turn_off: out_y06
- platform: gpio
name: "KC868-A16-X07"
pin:
pcf8574: inputs_1_8
number: 6
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y07
on_release:
then:
- switch.turn_off: out_y07
- platform: gpio
name: "KC868-A16-X08"
pin:
pcf8574: inputs_1_8
number: 7
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y08
on_release:
then:
- switch.turn_off: out_y08
- platform: gpio
name: "KC868-A16-X09"
pin:
pcf8574: inputs_9_16
number: 0
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y09
on_release:
then:
- switch.turn_off: out_y09
- platform: gpio
name: "KC868-A16-X10"
pin:
pcf8574: inputs_9_16
number: 1
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y10
on_release:
then:
- switch.turn_off: out_y10
- platform: gpio
name: "KC868-A16-X11"
pin:
pcf8574: inputs_9_16
number: 2
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y11
on_release:
then:
- switch.turn_off: out_y11
- platform: gpio
name: "KC868-A16-X12"
pin:
pcf8574: inputs_9_16
number: 3
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y12
on_release:
then:
- switch.turn_off: out_y12
- platform: gpio
name: "KC868-A16-X13"
pin:
pcf8574: inputs_9_16
number: 4
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y13
on_release:
then:
- switch.turn_off: out_y13
- platform: gpio
name: "KC868-A16-X14"
pin:
pcf8574: inputs_9_16
number: 5
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y14
on_release:
then:
- switch.turn_off: out_y14
- platform: gpio
name: "KC868-A16-X15"
pin:
pcf8574: inputs_9_16
number: 6
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y15
on_release:
then:
- switch.turn_off: out_y15
- platform: gpio
name: "KC868-A16-X16"
pin:
pcf8574: inputs_9_16
number: 7
mode: INPUT
inverted: true
on_press:
then:
- switch.turn_on: out_y16
on_release:
then:
- switch.turn_off: out_y16
switch:
- platform: gpio
name: "KC868-A16-Y01"
id: out_y01
pin:
pcf8574: outputs_1_8
number: 0
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y02"
id: out_y02
pin:
pcf8574: outputs_1_8
number: 1
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y03"
id: out_y03
pin:
pcf8574: outputs_1_8
number: 2
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y04"
id: out_y04
pin:
pcf8574: outputs_1_8
number: 3
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y05"
id: out_y05
pin:
pcf8574: outputs_1_8
number: 4
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y06"
id: out_y06
pin:
pcf8574: outputs_1_8
number: 5
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y07"
id: out_y07
pin:
pcf8574: outputs_1_8
number: 6
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y08"
id: out_y08
pin:
pcf8574: outputs_1_8
number: 7
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y09"
id: out_y09
pin:
pcf8574: outputs_9_16
number: 0
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y10"
id: out_y10
pin:
pcf8574: outputs_9_16
number: 1
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y11"
id: out_y11
pin:
pcf8574: outputs_9_16
number: 2
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y12"
id: out_y12
pin:
pcf8574: outputs_9_16
number: 3
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y13"
id: out_y13
pin:
pcf8574: outputs_9_16
number: 4
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y14"
id: out_y14
pin:
pcf8574: outputs_9_16
number: 5
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y15"
id: out_y15
pin:
pcf8574: outputs_9_16
number: 6
mode: OUTPUT
inverted: true
- platform: gpio
name: "KC868-A16-Y16"
id: out_y16
pin:
pcf8574: outputs_9_16
number: 7
mode: OUTPUT
inverted: trueUsing Ethernet Connection
Ethernet can’t be used with wifi in tandem. One or the other:
Replace the wifi section with this:
ethernet:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk:
pin: GPIO17
mode: CLK_OUT
phy_addr: 0https://www.kincony.com/forum/showthread.php?tid=1628&pid=25636#pid25636
This example is provided by Kincony in March 2026.

