Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-HAv2 esphome issue
#1
Hi, i'va a problem with ha v2 and an esp32 with esphome firmware.
i'll attach the yaml file and the esphome log file. i think there is something wrong in the yaml file because with the ha control software the unit works well.
you can see the startup of the ha v2 and me trying to turno on and off the switches from home assistant.
every time the crc check is failing.
what am i doing wrong?
Thank you very much

Code:
esphome:
  name: wt32-rs485
  friendly_name: wt32-rs485

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
#  baud_rate: 0

external_components:
  - source:
      type: git
      url: https://github.com/hzkincony/esphome-kc868-ha
      ref: v3.0.0

uart:
  - id: myuart1
    tx_pin: 17
    rx_pin: 5
    baud_rate: 9600     

# Enable Home Assistant API
api:


ota:


#wifi:
#  ssid: !secret wifi_ssid
#  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
#  ap:
#    ssid: "Wt32-Rs485 Fallback Hotspot"
#    password: "RdQ2lmIEtDPg"

#captive_portal:

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO0_IN
  phy_addr: 1
  power_pin: GPIO16
  manual_ip:
    static_ip: 192.168.1.177
    gateway: 192.168.1.1
    subnet: 255.255.255.0

text_sensor:
  - platform: ethernet_info

kc868_ha:

binary_sensor:
  - platform: kc868_ha
    target_relay_controller_addr: 1 # Default value is 1, corresponds to the Target Relay Controller Addr parameter in HA485_Ctrl software
    switch_adapter_addr: 10 # Default value is 10, corresponds to the Switch Adapter Addr parameter in HA485_Ctrl software
    bind_output: 1 # Corresponds to the BindOutput parameter in HA485_Ctrl software
    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"

switch:
  - 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"


