Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Esphome + KC868-HA-V21
#1
Hello, friends. Thank you so much for your products—I’ve been using them with great pleasure. However, I’ve encountered an issue while trying to set up your KC868-HAv21 RS485.

I connected it via RS485 to the KC868-A2, using the ESPHOME firmware. I added your component from GitHub, and the settings on the HAv2 are factory defaults. Controlling the digital outputs (D1-D6) works fine, but when it comes to changes in the state of the digital inputs, the ESPHome logs only show the following messages:

text
dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=1
dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=2 
dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=3 
dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=4 
dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=5 
dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=6 
dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=7 
dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=8  
found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=1 (also bind output 1-8) 
What am I doing wrong? Could it be due to incorrect bind_output parameters? If so, which numbers should I specify?

I took the binary_sensor configuration from your GitHub and followed the instructions from your YouTube channel exactly. Thanks for your help!
Reply
#2
post your esphome yaml file.
Reply
#3
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

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}
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
debug:
direction: RX
kc868_ha:
uart_id: rs485
switch:
- platform: gpio
id: a2
name: "a2-light1"
pin: 15
inverted: False
- platform: gpio
name: "a2-light2"
pin: 2
inverted: False

- 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"
binary_sensor:
- platform: gpio
name: "a2-input1"
pin:
number: 36
inverted: true
- platform: gpio
name: "a2-input2"
pin:
number: 39
inverted: true

- 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"
Reply
#4
make sure set the newest version.
Code:
external_components:
  - source:
      type: git
      url: https://github.com/hzkincony/esphome-kc868-ha
      ref: v3.0.1
Reply
#5
Just to be safe, I've updated ESPHome and specified the latest version of the kc868-ha component (v3.0.2).
In terms of functionality, nothing has changed. The switch states (D1-D6) are being read correctly and can be controlled from ESPHome. However, the input states (K1-K6) aren't being read, even though the kc868-ha packets appear in the logs as shown in the initial message.
22:59:41 [D] [kc868_ha:021]
uart bus receive 1:10:0:a:0:6:c:65:0:0:0:0:0:0:0:0:0:0:0:0:fc
22:59:41 [D] [kc868_ha:032]
uart crc=0:fc, calc crc=0:fc
22:59:41 [D] [kc868_ha:045]
dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=1
22:59:41 [D] [kc868_ha:045]
dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=2
22:59:41 [D] [kc868_ha:045]
dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=3
22:59:41 [D] [kc868_ha:045]
dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=4
22:59:41 [D] [kc868_ha:045]
dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=5
22:59:41 [D] [kc868_ha:045]
dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=6
22:59:41 [D] [kc868_ha:056]
found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=1
22:59:41 [D] [kc868_ha:056]
found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=2
22:59:41 [D] [kc868_ha:056]
found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=3
22:59:41 [D] [kc868_ha:056]
found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=4
22:59:41 [D] [kc868_ha:056]
found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=5
22:59:41 [D] [kc868_ha:056]
found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=6

Additionally, after updating ESPHome, I'm now getting these new warnings:


WARNING Using `binary_sensor.BINARY_SENSOR_SCHEMA` is deprecated and will be removed in ESPHome 2025.11.0. Please use `binary_sensor.binary_sensor_schema(...)` instead. If you are seeing this, report an issue to the external_component author and ask them to update it. https://developers.esphome.io/blog/2025/...recations/. Component using this schema: kc868_ha

WARNING Using `switch.SWITCH_SCHEMA` is deprecated and will be removed in ESPHome 2025.11.0. Please use `switch.switch_schema(...)` instead. If you are seeing this, report an issue to the external_component author and ask them to update it. https://developers.esphome.io/blog/2025/...recations/. Component using this schema: kc868_ha
Reply
#6
take photo of your HAv2 PC setting soffware and your A2 board KCS RS485 setting photo.
Reply
#7
(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


Attached Files Image(s)
       
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)