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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,855
» Latest member: autobidInfo
» Forum threads: 4,225
» Forum posts: 20,957

Full Statistics

Online Users
There are currently 65 online users.
» 0 Member(s) | 55 Guest(s)
Amazonbot, Baidu, Crawl, Google, PetalBot, bot

Latest Threads
wish
Forum: KC868-A16v3
Last Post: admin
7 hours ago
» Replies: 3
» Views: 30
B32M maximum voltage
Forum: DIY Project
Last Post: velifetime
Yesterday, 07:01 AM
» Replies: 2
» Views: 327
KNX ETS software project ...
Forum: CO16
Last Post: admin
Yesterday, 03:44 AM
» Replies: 0
» Views: 18
"KCS" v3.27.1 firmware BI...
Forum: "KCS" v3 firmware
Last Post: admin
Yesterday, 03:24 AM
» Replies: 0
» Views: 34
⚡ 40 Buttons, 36 Lighting...
Forum: DIY Project
Last Post: viko
09-07-2026, 09:22 PM
» Replies: 21
» Views: 331
OLED not found in I2C sca...
Forum: KC868-A6v3
Last Post: admin
09-07-2026, 02:55 AM
» Replies: 1
» Views: 28
"KCS" v3.27 firmware BIN ...
Forum: "KCS" v3 firmware
Last Post: admin
09-07-2026, 02:51 AM
» Replies: 0
» Views: 72
ESPHome modbus not functi...
Forum: KC868-A8S
Last Post: admin
09-06-2026, 11:49 PM
» Replies: 1
» Views: 31
KC868-H32B
Forum: KC868-HxB series Smart Controller
Last Post: admin
09-06-2026, 10:25 AM
» Replies: 5
» Views: 52
KC868-HA PC software V1.0...
Forum: KC868-HA /HA v2
Last Post: admin
09-06-2026, 08:12 AM
» Replies: 19
» Views: 7,163

Rainbow How to use tasmota for KC868-A32 via PCF8574 IIC extend GPIO
Posted by: KinCony Support - 05-18-2022, 02:50 AM - Forum: KC868-A32/A32 Pro - Replies (10)

How to use tasmota for KC868-A32 via PCF8574 IIC extend GPIO

   
The Tamplate code is:

{"NAME":"KC868-A32","GPIO":[32,0,1120,0,641,609,0,0,0,608,1,640,0,0,5600,0,0,0,0,5568,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,1],"FLAG":0,"BASE":1}
   

Set all Device port to  "OUTPUT"
   

   



Attached Files
.zip   ESP-Flasher-Windows-x64.zip (Size: 16.07 MB / Downloads: 1054)
.zip   firmware-en-a32.zip (Size: 764.89 KB / Downloads: 1091)
Print this item

  Lesson24 - home assistant remote access by FREE DuckDNS
Posted by: admin - 05-17-2022, 04:27 AM - Forum: Home automation training courses - Replies (5)


https://www.duckdns.org/

Print this item

Thumbs Up [Arduino IDE demo source code for KC868-E16S]--#06-KC868-E16S-RS485
Posted by: KinCony Support - 05-17-2022, 01:29 AM - Forum: KC868-E16S/E16P - No Replies

[Arduino IDE demo source code for KC868-E16S]--#06-KC868-E16S-RS485
   

Code:
/*WWW.KINCONY.COM */
/*KC868-E16S CODE OF RS485*/
void setup(){
  Serial2.begin(9600,SERIAL_8N1,13,32);// IO13 is 485RX  IO32 is 485TX
}

void loop() {
Serial2.println("abcd123456789551");// send abcd123456789551
}



Attached Files
.zip   KC868-E16S-RS485.zip (Size: 469.31 KB / Downloads: 961)
Print this item

Thumbs Up [Arduino IDE demo source code for KC868-E16S]--#05-KC868-E16S-LAN8720_UDP
Posted by: KinCony Support - 05-17-2022, 01:28 AM - Forum: KC868-E16S/E16P - No Replies

[Arduino IDE demo source code for KC868-E16S]--#05-KC868-E16S-LAN8720_UDP
   

Code:
/*www.kincony.com */
/* KC868-E16S CODE OF LAN8720-UDP */
#include <ETH.h>
#include <WiFiUdp.h>

#define ETH_ADDR        0
#define ETH_POWER_PIN  -1
#define ETH_MDC_PIN    23
#define ETH_MDIO_PIN   18
#define ETH_TYPE       ETH_PHY_LAN8720
#define ETH_CLK_MODE   ETH_CLOCK_GPIO17_OUT