Code:
INFO ESPHome 2023.8.2
[18:16:24][D][kc868_ha.component:019]: uart bus receive df:eb:ff:ff:7e:77:ff:ff:ff:ff:ff:ff:ff:7d:f3:ff:f7:eb:ff:fe:5e
[18:16:24][D][kc868_ha.component:030]: uart crc=fe:5e, calc crc=b6:8a
[18:16:24][W][kc868_ha.component:033]: crc check failed. ignore data
[18:16:27][D][kc868_ha.component:019]: uart bus receive ff:ff:ef:f3:ef:cf:fe:ff:ff:ff:ff:ff:ff:ff:ff:f1:cf:ff:df:ff:bd
[18:16:27][D][kc868_ha.component:030]: uart crc=ff:bd, calc crc=18:f2
[18:16:27][W][kc868_ha.component:033]: crc check failed. ignore data
[18:16:29][D][kc868_ha.component:019]: uart bus receive 7f:ff:ff:fb:e7:ce:ff:ff:ff:ff:ff:ff:ff:ff:ff:78:f4:7f:f7:ff:ff
[18:16:29][D][kc868_ha.component:030]: uart crc=ff:ff, calc crc=b:26
[18:16:29][W][kc868_ha.component:033]: crc check failed. ignore data
[18:16:32][D][kc868_ha.component:019]: uart bus receive 7f:f7:eb:ff:f3:fe:d3:ff:ff:ff:ff:ff:ff:ff:ff:f5:8f:ff:ff:eb:ff
[18:16:32][D][kc868_ha.component:030]: uart crc=eb:ff, calc crc=b5:63
[18:16:32][W][kc868_ha.component:033]: crc check failed. ignore data
[18:16:33][D][kc868_ha.component:019]: uart bus receive 7f:ff:ff:f3:e7:37:fb:ff:ff:ff:ff:ff:ff:ff:ff:e1:cf:ff:7f:ff:eb
[18:16:33][D][kc868_ha.component:030]: uart crc=ff:eb, calc crc=c5:6a
[18:16:33][W][kc868_ha.component:033]: crc check failed. ignore data
[18:16:34][D][kc868_ha.component:019]: uart bus receive df:ff:eb:ff:ff:ef:35:f9:ff:ff:ff:ff:ff:e9:8f:ff:ff:f7:eb:ff:f3
[18:16:34][D][kc868_ha.component:030]: uart crc=ff:f3, calc crc=b1:52
[18:16:34][W][kc868_ha.component:033]: crc check failed. ignore data
[18:16:35][D][kc868_ha.component:019]: uart bus receive df:eb:fb:e7:35:fb:ff:ff:ff:ff:ff:ff:ff:ff:ff:f9:df:ff:ff:eb:ff
[18:16:35][D][kc868_ha.component:030]: uart crc=eb:ff, calc crc=f9:99
[18:16:35][W][kc868_ha.component:033]: crc check failed. ignore data
[18:16:36][D][kc868_ha.component:019]: uart bus receive df:ff:eb:ff:f3:7e:5b:ff:ff:ff:ff:ff:ff:ff:78:e4:f7:eb:df:5f:fb
[18:16:36][D][kc868_ha.component:030]: uart crc=5f:fb, calc crc=cb:32
[18:16:36][W][kc868_ha.component:033]: crc check failed. ignore data
[18:16:37][D][kc868_ha.component:019]: uart bus receive ff:ff:ff:f3:e7:bd:ff:ff:ff:ff:ff:ff:ff:ff:ff:e1:ff:ff:ff:ff:ff
[18:16:37][D][kc868_ha.component:030]: uart crc=ff:ff, calc crc=68:d5
[18:16:37][W][kc868_ha.component:033]: crc check failed. ignore data
[18:16:37][D][kc868_ha.component:019]: uart bus receive 7f:ff:eb:be:5e:5b:ff:ff:ff:ff:ff:ff:ff:79:ee:7f:f7:fb:ff:f3:de
[18:16:37][D][kc868_ha.component:030]: uart crc=f3:de, calc crc=2a:71
[18:16:37][W][kc868_ha.component:033]: crc check failed. ignore data
[18:16:50][D][switch:012]: 'switch 1' Turning ON.
[18:16:50][D][kc868_ha.component:131]: uart bus send 1:3:12:55:bb:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:1:30:4b
[18:16:50][D][switch:055]: 'switch 1': Sending state ON
[18:16:50][D][kc868_ha.component:019]: uart bus receive 1:3:12:55:bb:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:1
[18:16:50][D][kc868_ha.component:030]: uart crc=0:1, calc crc=41:25
[18:16:50][W][kc868_ha.component:033]: crc check failed. ignore data
[18:17:02][D][switch:016]: 'switch 1' Turning OFF.
[18:17:02][D][kc868_ha.component:131]: uart bus send 1:3:12:55:bb:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:f1:8b
[18:17:02][D][switch:055]: 'switch 1': Sending state OFF
[18:17:02][D][kc868_ha.component:019]: uart bus receive 1:3:12:55:bb:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
[18:17:02][D][kc868_ha.component:030]: uart crc=0:0, calc crc=41:25
[18:17:02][W][kc868_ha.component:033]: crc check failed. ignore data
[18:17:07][D][switch:012]: 'switch 1' Turning ON.
[18:17:07][D][kc868_ha.component:131]: uart bus send 1:3:12:55:bb:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:1:30:4b
[18:17:07][D][switch:055]: 'switch 1': Sending state ON
[18:17:07][D][kc868_ha.component:019]: uart bus receive 1:3:12:55:bb:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:1
[18:17:07][D][kc868_ha.component:030]: uart crc=0:1, calc crc=41:25
[18:17:07][W][kc868_ha.component:033]: crc check failed. ignore data
[18:17:09][D][switch:016]: 'switch 1' Turning OFF.
[18:17:09][D][kc868_ha.component:131]: uart bus send 1:3:12:55:bb:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:f1:8b
[18:17:09][D][switch:055]: 'switch 1': Sending state OFF
[18:17:09][D][kc868_ha.component:019]: uart bus receive 1:3:12:55:bb:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
[18:17:09][D][kc868_ha.component:030]: uart crc=0:0, calc crc=41:25
[18:17:09][W][kc868_ha.component:033]: crc check failed. ignore data
[18:17:10][D][switch:012]: 'switch 2' Turning ON.
[18:17:10][D][kc868_ha.component:131]: uart bus send 1:3:12:55:bb:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:2:70:4a
[18:17:10][D][switch:055]: 'switch 2': Sending state ON
[18:17:10][D][kc868_ha.component:019]: uart bus receive 1:3:12:55:bb:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:2
[18:17:10][D][kc868_ha.component:030]: uart crc=0:2, calc crc=41:25
[18:17:10][W][kc868_ha.component:033]: crc check failed. ignore data
[18:17:11][D][switch:016]: 'switch 2' Turning OFF.
[18:17:11][D][kc868_ha.component:131]: uart bus send 1:3:12:55:bb:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:f1:8b
[18:17:11][D][switch:055]: 'switch 2': Sending state OFF
[18:17:11][D][kc868_ha.component:019]: uart bus receive 1:3:12:55:bb:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
[18:17:11][D][kc868_ha.component:030]: uart crc=0:0, calc crc=41:25
[18:17:11][W][kc868_ha.component:033]: crc check failed. ignore data
[18:17:17][D][switch:012]: 'switch 3' Turning ON.
[18:17:17][D][kc868_ha.component:131]: uart bus send 1:3:12:55:bb:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:4:f0:48
[18:17:17][D][switch:055]: 'switch 3': Sending state ON
[18:17:17][D][kc868_ha.component:019]: uart bus receive 1:3:12:55:bb:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:4
[18:17:18][D][kc868_ha.component:030]: uart crc=0:4, calc crc=41:25
[18:17:18][W][kc868_ha.component:033]: crc check failed. ignore data
[18:17:18][D][switch:016]: 'switch 3' Turning OFF.
[18:17:18][D][kc868_ha.component:131]: uart bus send 1:3:12:55:bb:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:f1:8b
[18:17:18][D][switch:055]: 'switch 3': Sending state OFF
[18:17:18][D][kc868_ha.component:019]: uart bus receive 1:3:12:55:bb:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
[18:17:18][D][kc868_ha.component:030]: uart crc=0:0, calc crc=41:25
[18:17:18][W][kc868_ha.component:033]: crc check failed. ignore data
Reply
#2
if the HAv2 board work well, please ignore CRC errors.
Reply
#3
The CRC errors makes esphome ignore the data being sent by the ha board.
I cannot tell esphome to ignore the errors.
Reply
#4
i also see the error, but don't worry, board can work well.
Reply
#5
Home assistant can't speak with the hav2 board because all the messages coming from the UART are ignored by the CRC error. If I turn on an input on the board I can't see it on home assistant.
Reply
#6
you can do as this video:
https://youtu.be/S679QX6Hc6I
Reply
#7
I've done exactly like this video. There is something wrong.

