Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,258
» Latest member: Limda
» Forum threads: 3,613
» Forum posts: 18,624

Full Statistics

Online Users
There are currently 25 online users.
» 0 Member(s) | 9 Guest(s)
AhrefsBot, Amazonbot, Applebot, Bing, Bytespider, PetalBot, bot

Latest Threads
MODBUS TCP ETHERNET - SLA...
Forum: KC868-A16
Last Post: lordn
7 hours ago
» Replies: 4
» Views: 954
KC868-E16T added Tuya mod...
Forum: KC868-E16T
Last Post: admin
Yesterday, 11:27 PM
» Replies: 6
» Views: 624
how to integrate KC868-A8...
Forum: KC868-A8
Last Post: admin
Yesterday, 11:25 PM
» Replies: 46
» Views: 7,070
IFTTT T64M
Forum: "KCS" v3 firmware
Last Post: admin
Yesterday, 11:24 PM
» Replies: 1
» Views: 19
KC868-A2 SIM7600 with Tuy...
Forum: KC868-A2
Last Post: admin
12-13-2025, 11:29 PM
» Replies: 32
» Views: 3,232
RF doesnt show up?
Forum: KC868-A16v3
Last Post: Borg357
12-13-2025, 09:16 PM
» Replies: 2
» Views: 23
KC868-A16 rs485
Forum: KC868-A16
Last Post: admin
12-13-2025, 02:21 PM
» Replies: 7
» Views: 84
Some bugs in Home Assista...
Forum: N60
Last Post: admin
12-13-2025, 12:29 AM
» Replies: 1
» Views: 27
B16 mqtt code
Forum: B16
Last Post: admin
12-12-2025, 01:31 PM
» Replies: 1
» Views: 18
OPC UA Server for KC868-A...
Forum: DIY Project
Last Post: aksurd
12-12-2025, 04:05 AM
» Replies: 0
» Views: 49

  KC868-A16 read output state by http command in Tasmota
Posted by: admin - 03-29-2022, 02:43 PM - Forum: KC868-A16 - No Replies

if want to read output1 by http command, here is url:
http://10.10.10.135/cm?cmnd=Power1%20state        will feedback: {"POWER1":"ON"}

if want to read output2 by http command, here is url:
http://10.10.10.135/cm?cmnd=Power2%20state        will feedback: {"POWER2":"OFF"}

Print this item

  KC868-A16 "input1 toggle output1" automation rules in Tasmota
Posted by: admin - 03-29-2022, 02:28 PM - Forum: KC868-A16 - Replies (8)

this rules sample will set KC868-A16 input1 toggle output1.

for example if input1 -- toggle --> output1:

rule1 on PCF8574-1_INP#D0=0 do power1 toggle endon
rule1 1

if input2 -- toggle --> output2:

rule2 on PCF8574-1_INP#D1=0 do power2 toggle endon
rule2 1

if input3 -- toggle --> output3:

rule3 on PCF8574-1_INP#D2=0 do power3 toggle endon
rule3 1

here are setting photos for sample rule1:

   
   
   
   

Print this item

  K868-H32L need to work with Node-RED and Alexa (TCP-OUT)
Posted by: jack859363 - 03-29-2022, 08:44 AM - Forum: DIY Project - Replies (1)

I was told to post here what I am trying to do. My parts are:
1. K868-H32L
2. Tp-link wireless router
3. ESP8266
4. Old PC

Scenario: I tried using the ESP8266 with the K868-H32L to link to Alexa. However, Alexa could only detect 10 switches out of the 32. Kincony notified me that ESP8266 is only limited. Now, I have a bunch of OLD PCs lying around with ready windows. Kincony told me I can use PC with red NODE. I managed to install and sign up for red-node. Again, Kincony support told me that I cannot use MQQT with K868-H32L. I am posting here because I need help how to set-up red-node using TCP-out.

The videos posted are MQQT are very similar to TCP-out. I followed it however, TCP-out would not connect to my 868-H32L, I connected PC and H32L relay to LAN of wireless router, Internet access thru WAN of Wireless router, Alexa module connected to Wireless Router. Everything is working with the KC868-H32.exe pc software so I know parts are working.

I need to automate the system via Alexa. Kindly assist how to connect 868-H32L relay to red-Node via TCP-Out. The programming of Alexa to red Node is already in the MQQT videos.



Attached Files Thumbnail(s)
                       

Print this item

  [Arduino demo source code for KC868-A4]-11 how to create wifi connection
Posted by: KinCony Support - 03-28-2022, 05:40 AM - Forum: KC868-A4 - Replies (8)

Code:
#include <WiFi.h>
void setup(){
  WiFi.begin("SSID", "PASSWORD");
  // SSID and password is the router you want to connect
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.begin(9600);
}

void loop(){
  Serial.println("Local IP:");
  Serial.println(WiFi.localIP());
  delay(1000);
}
       

Print this item

  Lesson9 - integrate KC868-Server to home assistant by MQTT
Posted by: admin - 03-27-2022, 04:56 AM - Forum: Home automation training courses - Replies (59)


1.MQTT communication structure diagram

   

KC868-Server--------

publish message: status of switch (status topic)
Subscription message: turn on / off command (command topic)


home assistant------

publish message:  turn on / off command (command topic)
Subscription message: status of switch (status topic)

2.KC868-Server digital output , digital input , analog input config sample code in configuration.yaml

# Example configuration.yaml entry
switch:
  - platform: mqtt
    name: 'output-1'
    unique_id: output-1
    state_topic: 'server/ xxxxxxxxxxxxxxxxxxxxxxxx /state'
    command_topic: 'server/ xxxxxxxxxxxxxxxxxxxxxxxx /set'
    payload_on:  '{"relay1":{"on":1}}'
    payload_off:  '{"relay1":{"on":0}}'
    value_template: '{{ value_json.relay1.on }}'
    state_on: 1
state_off: 0


binary_sensor:
  - platform: mqtt
    name: 'input-1'
    unique_id: input-1
    state_topic: 'server/ xxxxxxxxxxxxxxxxxxxxxxxx /state'
    value_template: '{{ value_json.input1.on }}'
    payload_on: 1
    payload_off: 0


sensor:
  - platform: mqtt
    name: 'analog-1'
    unique_id: analog-1
    state_topic: 'server/ xxxxxxxxxxxxxxxxxxxxxxxx /state'
    unit_of_measurement: 'v'
    value_template: '{{ value_json.analog1.value }} ' 

Note: xxxxxxxxxxxxxxxxxxxxxxxx is UID of controller, just replace with your device UID. You can find the UID in ethernet setting.

3.KC868-Server 16 channel output, 16 channel digital input, 4 channel analog input all use in configuration.yaml


.txt   KC868-Server-home-assistant-config.txt (Size: 8.15 KB / Downloads: 1426)

Print this item

  KC868-Server integrate to home asssitant by MQTT configuration.yaml
Posted by: admin - 03-27-2022, 04:52 AM - Forum: KC868-Server Raspberry Pi4 local server - Replies (15)

KC868-Server 16 channel output, 16 channel digital input, 4 channel analog input all use in configuration.yaml

.txt   KC868-Server-home-assistant-config.txt (Size: 8.15 KB / Downloads: 826)

Note: xxxxxxxxxxxxxxxxxxxxxxxx is UID of controller, just replace with your device UID. You can find the UID in ethernet setting.

Print this item

  Lesson8 - install Mosquitto broker on home assistant
Posted by: admin - 03-27-2022, 03:29 AM - Forum: Home automation training courses - No Replies


1. MQTT structure

   

   

2. Install mosquito MQTT broker on home assistant

   

Configuration:

logins:
  - username: mqtt
    password: '123'
customize:
  active: false
  folder: mosquitto
certfile: fullchain.pem
keyfile: privkey.pem
require_certificate: false

Note: username and password just replace by yourself.

3. MQTT communication
   


4. MQTT communication test

Configuration-->Devices & Services --> Mosquitto broker "CONFIGURE"
   

Print this item

Wink [Arduino IDE demo source code for KC868-A32]--#06-RS485
Posted by: KinCony Support - 03-24-2022, 07:03 AM - Forum: KC868-A32/A32 Pro - Replies (1)

Code:
void setup() {
 Serial1.begin(9600);    //Serial 1
}

void loop() {
Serial1.println("KinCony");
delay(1500);
}

Print this item

Wink [Arduino IDE demo source code for KC868-A32]--#05-PCF8574-DO
Posted by: KinCony Support - 03-24-2022, 06:59 AM - Forum: KC868-A32/A32 Pro - Replies (2)

Code:
#include "Arduino.h"
#include "PCF8574.h"

TwoWire I2Ctwo = TwoWire(1);

// Set i2c address
PCF8574 pcf8574_R1(&I2Ctwo, 0x24, 15, 13);
PCF8574 pcf8574_R2(&I2Ctwo, 0x25, 15, 13);
PCF8574 pcf8574_R3(&I2Ctwo, 0x21, 15, 13);
PCF8574 pcf8574_R4(&I2Ctwo, 0x22, 15, 13);

void setup()
{
    Serial.begin(115200);
//    delay(1000);

    // Set pinMode to OUTPUT
pcf8574_R1.pinMode(P0, OUTPUT);
pcf8574_R1.pinMode(P1, OUTPUT);
pcf8574_R1.pinMode(P2, OUTPUT);
pcf8574_R1.pinMode(P3, OUTPUT);
pcf8574_R1.pinMode(P4, OUTPUT);
pcf8574_R1.pinMode(P5, OUTPUT);
pcf8574_R1.pinMode(P6, OUTPUT);
pcf8574_R1.pinMode(P7, OUTPUT);

pcf8574_R2.pinMode(P0, OUTPUT);
pcf8574_R2.pinMode(P1, OUTPUT);
pcf8574_R2.pinMode(P2, OUTPUT);
pcf8574_R2.pinMode(P3, OUTPUT);
pcf8574_R2.pinMode(P4, OUTPUT);
pcf8574_R2.pinMode(P5, OUTPUT);
pcf8574_R2.pinMode(P6, OUTPUT);
pcf8574_R2.pinMode(P7, OUTPUT);

pcf8574_R3.pinMode(P0, OUTPUT);
pcf8574_R3.pinMode(P1, OUTPUT);
pcf8574_R3.pinMode(P2, OUTPUT);
pcf8574_R3.pinMode(P3, OUTPUT);
pcf8574_R3.pinMode(P4, OUTPUT);
pcf8574_R3.pinMode(P5, OUTPUT);
pcf8574_R3.pinMode(P6, OUTPUT);
pcf8574_R3.pinMode(P7, OUTPUT);

pcf8574_R4.pinMode(P0, OUTPUT);
pcf8574_R4.pinMode(P1, OUTPUT);
pcf8574_R4.pinMode(P2, OUTPUT);
pcf8574_R4.pinMode(P3, OUTPUT);
pcf8574_R4.pinMode(P4, OUTPUT);
pcf8574_R4.pinMode(P5, OUTPUT);
pcf8574_R4.pinMode(P6, OUTPUT);
pcf8574_R4.pinMode(P7, OUTPUT);

    Serial.print("Init pcf8574_R1...");
    if (pcf8574_R1.begin()){
        Serial.println("PCF8574_R1_OK");
    }else{
        Serial.println("PCF8574_R1_KO");
    }

  Serial.print("Init pcf8574_R2...");
  if (pcf8574_R2.begin()){
    Serial.println("PCF8574_R2_OK");
  }else{
    Serial.println("PCF8574_R2_KO");
  }

  Serial.print("Init pcf8574_R3...");
  if (pcf8574_R3.begin()){
    Serial.println("PCF8574_R3_OK");
  }else{
    Serial.println("PCF8574_R3_KO");
  }

  Serial.print("Init pcf8574_R4...");
  if (pcf8574_R4.begin()){
    Serial.println("PCF8574_R4_OK");
  }else{
    Serial.println("PCF8574_R4_KO");
  }



}

void loop()
{
    pcf8574_R1.digitalWrite(P0, LOW);
  delay(200);
  pcf8574_R1.digitalWrite(P1, LOW);
  delay(200);
  pcf8574_R1.digitalWrite(P2, LOW);
  delay(200);
  pcf8574_R1.digitalWrite(P3, LOW);
  delay(200);
  pcf8574_R1.digitalWrite(P4, LOW);
  delay(200);
  pcf8574_R1.digitalWrite(P5, LOW);
  delay(200);
  pcf8574_R1.digitalWrite(P6, LOW);
  delay(200);
  pcf8574_R1.digitalWrite(P7, LOW);
  delay(200);

  pcf8574_R2.digitalWrite(P0, LOW);
  delay(200);
  pcf8574_R2.digitalWrite(P1, LOW);
  delay(200);
  pcf8574_R2.digitalWrite(P2, LOW);
  delay(200);
  pcf8574_R2.digitalWrite(P3, LOW);
  delay(200);
  pcf8574_R2.digitalWrite(P4, LOW);
  delay(200);
  pcf8574_R2.digitalWrite(P5, LOW);
  delay(200);
  pcf8574_R2.digitalWrite(P6, LOW);
  delay(200);
  pcf8574_R2.digitalWrite(P7, LOW);
  delay(200);

  pcf8574_R3.digitalWrite(P0, LOW);
  delay(200);
  pcf8574_R3.digitalWrite(P1, LOW);
  delay(200);
  pcf8574_R3.digitalWrite(P2, LOW);
  delay(200);
  pcf8574_R3.digitalWrite(P3, LOW);
  delay(200);
  pcf8574_R3.digitalWrite(P4, LOW);
  delay(200);
  pcf8574_R3.digitalWrite(P5, LOW);
  delay(200);
  pcf8574_R3.digitalWrite(P6, LOW);
  delay(200);
  pcf8574_R3.digitalWrite(P7, LOW);
  delay(200);

  pcf8574_R4.digitalWrite(P0, LOW);
  delay(200);
  pcf8574_R4.digitalWrite(P1, LOW);
  delay(200);
  pcf8574_R4.digitalWrite(P2, LOW);
  delay(200);
  pcf8574_R4.digitalWrite(P3, LOW);
  delay(200);
  pcf8574_R4.digitalWrite(P4, LOW);
  delay(200);
  pcf8574_R4.digitalWrite(P5, LOW);
  delay(200);
  pcf8574_R4.digitalWrite(P6, LOW);
  delay(200);
  pcf8574_R4.digitalWrite(P7, LOW);
  delay(200);
}
       

Print this item

Wink [Arduino IDE demo source code for KC868-A32]--#04-PCF8574-DI
Posted by: KinCony Support - 03-24-2022, 06:53 AM - Forum: KC868-A32/A32 Pro - No Replies

Code:
/*
KeyPressed on PIN1
by Mischianti Renzo <http://www.mischianti.org>

https://www.mischianti.org/2019/01/02/pcf8574-i2c-digital-i-o-expander-fast-easy-usage/
*/

#include "Arduino.h"
#include "PCF8574.h"


// Instantiate Wire for generic use at 400kHz
TwoWire I2Cone = TwoWire(0);
// Instantiate Wire for generic use at 100kHz
TwoWire I2Ctwo = TwoWire(1);

// Set i2c address
PCF8574 pcf8574_I1(0x24);
PCF8574 pcf8574_I2(0x25);
PCF8574 pcf8574_I3(0x21);
PCF8574 pcf8574_I4(0x22);



unsigned long timeElapsed;
void setup()
{
    Serial.begin(115200);
    delay(1000);

//    pcf8574.pinMode(P0, OUTPUT);
pcf8574_I1.pinMode(P0, INPUT);
pcf8574_I1.pinMode(P1, INPUT);
pcf8574_I1.pinMode(P2, INPUT);
pcf8574_I1.pinMode(P3, INPUT);
pcf8574_I1.pinMode(P4, INPUT);
pcf8574_I1.pinMode(P5, INPUT);
pcf8574_I1.pinMode(P6, INPUT);
pcf8574_I1.pinMode(P7, INPUT);

pcf8574_I2.pinMode(P0, INPUT);
pcf8574_I2.pinMode(P1, INPUT);
pcf8574_I2.pinMode(P2, INPUT);
pcf8574_I2.pinMode(P3, INPUT);
pcf8574_I2.pinMode(P4, INPUT);
pcf8574_I2.pinMode(P5, INPUT);
pcf8574_I2.pinMode(P6, INPUT);
pcf8574_I2.pinMode(P7, INPUT);

pcf8574_I3.pinMode(P0, INPUT);
pcf8574_I3.pinMode(P1, INPUT);
pcf8574_I3.pinMode(P2, INPUT);
pcf8574_I3.pinMode(P3, INPUT);
pcf8574_I3.pinMode(P4, INPUT);
pcf8574_I3.pinMode(P5, INPUT);
pcf8574_I3.pinMode(P6, INPUT);
pcf8574_I3.pinMode(P7, INPUT);

pcf8574_I4.pinMode(P0, INPUT);
pcf8574_I4.pinMode(P1, INPUT);
pcf8574_I4.pinMode(P2, INPUT);
pcf8574_I4.pinMode(P3, INPUT);
pcf8574_I4.pinMode(P4, INPUT);
pcf8574_I4.pinMode(P5, INPUT);
pcf8574_I4.pinMode(P6, INPUT);
pcf8574_I4.pinMode(P7, INPUT);



    Serial.print("Init pcf8574...");
    if (pcf8574_I1.begin()){
        Serial.println("pcf8574_I1_OK");
    }else{
        Serial.println("pcf8574_I1_KO");
    }

  Serial.print("Init pcf8574...");
  if (pcf8574_I2.begin()){
    Serial.println("pcf8574_I2_OK");
  }else{
    Serial.println("pcf8574_I2_KO");
  }

  Serial.print("Init pcf8574_I3...");
  if (pcf8574_I3.begin()){
    Serial.println("pcf8574_I3_OK");
  }else{
    Serial.println("pcf8574_I3_KO");
  }

  Serial.print("Init pcf8574_I4...");
  if (pcf8574_I4.begin()){
    Serial.println("pcf8574_I4_OK");
  }else{
    Serial.println("pcf8574_I4_KO");
  }

}

