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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,890
» Latest member: fnfunkin
» Forum threads: 3,889
» Forum posts: 19,843

Full Statistics

Online Users
There are currently 23 online users.
» 0 Member(s) | 11 Guest(s)
AhrefsBot, Amazonbot, Baidu, Sogou web, bot

Latest Threads
A8v3
Forum: "KCS" v3 firmware
Last Post: admin
23 minutes ago
» Replies: 1
» Views: 3
kincony esp32s3
Forum: News
Last Post: admin
24 minutes ago
» Replies: 1
» Views: 7
T16M
Forum: News
Last Post: admin
25 minutes ago
» Replies: 1
» Views: 3
Z1
Forum: KC868-A16v3
Last Post: admin
Yesterday, 10:37 PM
» Replies: 16
» Views: 849
kc-868 AK
Forum: "KCS" v3 firmware
Last Post: admin
Yesterday, 10:35 PM
» Replies: 12
» Views: 57
communication between 2 b...
Forum: DIY Project
Last Post: arthurcole
Yesterday, 07:37 AM
» Replies: 4
» Views: 271
HAv2 ESPHome
Forum: KC868-HA /HA v2
Last Post: admin
Yesterday, 06:50 AM
» Replies: 3
» Views: 20
KinCony ESP32 Tuya IoT ad...
Forum: KC868-ATC / Tuya adapter V2
Last Post: admin
04-07-2026, 05:55 AM
» Replies: 3
» Views: 57
KinCony Z1 Problem
Forum: KC868-AG / AG Pro / AG8 / Z1
Last Post: admin
04-06-2026, 11:39 PM
» Replies: 14
» Views: 762
KC868-E16S/E16P demo conf...
Forum: KC868-E16S/E16P
Last Post: admin
04-06-2026, 11:37 PM
» Replies: 20
» Views: 11,293

  Controlling devices by chatgpt
Posted by: Saif Kitany - 05-18-2024, 04:08 AM - Forum: News - Replies (3)

Can I control H32,H32L,H32B,H32Bs…. Or any controller from you by chatgpt?

Print this item

  Control fan speed using 0-10V and SSR
Posted by: alankrit0113 - 05-17-2024, 07:47 AM - Forum: KC868-AIO - Replies (4)

Hi, I am installing AIO in my house for complete control. Can I use 0-10v dimming channel with SSR to control speed of ceiling fan.? 
Also do I need a special SSR for that, commonly available SSR is “3-32V DC to 0-380V AC”. Will this type work or do I need some special SSR.?
Thanks

Print this item

  Binary Inputs 9-15 turn off with 1-8
Posted by: dockside - 05-16-2024, 08:20 PM - Forum: KC868-A16 - Replies (7)

Used ESPHome to configure Digital Inputs. However both inputs 8 & 16 turn off when shorting input 16.  Same with inputs 9 & 15 when shorting input 15. Same with all inputs from 16 down to 9, that is inputs 8 down to 1 also turn off. My KC868-A16 board is at REV 1.6 and log information attached.

Thanks for the help.

Ted

Print this item

  AM2301
Posted by: milan.net - 05-14-2024, 03:32 PM - Forum: KC868-A8S - Replies (8)

Hello, I'm verry interested in this board( the v2 version)

I have  2 questions.

I need to use 2x AM2301 sensors, is it possible to use them with this board?

Which poe expansion board do I need to add to this board to use poe directly?

Print this item

  Kc868-AM and sensors
Posted by: fdcemb5 - 05-14-2024, 02:31 PM - Forum: KC868-AM - Replies (4)

Where can I get yaml configuration file for esphome for the diagram attached

Print this item

  KC868-AM with DS18B20
Posted by: fdcemb5 - 05-14-2024, 12:06 PM - Forum: KC868-AM - Replies (1)

Your ESphome yaml file example for KC868-AM does not show for DS18B20 sensor, how do add configuration entries for temperature sensors

Print this item

  KC868 server
Posted by: fdcemb5 - 05-14-2024, 12:00 PM - Forum: KC868-Server Raspberry Pi4 local server - Replies (3)

