Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setup K868-a32 and k868-a16s
#1
I have 2 boards installed using KS2 firmware: K868-a32 and k868-a16s

What's the best way to set them up, i would like to use home assistant and MQTT but still want light to work in case home assistant breaks.

Should i setup boards using IFTTT, and only integrate MQTT for some scene automations, remote control and reading relay states?
Reply
#2
1. use by esphome config yaml file for home assistant.
2. integrate to home assistant by mqtt.
you can use any way for home assistant integration.
Reply
#3
can i use rs485 to communicate between boards? a16s -> a32, and a32 -> a16s

a16s.yaml


PHP Code:
# RS485 Modbus Setup
uart:
  id: uart_a16s
  tx_pin
: GPIO33
  rx_pin
: GPIO32
  baud_rate
: 19200
  debug
:
    direction: BOTH
    dummy_receiver
: false
    after
:
      timeout: 1s
    sequence
:
      - lambda: UARTDebug::log_hex(direction, bytes,' ');

modbus:
  - uart_id: uart_a16s
    id
: modbus_a16s_client
    send_wait_time
: 200ms
  
- uart_id: uart_a16s
    id
: modbus_a16s_server
    role
: server

modbus_controller
:
  # Client role - to initiate communication with a32
  - id: a16s_client_controller
    modbus_id
: modbus_a16s_client
    address
: 0x4 # Address of a32's server
    update_interval: 1s
    setup_priority
: 100 # Higher priority = earlier execution

  # Server role - to respond to a32's requests
  - modbus_id: modbus_a16s_server
    address
: 0x2 # a16s's server address

switch:
  - platform: modbus_controller
    modbus_controller_id
: a16s_client_controller # References the controller ID defined in hardware.yaml
    name: "a32_output1"
    id: "a32_output1"
    address: 0 # 0:relay1 1:relay2 ... 31:relay32
    register_type: coil
    bitmask
: 1 


a32.yaml

PHP Code:
uart:
  - id: uart_a32
    tx_pin
: GPIO14
    rx_pin
: GPIO16
    baud_rate
: 19200
    debug
:
      direction: BOTH
      dummy_receiver
: false
      after
:
        timeout: 1s
      sequence
:
        - lambda: UARTDebug::log_hex(direction, bytes,' ');

modbus:
  - uart_id: uart_a32
    id
: modbus_a32_client
    send_wait_time
: 200ms
  
- uart_id: uart_a32
    id
: modbus_a32_server
    role
: server

modbus_controller
:
  # Client role - to initiate communication with a16s
  - id: a32_client_controller
    modbus_id
: modbus_a32_client
    address
: 0x2 # Address of a16s's server
    update_interval: 2s
    setup_priority
: 50 # Lower priority = later execution

  # Server role - to respond to a16s's requests
  - modbus_id: modbus_a32_server
    address
: 0x4 # a32's server address
switch:
  - platform: modbus_controller
    modbus_controller_id
: a32_client_controller # References the controller ID defined in hardware.yaml
    name: "a16s_output1"
    id: "a16s_output1"
    address: 0 # 0:relay1 1:relay2 ... 5:relay16
    register_type: coil
    bitmask
: 1 

modbus errors

PHP Code:
[size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:45:59][color=#ff00ff][C][modbus_controller:350]:  Address: 0x04[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:45:59][color=#ff00ff][C][modbus_controller:351]:  Max Command Retries: 4[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:45:59][color=#ff00ff][C][modbus_controller:352]:  Offline Skip Updates: 0[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:45:59][color=#00ffff][D][uart_debug:114]: >>> 04 01 00 00 00 20 3D 87[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:45:59][color=#ffff00][W][modbus:125]: Modbus CRC Check failed! 90D1!=00[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:45:59][color=#00ffff][D][modbus_controller:040]: Modbus command to device=4 register=0x00 no response received - removed from send queue[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:45:59][color=#ffff00][W][modbus:125]: Modbus CRC Check failed! 90D1!=00[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:45:59][color=#ffff00][W][modbus:125]: Modbus CRC Check failed! 90D1!=00[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:45:59][color=#00ffff][D][uart_debug:114]: <<< 02 01 00 00 00 10 3D F5 02 01 00 00 00 10 3D F5 02 01 00 00 00 10 3D F5[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:45:59][color=#00ffff][D][uart_debug:114]: >>> 04 01 00 00 00 20 3D 87[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:45:59][color=#ffff00][W][modbus:125]: Modbus CRC Check failed! 4E91!=00[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:46:00][color=#00ffff][D][uart_debug:114]: <<< 63 3D 00 00 00 10 3D F5[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:46:00][color=#ffff00][W][modbus_controller:186]: Duplicate modbus command found: type=0x1 address=0 count=32[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:46:00][color=#00ffff][D][uart_debug:114]: >>> 04 01 00 00 00 20 3D 87 04 01 00 00 00 20 3D 87 04 01 00 00 00 20 3D 87 04 01 00 00 00 20 3D 87[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:46:00][color=#ffff00][W][modbus:125]: Modbus CRC Check failed! 90D1!=00[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:46:00][color=#00ffff][D][modbus_controller:040]: Modbus command to device=4 register=0x00 no response received - removed from send queue[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:46:01][color=#ffff00][W][modbus:125]: Modbus CRC Check failed! 90D1!=00[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:46:01][color=#ffff00][W][modbus:125]: Modbus CRC Check failed! 90D1!=00[/color]
[/font][/size][size=1][font=SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace][12:46:01][color=#ffff00][W][modbus:125]: Modbus CRC Check failed! 90D1!=00[/color][/font][/size] 
Reply
#4
what functions you want? can you explain in details.
Reply
#5
(03-10-2025, 11:11 AM)admin Wrote: what functions you want? can you explain in details.

basically this.. input from one board to trigger output on another board, and vice versa, bidirectional communication.

a16s_input1 -> a32_output1
a32_input1 -> a16s_output1

modbus seems to only work as client-server, so no bidirectional communication
Reply
#6
i suggest you download KCS v2 firmware, use IFTTT with customize protocol will be easy.
just IF controller-A DI1 pressed THEN send customize command to controller-B by RS485 or network.
Reply
#7
(03-10-2025, 10:52 PM)admin Wrote: i suggest you download KCS v2 firmware, use IFTTT with customize protocol will be easy.
just IF controller-A DI1 pressed THEN send customize command to controller-B by RS485 or network.

will try, thank you
i did manage to use esp-now to communicate between boards, but i don't know how stable esp-now is.
Reply
#8
use wired way is more stable.
Reply
#9
(03-06-2025, 08:07 AM)mitzuuu89 Wrote: I have 2 boards installed using KS2 firmware: K868-a32 and k868-a16s

What's the best way to set them up, i would like to use home assistant and MQTT but still want light to work in case home assistant breaks.

Should i setup boards using IFTTT, and only integrate MQTT for some scene automations, remote control and reading relay states?

That's how I'm doing it, HA if available but with the Kincony boards doing as much as possible natively via IFTTT rules.  This way even if HA goes down or disconnects, basic functionality will still be present.

Note that if you want to do anything more complex than very basic stuff you either need to use an external relay to feed a digital output to another digital input to chain IFTTT rules, or wait for updated firmware that implements this change request.
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)