32 channel ethernet relay module – KinCony KC868-H32

I am trying to find commands to control this module.
So far I only managed to send commands. It looks like this:

switch:

platform: command_line
switches:
relay01:
command_on: ‘echo -n RELAY-SET-1,1,1 | nc IP PORT’
command_off: ‘echo -n RELAY-SET-1,1,0 | nc IP PORT’
value_template: ‘{{ “1,OK” in value }}’
friendly_name: Kitchen
relay02:
command_on: ‘echo -n RELAY-SET-1,2,1 | nc IP PORT’
command_off: ‘echo -n RELAY-SET-1,2,0 | nc IP PORT’
value_template: ‘{{ “1,OK” in value }}’
friendly_name: Hall
…

Now I have a question in feedback. If I press a button on the keyboard or send a command through the command line, the HA controller does not see the relay status.

1 Like

Because you have not send the Initialization commmand. When controller power on , you need send :

1
Send: RELAY-SCAN_DEVICE-NOW
Return: RELAY-SCAN_DEVICE-CHANNEL_8/CHANNEL_32, OK/ERROR

2
Send: RELAY-TEST-NOW
Return: HOST-TEST-START

When you received HOST-TEST-START, then you send all command, all command will have feedback.

If you think sending initialization command is too troublesome, OK, you can send all command use 255 for first byte data instead of 1.

such as RELAY-SET-255,1,1 Turn ON relay1

such as RELAY-SET-255,1,0 Turn OFF relay1

such as RELAY-SET-255,2,1 Turn ON relay2

such as RELAY-SET-255,2,0 Turn OFF relay2

always use 255 for first byte, then you not need to send RELAY-SCAN_DEVICE-NOW and RELAY-TEST-NOW for controller Initialization.

1 Like

Now , we have write the new fireware that when press keyboard’s key , it will have feedback that which key number have pressed. I have a video, i think that is you needed. But i don’t know how to upload the video or images to this forum.

1 Like

Here you can place links to your video tutorials.

In this topic, a colleague solves a similar problem. But with a different module.

This VB demo tool for development control relay, you can see the command how to send and it’s feedback.

I want to figure out how to apply this knowledge to the Home Assistant.

Your means: Google home assistant?

This video is for keyboard feedback , which key have pressed.

you can write code for NodeMCU ESP32, just our voice module based on it.


use NodeMCU connect with Home Assistant, Also use NodeMCU send command to KC868 Controller by RS232 serial port.

It is possible, but it is a workaround.
The controller can be controlled directly using a Netcat.

if need directly, it need to write code to controller’s MCU.

Nice work!!!

As you mentioned, would be great to see a full intergration into HA.

Rob.

1 Like

I really hope that with the help of a respected KinCony this problem will be solved. The manufacturer could provide the device to community members for writing a module for full integration into the HA system.

I will see the HA technical data these days.

Thank you very much for responding willingly to help!

I would really like for such wonderful equipment to be more affordable in the implementation of their projects for beginners. And it appeared in the list of supporting such open smart home control systems.

I used this implementation. And it works for inclusion. But there was a request for feedback.