Hi guys! I bought a relay module from Kincony. On board he has 32 outnput channels and 6 intput channels. The cost of one channel is approximately 2$.
But I have questions about its integration into HA.
On a local area network, it works on tcp socket.
This JS code works.
var net = require(‘net’);
var client = new net.Socket();
client.connect(4196, ‘192.168.2.108’, function() {
console.log(‘Connected’);
client.write(‘RELAY-SET-1,4,0’);
});
client.on(‘data’, function(data) {
console.log('Received: ’ + data);
client.destroy(); // kill client after server’s response
});
client.on(‘close’, function() {
console.log(‘Connection closed’);
});
Please help integrate this module into HA.
I think it should be -
switch:
- platform: tcp