Firstly,make sure you have installed Node-Red on home assistant.Now let’s begin to add our KC868 relay controller to home assistant for turn ON/OFF every relay.
Goto “Configuration” — “Helpers”
Click “Add” and chose “Toggle”
Set a name of toggle.
Open “Node-Red” on home assistant. place “event:state” , “switch”, “function”, “TCP Out” nodes.
Set config for “event:state” Server and Eneity ID.
Set “Switch” node for on and off
set msg.payload= “RELAY-SET-255,1,1”; that means: turn on relay1
set msg.payload= “RELAY-SET-255,1,0”; that means: turn off relay1
set KC868 controller’s IP and Port, make sure your controller is work as “TCP Server” mode.