(03-18-2024, 11:26 AM)procet Wrote: Home assistant can't speak with the hav2 board because all the messages coming from the UART are ignored by the CRC error. If I turn on an input on the board I can't see it on home assistant.

Do you know why CRC check is failing? can you tell me please?
Reply
#8
Code:
[18:14:45][D][kc868_ha.component:019]: uart bus receive 1:10:0:a:0:6:c:65:3:0:0:0:0:0:0:0:0:0:0:f:b8
[18:14:45][D][kc868_ha.component:030]: uart crc=f:b8, calc crc=f:b8
[18:14:45][D][kc868_ha.component:046]: dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=1
[18:14:45][D][kc868_ha.component:046]: dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=2
[18:14:45][D][kc868_ha.component:046]: dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=3
[18:14:45][D][kc868_ha.component:046]: dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=4
[18:14:45][D][kc868_ha.component:046]: dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=5
[18:14:45][D][kc868_ha.component:046]: dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=6
[18:14:45][D][kc868_ha.component:057]: found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=1
[18:14:45][D][kc868_ha.component:057]: found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=2
[18:14:45][D][kc868_ha.component:057]: found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=3
[18:14:45][D][kc868_ha.component:057]: found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=4
[18:14:45][D][kc868_ha.component:057]: found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=5
[18:14:45][D][kc868_ha.component:057]: found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=6
[18:14:45][D][kc868_ha.component:019]: uart bus receive 1:10:0:a:0:6:c:65:0:0:0:0:0:0:0:0:0:0:0:0:fc
[18:14:45][D][kc868_ha.component:030]: uart crc=0:fc, calc crc=0:fc
[18:14:45][D][kc868_ha.component:046]: dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=1
[18:14:45][D][kc868_ha.component:046]: dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=2
[18:14:45][D][kc868_ha.component:046]: dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=3
[18:14:45][D][kc868_ha.component:046]: dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=4
[18:14:45][D][kc868_ha.component:046]: dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=5
[18:14:45][D][kc868_ha.component:046]: dump kc868_ha config, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=6
[18:14:45][D][kc868_ha.component:057]: found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=1
[18:14:45][D][kc868_ha.component:057]: found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=2
[18:14:45][D][kc868_ha.component:057]: found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=3
[18:14:45][D][kc868_ha.component:057]: found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=4
[18:14:45][D][kc868_ha.component:057]: found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=5
[18:14:45][D][kc868_ha.component:057]: found a kc868_ha board, target_relay_controller_addr=1, switch_adapter_addr=10, bind_output=6
[18:14:45][W][component:204]: Component esphome.coroutine took a long time for an operation (0.32 s).
[18:14:45][W][component:205]: Components should block for at most 20-30ms.


here is what happen when i push and release the input 1 on the board. sometimes it works like this, some times it give me crc error
Reply
#9
which ESP32 kincony board you are connected with HAv2?
Reply
#10
No kincony board, this is a esp32 development board. Wroom 32.
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)