08-14-2025, 09:29 AM
(08-13-2025, 11:48 PM)admin Wrote: take photo of your HAv2 PC setting soffware and your A2 board KCS RS485 setting photo.Attaching photos of the settings from HA485 Assistant and RS485 ESPHome.
Esphome ver 2025.7.5
The whole ESPHOME configuration of A2:
Code:
substitutions:
device_name: "kcs-kc868-a2"
friendly_name: KCS_KC868_A2
board_type: esp32dev
api_key: !secret api_key
ap_password: !secret ap_fallback_password
ota_password: !secret ota_password
cooldown: 10s
external_components:
- source:
type: git
url: https://github.com/hzkincony/esphome-kc868-ha
ref: v3.0.2
esphome:
name: ${device_name}
friendly_name: ${friendly_name}
esp32:
board: ${board_type}
framework:
type: arduino
logger:
level: DEBUG
api:
encryption:
key: ${api_key}
web_server:
port: 80
auth:
username: !secret web_server_username
password: !secret web_server_password
ota:
platform: esphome
password: ${ota_password}
button:
- platform: restart
name: "Restart Device"
- platform: safe_mode
name: "Restart in Safe Mode"
ethernet:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO17_OUT
phy_addr: 0
uart:
- id: rs485
tx_pin: GPIO32
rx_pin: GPIO35
baud_rate: 9600
stop_bits: 2
kc868_ha:
uart_id: rs485
switch:
# The switch is used to control the D1~D6 level output on the KC868 HA board
# bind_output is required. Corresponds to the BindOutput parameter in HA485_Ctrl software
# Other parameters refer to: https://esphome.io/components/switch/index.html
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 10
bind_output: 1
name: "switch 1"
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 10
bind_output: 2
name: "switch 2"
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 10
bind_output: 3
name: "switch 3"
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 10
bind_output: 4
name: "switch 4"
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 10
bind_output: 5
name: "switch 5"
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 10
bind_output: 6
name: "switch 6"
- platform: gpio
id: a2
name: "a2-light1"
pin: 15
inverted: False
- platform: gpio
name: "a2-light2"
pin: 2
inverted: False
binary_sensor:
# The binary_sensor corresponds to the state changes generated by K1~K6 on the KC868 HA board
# bind_output is required. Corresponds to the BindOutput parameter in HA485_Ctrl software
# Other parameters refer to: https://esphome.io/components/binary_sensor/index.html
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 10
bind_output: 1
name: "binary_sensor 1"
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 10
bind_output: 2
name: "binary_sensor 2"
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 10
bind_output: 3
name: "binary_sensor 3"
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 10
bind_output: 4
name: "binary_sensor 4"
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 10
bind_output: 5
name: "binary_sensor 5"
- platform: kc868_ha
target_relay_controller_addr: 1
switch_adapter_addr: 10
bind_output: 6
name: "binary_sensor 6"
- platform: gpio
name: "a2-input1"
pin:
number: 36
inverted: true
- platform: gpio
name: "a2-input2"
pin:
number: 39
inverted: true