WiFiUDP Udp;                      //Create UDP object
unsigned int localUdpPort = 4196; //local port
IPAddress local_ip(192, 168, 1, 200); 
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress dns(192, 168, 1, 1);

void setup()
{
  Serial.begin(115200);
  Serial.println();
   
  ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE); //start with ETH

  // write confir for static IP, gateway,subnet,dns1,dns2
  if (ETH.config(local_ip, gateway, subnet, dns, dns) == false) {
    Serial.println("LAN8720 Configuration failed.");
  }else{Serial.println("LAN8720 Configuration success.");}
 
  Serial.println("Connected");
  Serial.print("IP Address:");
  Serial.println(ETH.localIP());

  Udp.begin(localUdpPort); //begin UDP listener
}

void loop()
{
  int packetSize = Udp.parsePacket(); //get package size
  if (packetSize)                     //if have received data
  {
    char buf[packetSize];
    Udp.read(buf, packetSize); //read current data
    Serial.println();
    Serial.print("Received: ");
    Serial.println(buf);
    Serial.print("From IP: ");
    Serial.println(Udp.remoteIP());
    Serial.print("From Port: ");
    Serial.println(Udp.remotePort());

    Udp.beginPacket(Udp.remoteIP(), Udp.remotePort()); //ready to send data
    Udp.print("Received: ");   
    Udp.write((const uint8_t*)buf, packetSize); //copy data to sender buffer
    Udp.endPacket();            //send data
  }
}
   



Attached Files
.zip   KC868-E16S-LAN8720_UDP.zip (Size: 1.11 KB / Downloads: 888)
Print this item

Thumbs Up [Arduino IDE demo source code for KC868-E16S]--#04-KC868-E16S-ADC_IN
Posted by: KinCony Support - 05-17-2022, 01:25 AM - Forum: KC868-E16S/E16P - No Replies

[Arduino IDE demo source code for KC868-E16S]--#04-KC868-E16S-ADC_IN
   

Code:
/*www.kinocny.com */
/*KC868-E16S CODE OF ADC-IN*/

#include "Arduino.h"

#define ANALOG_A1   36
#define ANALOG_A2   35
#define ANALOG_A3   34
#define ANALOG_A4   39

void setup()
{
    Serial.begin(115200);
    delay(500);

  pinMode(ANALOG_A1,INPUT);
  pinMode(ANALOG_A2,INPUT);
  pinMode(ANALOG_A3,INPUT);
  pinMode(ANALOG_A4,INPUT);
}

void loop()
{

  if(analogRead(ANALOG_A1)!=0)  {Serial.printf("Current Reading A1 on Pin(%d)=%d\n",ANALOG_A1,analogRead(ANALOG_A1));}
  if(analogRead(ANALOG_A2)!=0)  {Serial.printf("Current Reading A2 on Pin(%d)=%d\n",ANALOG_A2,analogRead(ANALOG_A2));}
  if(analogRead(ANALOG_A3)!=0)  {Serial.printf("Current Reading A3 on Pin(%d)=%d\n",ANALOG_A3,analogRead(ANALOG_A3));}
  if(analogRead(ANALOG_A4)!=0)  {Serial.printf("Current Reading A4 on Pin(%d)=%d\n",ANALOG_A4,analogRead(ANALOG_A4));}
  delay(50);
}



Attached Files
.zip   KC868-E16S-ADC_IN.zip (Size: 674 bytes / Downloads: 831)
Print this item

Thumbs Up [Arduino IDE demo source code for KC868-E16S]--#03-KC868-E16S-8574-DO
Posted by: KinCony Support - 05-17-2022, 01:21 AM - Forum: KC868-E16S/E16P - No Replies

[Arduino IDE demo source code for KC868-E16S]--#03-KC868-E16S-8574-DO
   

Code:
/*KC868-E16S Code of PCF8574 OUTPUT  CONTROL RELAYS*/
/*Press and hold on key Download ,relays ON,   release key relays OFF*/
#include "Arduino.h"
#include "PCF8574.h"

/*Set pcf8574 Output i2c address and SDA IO16/ SCL IO15*/
#define buttonPin 0
PCF8574 pcf8574_1(0x21,16,15);
PCF8574 pcf8574_2(0x25,16,15);

void setup()
{
    Serial.begin(115200);
/* Set pinMode to OUTPUT*/
   pinMode(buttonPin, INPUT);// key download  IO0

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

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

  pcf8574_1.begin();
  pcf8574_2.begin();
}

