In KC-868 A8 in EspHome I have problems setting up the switch component.
I want that when I press digital Input#1 then relay #1 Toggles.
PCF8574 I/O Expander uses I2C Bus to set IDs, probably that is why the YAML validator don't recognizes the ID of light1? I don't know.
I know I can link the inputs and the relays in HomeAssistant, but I want the logic to be coded in the board so It still works if Internet brokes.
I also know that KCS firmware allows that requirement, but I am looking for an EspHome solution.
Thank you
EspHome Config:
Yaml Validator Output:
I want that when I press digital Input#1 then relay #1 Toggles.
PCF8574 I/O Expander uses I2C Bus to set IDs, probably that is why the YAML validator don't recognizes the ID of light1? I don't know.
I know I can link the inputs and the relays in HomeAssistant, but I want the logic to be coded in the board so It still works if Internet brokes.
I also know that KCS firmware allows that requirement, but I am looking for an EspHome solution.
Thank you
EspHome Config:
Code:
esphome:
name: esphome-web-026fd8
platform: ESP32
board: esp32dev
i2c:
sda: 4
scl: 5
scan: true
id: bus_a
logger:
api:
ota:
- platform: esphome
ethernet:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO17_OUT
phy_addr: 0
pcf8574:
- id: 'out' # for output channel 1-8
address: 0x24
- id: 'in' # for input channel 1-8
address: 0x22
switch:
- platform: gpio
name: "light1"
pin:
pcf8574: out
number: 0
mode: OUTPUT
inverted: true
binary_sensor:
- platform: gpio
name: "input1"
pin:
pcf8574: in
number: 0
mode: INPUT
inverted: true
on_press:
then:
- switch.toggle: light1
Yaml Validator Output: