12-21-2022, 02:05 AM
here is sample config for KC868-A8 input1 trigger output1:
esphome:
name: a8
platform: ESP32
board: esp32dev
i2c:
sda: 4
scl: 5
scan: true
id: bus_a
ethernet:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO17_OUT
phy_addr: 0
pcf8574:
- id: 'pcf8574_hub_out_1' # for output channel 1-8
address: 0x24
- id: 'pcf8574_hub_in_1' # for input channel 1-8
address: 0x22
switch:
- platform: gpio
name: "light1"
id: light1
pin:
pcf8574: pcf8574_hub_out_1
number: 0
mode: OUTPUT
inverted: true
binary_sensor:
- platform: gpio
name: "input1"
on_press:
then:
- switch.toggle: light1
pin:
pcf8574: pcf8574_hub_in_1
number: 0
mode: INPUT
inverted: true
esphome:
name: a8
platform: ESP32
board: esp32dev
i2c:
sda: 4
scl: 5
scan: true
id: bus_a
ethernet:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO17_OUT
phy_addr: 0
pcf8574:
- id: 'pcf8574_hub_out_1' # for output channel 1-8
address: 0x24
- id: 'pcf8574_hub_in_1' # for input channel 1-8
address: 0x22
switch:
- platform: gpio
name: "light1"
id: light1
pin:
pcf8574: pcf8574_hub_out_1
number: 0
mode: OUTPUT
inverted: true
binary_sensor:
- platform: gpio
name: "input1"
on_press:
then:
- switch.toggle: light1
pin:
pcf8574: pcf8574_hub_in_1
number: 0
mode: INPUT
inverted: true