void loop()
{
if(digitalRead(buttonPin)==0)
{
      pcf8574_1.digitalWrite(P0, LOW);  delay(100);
    pcf8574_1.digitalWrite(P1, LOW);  delay(100);
    pcf8574_1.digitalWrite(P2, LOW);  delay(100);
    pcf8574_1.digitalWrite(P3, LOW);  delay(100);
    pcf8574_1.digitalWrite(P4, LOW);  delay(100);
    pcf8574_1.digitalWrite(P5, LOW);  delay(100);
    pcf8574_1.digitalWrite(P6, LOW);  delay(100);
    pcf8574_1.digitalWrite(P7, LOW);  delay(100);
 
    pcf8574_2.digitalWrite(P0, LOW);  delay(100);
    pcf8574_2.digitalWrite(P1, LOW);  delay(100);
    pcf8574_2.digitalWrite(P2, LOW);  delay(100);
    pcf8574_2.digitalWrite(P3, LOW);  delay(100); 
    pcf8574_2.digitalWrite(P4, LOW);  delay(100);
    pcf8574_2.digitalWrite(P5, LOW);  delay(100);
    pcf8574_2.digitalWrite(P6, LOW);  delay(100);
    pcf8574_2.digitalWrite(P7, LOW);  delay(100);
  }
  else
  {
    pcf8574_1.digitalWrite(P0, HIGH);  delay(100);
    pcf8574_1.digitalWrite(P1, HIGH);  delay(100);
    pcf8574_1.digitalWrite(P2, HIGH);  delay(100);
    pcf8574_1.digitalWrite(P3, HIGH);  delay(100);
    pcf8574_1.digitalWrite(P4, HIGH);  delay(100);
    pcf8574_1.digitalWrite(P5, HIGH);  delay(100);
    pcf8574_1.digitalWrite(P6, HIGH);  delay(100);
    pcf8574_1.digitalWrite(P7, HIGH);  delay(100);
 
    pcf8574_2.digitalWrite(P0, HIGH);  delay(100);
    pcf8574_2.digitalWrite(P1, HIGH);  delay(100);
    pcf8574_2.digitalWrite(P2, HIGH);  delay(100);
    pcf8574_2.digitalWrite(P3, HIGH);  delay(100); 
    pcf8574_2.digitalWrite(P4, HIGH);  delay(100);
    pcf8574_2.digitalWrite(P5, HIGH);  delay(100);
    pcf8574_2.digitalWrite(P6, HIGH);  delay(100);
    pcf8574_2.digitalWrite(P7, HIGH);  delay(100);
  }
}



Attached Files
.zip   KC868-E16S-8574-DO.zip (Size: 911 bytes / Downloads: 825)
Print this item

Thumbs Up [Arduino IDE demo source code for KC868-E16S]--#02-KC868-E16S-8574-DI
Posted by: KinCony Support - 05-17-2022, 01:17 AM - Forum: KC868-E16S/E16P - No Replies

[Arduino IDE demo source code for KC868-E16S]--#02-KC868-E16S-8574-DI
   

Code:
/*KC868-E16S pcf8574 -digital input code*/
#include "Arduino.h"
#include "PCF8574.h"