if I connect DS18B20/DHT11/21 Temperature and humidity sensor to these pins, how do I make it appear in Home Assistant since I cannot write Arduino code on KC868 server

GPIO-1: GPIO4
GPIO-2: GPIO5
GPIO-3: GPIO18
GPIO-4: GPIO19

Print this item

  Board Boot Error
Posted by: corkers - 05-14-2024, 06:28 AM - Forum: KC868-A16 - Replies (15)

Hi I have an A16 v1.5 board that will not flash.

   
   


   

From doing some reading this is a fatal error....

Print this item

  Tuya adapter V2 arduino source code - RS485 relay controller KC868-H32BS
Posted by: admin - 05-14-2024, 02:18 AM - Forum: KC868-ATC / Tuya adapter V2 - Replies (8)

This is sample demo let RS485 digital output device (KinCony KC868-H32BS controller) can work with Tuya app by internet.  you can let your own RS485 relay board add to Tuya app.
added Tuya adapter v2, relay board will support alexa or Google home speaker for voice control directly.
   
   
   
arduino source code download: 
.zip   Tuya_AdapterV2_RS485_Relay.zip (Size: 2.63 KB / Downloads: 568)

Code:
#include <ModbusMaster.h>
#include <Arduino.h>
#include <TuyaWifi.h>
#include "HardwareSerial.h"
//---------RS485 setting
#define DEBUG   1

#define SERIAL_BAUD   9600
#define RX_PIN    32
#define TX_PIN    33
#define ADAPT485_NUM  2
#define SLAVE_ADDR  1
#define READ_ADDR  0
#define READ_NUM   32 

/* Current device DP values */
bool rt_coils_status[32] = {0};

HardwareSerial My485Serial(ADAPT485_NUM);
ModbusMaster node;
uint16_t rcv_buf[READ_NUM>>4] = {0};
  
static void ReadEmeterRegs(void)
{
  uint32_t read_tmp = 0;
  
  uint8_t result = node.readCoils(READ_ADDR, READ_NUM);
  if (result == node.ku8MBSuccess) {//if communicate successful then
       
    for (uint8_t i = 0; i < 2; i++)
    {
      rcv_buf[i] = node.getResponseBuffer(i);
      for(uint8_t j = 0; j < 16; j++)
      {
        if(j<8) rt_coils_status[i*16 + j+8] = (rcv_buf[1-i]&(1<<j))?true:false;
        else rt_coils_status[i*16 + j - 8] = (rcv_buf[1-i]&(1<<j))?true:false;
      }
    }
   
    #if DEBUG
    Serial1.print("Get switch[0..31] value is");
    Serial1.print(":<0x");
    Serial1.print(rcv_buf[0],HEX);
    Serial1.print(rcv_buf[1],HEX);
    Serial1.println("> ");
    #endif
    
  }
  else
  {
    node.clearResponseBuffer();
  }

  delay(100);
}

//---RS485 setting end----

TuyaWifi my_device;



/* Current LED status */
unsigned char led_state = 0;
/* Connect network button pin */
int key_pin = 25;


/* Data point define */
typedef enum
{
  DPID_SWITCH01 = 1,
  DPID_SWITCH02,DPID_SWITCH03,
  DPID_SWITCH04,DPID_SWITCH05,DPID_SWITCH06,
  DPID_SWITCH07 = 113,
  DPID_SWITCH08,DPID_SWITCH09,DPID_SWITCH10,
  DPID_SWITCH11,DPID_SWITCH12,DPID_SWITCH13,
  DPID_SWITCH14,DPID_SWITCH15,DPID_SWITCH16,
  DPID_SWITCH17,DPID_SWITCH18,DPID_SWITCH19,
  DPID_SWITCH20,DPID_SWITCH21,DPID_SWITCH22,
  DPID_SWITCH23,DPID_SWITCH24,DPID_SWITCH25,
  DPID_SWITCH26,DPID_SWITCH27,DPID_SWITCH28,
  DPID_SWITCH29,DPID_SWITCH30,DPID_SWITCH31,
  DPID_SWITCH32,
}H32BS_DPID_DEF;

/*const unsigned char dpid_arr[32] = {
  1,2,3,4,5,6,
  113,114,115,116,117,118,119,120,
  121,122,123,124,125,126,127,128,
  129,130,131,132,133,134,135,136,
  137,138,
};*/

#define LED_WiFi  26
//#define LED_User  33



/* Stores all DPs and their types. PS: array[][0]:dpid, array[][1]:dp type.
*                                     dp type(TuyaDefs.h) : DP_TYPE_RAW, DP_TYPE_BOOL, DP_TYPE_VALUE, DP_TYPE_STRING, DP_TYPE_ENUM, DP_TYPE_BITMAP
*/
unsigned char dp_array[][2] =
{
  {DPID_SWITCH01, DP_TYPE_BOOL},{DPID_SWITCH02, DP_TYPE_BOOL},
  {DPID_SWITCH03, DP_TYPE_BOOL},{DPID_SWITCH04, DP_TYPE_BOOL},
  {DPID_SWITCH05, DP_TYPE_BOOL},{DPID_SWITCH06, DP_TYPE_BOOL},
  {DPID_SWITCH07, DP_TYPE_BOOL},{DPID_SWITCH08, DP_TYPE_BOOL},

  {DPID_SWITCH09, DP_TYPE_BOOL},{DPID_SWITCH10, DP_TYPE_BOOL},
  {DPID_SWITCH11, DP_TYPE_BOOL},{DPID_SWITCH12, DP_TYPE_BOOL},
  {DPID_SWITCH13, DP_TYPE_BOOL},{DPID_SWITCH14, DP_TYPE_BOOL},
  {DPID_SWITCH15, DP_TYPE_BOOL},{DPID_SWITCH16, DP_TYPE_BOOL},

  {DPID_SWITCH17, DP_TYPE_BOOL},{DPID_SWITCH18, DP_TYPE_BOOL},
  {DPID_SWITCH19, DP_TYPE_BOOL},{DPID_SWITCH20, DP_TYPE_BOOL},
  {DPID_SWITCH21, DP_TYPE_BOOL},{DPID_SWITCH22, DP_TYPE_BOOL},
  {DPID_SWITCH23, DP_TYPE_BOOL},{DPID_SWITCH24, DP_TYPE_BOOL},

  {DPID_SWITCH25, DP_TYPE_BOOL},{DPID_SWITCH26, DP_TYPE_BOOL},
  {DPID_SWITCH27, DP_TYPE_BOOL},{DPID_SWITCH28, DP_TYPE_BOOL},
  {DPID_SWITCH29, DP_TYPE_BOOL},{DPID_SWITCH30, DP_TYPE_BOOL},
  {DPID_SWITCH31, DP_TYPE_BOOL},{DPID_SWITCH32, DP_TYPE_BOOL},
};

unsigned char pid[] = {"3ocztklfu3q32jab"}; ////change pid here....
unsigned char mcu_ver[] = {"1.0.0"};

/* last time */
unsigned long last_time = 0;

/**
* @description: DP download callback function.
* @param {unsigned char} dpid
* @param {const unsigned char} value
* @param {unsigned short} length
* @return {unsigned char}
*/
unsigned char dp_process(unsigned char dpid,const unsigned char value[], unsigned short length)
{
  int16_t index_out_coil = -1;
  unsigned char get_down_cmd = false;
 
  for(int16_t i=0;i<32;i++)
  {
    if(dpid == dp_array[i][0])
    {
      index_out_coil = i;
      break;
    }
  }
  if(index_out_coil < 0) return TY_ERROR;

  get_down_cmd = my_device.mcu_get_dp_download_data(dpid,value,length);

  Serial1.print("Rcv Command:<dpid,");
  Serial1.print(dpid,DEC);
  Serial1.print(" value,");
  Serial1.print(value[0],HEX);
  Serial1.print(" len,");
  Serial1.println(length,HEX);
  Serial1.println("> ");
   
 

  #if DEBUG
    Serial1.print("get_down_cmd value is:<");
    Serial1.print(get_down_cmd,DEC); 
    Serial1.println("> ");
    Serial1.print("Node WriteCoilAddr<");
    Serial1.print(index_out_coil,DEC);
    Serial1.print("> ");
  #endif

  delay(100);
  uint8_t result = node.writeSingleCoil(index_out_coil, value[0]);
  #if DEBUG
    Serial1.print(" result:<");
    Serial1.print(result,DEC); 
    Serial1.println("> ");
  #endif

  delay(100);
  my_device.mcu_dp_update(dpid, value, length);
  return TY_SUCCESS;
}