void loop()
{
uint8_t val1 = pcf8574_I1.digitalRead(P0);
uint8_t val2 = pcf8574_I1.digitalRead(P1);
uint8_t val3 = pcf8574_I1.digitalRead(P2);
uint8_t val4 = pcf8574_I1.digitalRead(P3);
uint8_t val5 = pcf8574_I1.digitalRead(P4);
uint8_t val6 = pcf8574_I1.digitalRead(P5);
uint8_t val7 = pcf8574_I1.digitalRead(P6);
uint8_t val8 = pcf8574_I1.digitalRead(P7);

uint8_t val9 = pcf8574_I2.digitalRead(P0);
uint8_t val10 = pcf8574_I2.digitalRead(P1);
uint8_t val11 = pcf8574_I2.digitalRead(P2);
uint8_t val12 = pcf8574_I2.digitalRead(P3);
uint8_t val13 = pcf8574_I2.digitalRead(P4);
uint8_t val14 = pcf8574_I2.digitalRead(P5);
uint8_t val15 = pcf8574_I2.digitalRead(P6);
uint8_t val16 = pcf8574_I2.digitalRead(P7);


uint8_t val17 = pcf8574_I3.digitalRead(P0);
uint8_t val18 = pcf8574_I3.digitalRead(P1);
uint8_t val19 = pcf8574_I3.digitalRead(P2);
uint8_t val20 = pcf8574_I3.digitalRead(P3);
uint8_t val21 = pcf8574_I3.digitalRead(P4);
uint8_t val22 = pcf8574_I3.digitalRead(P5);
uint8_t val23 = pcf8574_I3.digitalRead(P6);
uint8_t val24 = pcf8574_I3.digitalRead(P7);


uint8_t val25 = pcf8574_I4.digitalRead(P0);
uint8_t val26 = pcf8574_I4.digitalRead(P1);
uint8_t val27 = pcf8574_I4.digitalRead(P2);
uint8_t val28 = pcf8574_I4.digitalRead(P3);
uint8_t val29 = pcf8574_I4.digitalRead(P4);
uint8_t val30 = pcf8574_I4.digitalRead(P5);
uint8_t val31 = pcf8574_I4.digitalRead(P6);
uint8_t val32 = pcf8574_I4.digitalRead(P7);
 
if (val1==LOW) Serial.println("KEY1 PRESSED");
if (val2==LOW) Serial.println("KEY2 PRESSED");
if (val3==LOW) Serial.println("KEY3 PRESSED");
if (val4==LOW) Serial.println("KEY4 PRESSED");
if (val5==LOW) Serial.println("KEY5 PRESSED");
if (val6==LOW) Serial.println("KEY6 PRESSED");
if (val7==LOW) Serial.println("KEY7 PRESSED");
if (val8==LOW) Serial.println("KEY8 PRESSED");

if (val9==LOW) Serial.println("KEY9 PRESSED");
if (val10==LOW) Serial.println("KEY10 PRESSED");
if (val11==LOW) Serial.println("KEY11 PRESSED");
if (val12==LOW) Serial.println("KEY12 PRESSED");
if (val13==LOW) Serial.println("KEY13 PRESSED");
if (val14==LOW) Serial.println("KEY14 PRESSED");
if (val15==LOW) Serial.println("KEY15 PRESSED");
if (val16==LOW) Serial.println("KEY16 PRESSED");

if (val17==LOW) Serial.println("KEY17 PRESSED");
if (val18==LOW) Serial.println("KEY18 PRESSED");
if (val19==LOW) Serial.println("KEY19 PRESSED");
if (val20==LOW) Serial.println("KEY20 PRESSED");
if (val21==LOW) Serial.println("KEY21 PRESSED");
if (val22==LOW) Serial.println("KEY22 PRESSED");
if (val23==LOW) Serial.println("KEY23 PRESSED");
if (val24==LOW) Serial.println("KEY24 PRESSED");

if (val25==LOW) Serial.println("KEY25 PRESSED");
if (val26==LOW) Serial.println("KEY26 PRESSED");
if (val27==LOW) Serial.println("KEY27 PRESSED");
if (val28==LOW) Serial.println("KEY28 PRESSED");
if (val29==LOW) Serial.println("KEY29 PRESSED");
if (val30==LOW) Serial.println("KEY30 PRESSED");
if (val31==LOW) Serial.println("KEY31 PRESSED");
if (val32==LOW) Serial.println("KEY32 PRESSED");
    delay(300);
}
       

Print this item