// Set i2c address
PCF8574 pcf8574_IN1(0x22,16,15);
PCF8574 pcf8574_IN2(0x24,16,15);
void setup()
{
    Serial.begin(115200);
    delay(1000);

  pcf8574_IN1.begin();
  pcf8574_IN2.begin();


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

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

void loop()
{
   if (pcf8574_IN1.digitalRead(P0)==0)  {Serial.println("KEY1 PRESSED");}delay(100);
   if (pcf8574_IN1.digitalRead(P1)==0)  {Serial.println("KEY2 PRESSED");}delay(100);
   if (pcf8574_IN1.digitalRead(P2)==0)  {Serial.println("KEY3 PRESSED");}delay(100);
   if (pcf8574_IN1.digitalRead(P3)==0)  {Serial.println("KEY4 PRESSED");}delay(100);
   if (pcf8574_IN1.digitalRead(P4)==0)  {Serial.println("KEY5 PRESSED");}delay(100);
   if (pcf8574_IN1.digitalRead(P5)==0)  {Serial.println("KEY6 PRESSED");}delay(100);
   if (pcf8574_IN1.digitalRead(P6)==0)  {Serial.println("KEY7 PRESSED");}delay(100);
   if (pcf8574_IN1.digitalRead(P7)==0)  {Serial.println("KEY8 PRESSED");}delay(100);
   
   if (pcf8574_IN2.digitalRead(P0)==0)  {Serial.println("KEY9 PRESSED");}delay(100);
   if (pcf8574_IN2.digitalRead(P1)==0)  {Serial.println("KEY10 PRESSED");}delay(100);
   if (pcf8574_IN2.digitalRead(P2)==0)  {Serial.println("KEY11 PRESSED");}delay(100);
   if (pcf8574_IN2.digitalRead(P3)==0)  {Serial.println("KEY12 PRESSED");}delay(100);
   if (pcf8574_IN2.digitalRead(P4)==0)  {Serial.println("KEY13 PRESSED");}delay(100);
   if (pcf8574_IN2.digitalRead(P5)==0)  {Serial.println("KEY14 PRESSED");}delay(100);
   if (pcf8574_IN2.digitalRead(P6)==0)  {Serial.println("KEY15 PRESSED");}delay(100);
   if (pcf8574_IN2.digitalRead(P7)==0)  {Serial.println("KEY16 PRESSED");}delay(100);   

 
}
   



Attached Files
.zip   KC868-E16S-8574-DI.zip (Size: 783 bytes / Downloads: 842)
Print this item

Thumbs Up [Arduino IDE demo source code for KC868-E16S]--#01-KC868-E16S-433-decode
Posted by: KinCony Support - 05-17-2022, 01:07 AM - Forum: KC868-E16S/E16P - No Replies

[Arduino IDE demo source code for KC868-E16S]--#01-KC868-E16S-433-decode
   

Code:
/*www.kinocny.com */
/*KC868-E16S CODE OF 433MHz decode*/

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableReceive(digitalPinToInterrupt(4));
}

void loop() {
  if (mySwitch.available()) {
   
    Serial.print("Received ");
    Serial.print( mySwitch.getReceivedValue() );
    Serial.print(" / ");
    Serial.print( mySwitch.getReceivedBitlength() );
    Serial.print("bit ");
    Serial.print("Protocol: ");
    Serial.println( mySwitch.getReceivedProtocol() );

    mySwitch.resetAvailable();
  }
}
   



Attached Files
.zip   KC868-E16S-433-decode.zip (Size: 669 bytes / Downloads: 817)
Print this item

  KC868 H32B in home assistant
Posted by: ahmedwizza - 05-17-2022, 12:49 AM - Forum: KC868-HxB series Smart Controller - Replies (4)

hello engineer could you please help my in home assistant

when i add KC868 H32B to home assistant .needed to make one switch control all On and Off like attached photos.



Attached Files Thumbnail(s)
       
Print this item

Thumbs Up [Arduino IDE of KC868-E16S]--#00-KC868-E16S-configure for ESPhome
Posted by: admin - 05-17-2022, 12:45 AM - Forum: KC868-E16S/E16P - Replies (13)

esphome:
  name: kc868-e16s
  platform: ESP32
  board: esp32dev
 
 
# Example configuration entry for ESP32
i2c:
  sda: 16
  scl: 15
  scan: true
  id: bus_a


# Example configuration entry
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0

  # Optional manual IP
#  manual_ip:
#    static_ip: 192.168.1.199
#    gateway: 192.168.1.1
#    subnet: 255.255.255.0 


# Example configuration entry
pcf8574:
  - id: 'pcf8574_hub_out_1'  # for output channel 1-8
    address: 0x21

  - id: 'pcf8574_hub_out_2'  # for output channel 9-16
    address: 0x25

  - id: 'pcf8574_hub_in_1'  # for input channel 1-8
    address: 0x22

  - id: 'pcf8574_hub_in_2'  # for input channel 9-16
    address: 0x24

# Individual outputs
switch:
  - platform: gpio
    name: "e16s-output1"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "e16s-output2"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "e16s-output3"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "e16s-output4"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "e16s-output5"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "e16s-output6"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "e16s-output7"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "e16s-output8"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "e16s-output9"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "e16s-output10"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "e16s-output11"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 2
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "e16s-output12"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "e16s-output13"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 4
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "e16s-output14"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 5
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "e16s-output15"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 6
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "e16s-output16"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 7
      mode: OUTPUT
      inverted: true
     
binary_sensor:
  - platform: gpio
    name: "e16s-input1"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "e16s-input2"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "e16s-input3"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "e16s-input4"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "e16s-input5"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "e16s-input6"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "e16s-input7"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "e16s-input8"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "e16s-input9"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "e16s-input10"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "e16s-input11"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "e16s-input12"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "e16s-input13"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "e16s-input14"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "e16s-input15"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "e16s-input16"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 7
      mode: INPUT
      inverted: true

# Enable logging
logger:

# Enable Home Assistant API
api:

   

Print this item