void setup()
{

  My485Serial.begin(SERIAL_BAUD, SERIAL_8N1, RX_PIN, TX_PIN); //RS485 serial port
  node.begin(SLAVE_ADDR,My485Serial);
  Serial.begin(9600,SERIAL_8N1,22,19);  //Tuya module serial port
  Serial1.begin(115200,SERIAL_8N1,3,1);   //USB serial port

 
  // Serial with tuyawifi
 
 

  //Initialize led port, turn off led.
  pinMode(LED_WiFi, OUTPUT);
  digitalWrite(LED_WiFi, LOW);

/*  pinMode(LED_User, OUTPUT);
  digitalWrite(LED_User, LOW);*/

  //Initialize networking keys.
  pinMode(key_pin, INPUT_PULLUP);

  //Enter the PID and MCU software version
  my_device.init(pid, mcu_ver);
  //incoming all DPs and their types array, DP numbers
  my_device.set_dp_cmd_total(dp_array, 2);
  //register DP download processing callback function
  my_device.dp_process_func_register(dp_process);
  //register upload all DP callback function
  my_device.dp_update_all_func_register(dp_update_all);
 
  //delay(300);
  last_time = millis();
}

void loop()
{
  ReadEmeterRegs();  // read RS485 sensor
  my_device.uart_service();

  //Enter the connection network mode when Pin7 is pressed.
  if (digitalRead(key_pin) == LOW) {
    delay(80);
    if (digitalRead(key_pin) == LOW) {
      my_device.mcu_set_wifi_mode(SMART_CONFIG);
    }
  }
  /* LED blinks when network is being connected */
  if ((my_device.mcu_get_wifi_work_state() != WIFI_LOW_POWER) && (my_device.mcu_get_wifi_work_state() != WIFI_CONN_CLOUD) && (my_device.mcu_get_wifi_work_state() != WIFI_SATE_UNKNOW)) {
    if (millis()- last_time >= 500) {
      last_time = millis();

      if (led_state == LOW) {
        led_state = HIGH;
      } else {
        led_state = LOW;
      }
      digitalWrite(LED_WiFi, led_state);
    }
  }

  /* report the temperature and humidity */
  if ((my_device.mcu_get_wifi_work_state() == WIFI_CONNECTED) ||
      (my_device.mcu_get_wifi_work_state() == WIFI_CONN_CLOUD)) {
    dp_update_all();
  }

  delay(500);
}

static bool coils_old_status[32] = {false};

unsigned char tmp_cmd = 0;
static void CompareAndReport(void)
{
  for(int16_t i=0;i<32;i++)
  {
    if(coils_old_status[i] != rt_coils_status[i])
    {
      coils_old_status[i] = rt_coils_status[i];
      tmp_cmd = rt_coils_status[i]?1:0;
      #if 0
      Serial1.print("Changed happed:<dpid,");
      Serial1.print(dp_array[i][0],DEC);
      Serial1.println("> ");
      #endif
      my_device.mcu_dp_update(dp_array[i][0],tmp_cmd, 1);
      delay(10);
      //break;
    }
  }
}
/**
* @description: Upload all DP status of the current device.
* @param {*}
* @return {*}
*/
void dp_update_all(void)
{
  CompareAndReport();
 
}

Print this item

  Kc868-server VS Kincony server 16
Posted by: Saif Kitany - 05-13-2024, 07:43 PM - Forum: News - Replies (3)

What are the differences between kc868- server & kincony server 16?

I want to purchase one of them, but I’m wondering what are the main difference, and which one i should buy for my home project?

Print this item