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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,431
» Latest member: mshomsey
» Forum threads: 3,695
» Forum posts: 19,015

Full Statistics

Online Users
There are currently 36 online users.
» 0 Member(s) | 21 Guest(s)
AhrefsBot, Amazonbot, Bytespider, Crawl, PetalBot, bot

Latest Threads
Voltage wrong
Forum: N30
Last Post: Painy
4 hours ago
» Replies: 0
» Views: 13
flash kc868-a4
Forum: KC868-A series and Uair Smart Controller
Last Post: Michel.nadin
8 hours ago
» Replies: 16
» Views: 596
[arduino code examples fo...
Forum: B4 (under designing)
Last Post: admin
Today, 04:05 AM
» Replies: 0
» Views: 4
[arduino code examples fo...
Forum: B4M (under designing)
Last Post: admin
Today, 04:05 AM
» Replies: 0
» Views: 2
[arduino code examples fo...
Forum: B4 (under designing)
Last Post: admin
Today, 04:04 AM
» Replies: 0
» Views: 6
[arduino code examples fo...
Forum: B4M (under designing)
Last Post: admin
Today, 04:04 AM
» Replies: 0
» Views: 3
[arduino code examples fo...
Forum: B4 (under designing)
Last Post: admin
Today, 04:02 AM
» Replies: 0
» Views: 3
[arduino code examples fo...
Forum: B4M (under designing)
Last Post: admin
Today, 04:02 AM
» Replies: 0
» Views: 2
[arduino code examples fo...
Forum: B4 (under designing)
Last Post: admin
Today, 04:01 AM
» Replies: 0
» Views: 5
[arduino code examples fo...
Forum: B4M (under designing)
Last Post: admin
Today, 04:01 AM
» Replies: 0
» Views: 4

  KC868-E16S wiring diagram
Posted by: KinCony Support - 09-22-2023, 01:34 AM - Forum: KC868-E16S/E16P - No Replies

   

Print this item

  Arduino source code demo for KinCony M1 Energy Meter Controller
Posted by: admin - 09-21-2023, 03:48 AM - Forum: KC868-M16 / M1 / MB / M30 - No Replies

Code:
/* KinCony M1 arduino demo
* output BL0942 voltage,current,power,frequency data by serial port
* @Author: www.kincony.com
*/
#include <SoftwareSerial.h>


const int Cur_mR = 10200;  //10200;
const int Volt_mR = 28700;   //28700;

unsigned char eNe_state = 0;

unsigned long dp_value_add_ele_1_value = 0;
unsigned long dp_value_cur_current_1_value = 0;
unsigned long dp_value_cur_power_1_value = 0;
unsigned long dp_value_cur_voltage_1_value = 0;
unsigned long dp_value_cur_freq_1_value = 0;

unsigned long dp_value_temp_value = 0;


#define  USB_TX_PIN   1
#define  USB_RX_PIN   3
#define  ENE1_RX_PIN   14
#define  ENE1_TX_PIN   13
#define  OUT1_PIN   33

unsigned long last_time = 0;
unsigned long eNe_last_time = 0;
String indata="";

String val="";
String outdata="";

SoftwareSerial eNe1;

void setup()
{
  pinMode(OUT1_PIN, OUTPUT);
  digitalWrite(OUT1_PIN, HIGH);
  Serial2.begin(9600,SERIAL_8N1,USB_RX_PIN,USB_TX_PIN);
  eNe1.begin(9600, SWSERIAL_8N1, ENE1_RX_PIN, ENE1_TX_PIN, false, 64);
  eNe1.listen();

  last_time = millis();
  eNe_last_time = last_time;
  eNe_state = 0;

}

void loop()
{


//sample energy
switch (eNe_state)
{
case 0:
    if((millis() - eNe_last_time)>100)
    {
     eNe1.listen();
     eNe_state=1;
     eNe_last_time = millis();
    }
    break;    
case 1:
    if((millis() - eNe_last_time)>1000)
    {
     eNe_state=2;
     eNe_last_time = millis();
    }
    break;    
case 2:
    outdata = "12";
    outdata[0] = 0x58;
    outdata[1] = 0xAA;
    eNe1.print(outdata);
    eNe_state=3;
    eNe_last_time = millis();
    break;    
case 3:
    if(eNe1.available()>0)
      {
        indata+=char(eNe1.read());   //read ene1

    eNe_last_time = millis();
      }
      else
      {
        if(((millis() - eNe_last_time)>4)&&(indata.length()>2))
          {

            val=indata;   //
           

              dp_value_add_ele_1_value=(double(indata[13]+indata[14]*256+indata[15]*65536)*16384*256*1218*1218*22*5)/36000/3537/Cur_mR/Volt_mR; //10200mR 28700mR
              dp_value_cur_current_1_value=(double(indata[1]+indata[2]*256+indata[3]*65536)*1218*1000)/305978/Cur_mR;  //10200mR
              dp_value_cur_power_1_value=(double(indata[10]+indata[11]*256+indata[12]*65536)*1218*1218*22*5)/3537/Cur_mR/Volt_mR; //10200mR 28700mR
              dp_value_cur_voltage_1_value=(double(indata[4]+indata[5]*256+indata[6]*65536)*1218*22*5)/73978/Volt_mR; //28700mR
              dp_value_cur_freq_1_value=2*500000/(double(indata[16]+indata[17]*256+indata[18]*65536)); //
             
            Serial2.println("meter1 channel data:");
            Serial2.print("ele1:");
            Serial2.print(dp_value_add_ele_1_value);
            Serial2.println(" wh");
            Serial2.print("current1:");
            Serial2.print(dp_value_cur_current_1_value);
            Serial2.println(" mA");
            Serial2.print("power1:");
            Serial2.print(dp_value_cur_power_1_value);
            Serial2.println(" W");
            Serial2.print("voltage1:");
            Serial2.print(dp_value_cur_voltage_1_value);
            Serial2.println(" V");
            Serial2.print("freq1:");
            Serial2.print(dp_value_cur_freq_1_value);
            Serial2.println(" Hz");
         
            eNe_state=0;
            indata="";
            eNe_last_time = millis();
          }
      }
     break;    

delay(1000);

}
}


.zip   M1.zip (Size: 1.14 KB / Downloads: 669)

Print this item

  KC868-COLB Logical Controller
Posted by: abgran - 09-21-2023, 12:35 AM - Forum: KC868-HxB series Smart Controller - Replies (3)

Hi.. 

My question is,

1. How to reset this COLB?
  - The reason to reset is web admin turning blank. See attachment below.
2. How to update firmware? What tool i need?

Any video to reference?

Thank you.



Attached Files Thumbnail(s)
   
Print this item

  KinCony M1 configure yaml for ESPhome
Posted by: admin - 09-21-2023, 12:13 AM - Forum: KC868-M16 / M1 / MB / M30 - No Replies

   

.txt   M1-Home assistant.txt (Size: 865 bytes / Downloads: 456)

esphome:
  name: m1
  platform: ESP32
  board: esp32dev
uart:
  - id: uart_bus
    tx_pin: GPIO13
    rx_pin: GPIO14
    baud_rate: 9600
    stop_bits: 1   

# Enable logging
logger:

# Enable Home Assistant API
api:

# Example configuration entry
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0
 
sensor:
  - platform: bl0942
    uart_id: uart_bus
    update_interval: 3s
    voltage:
      name: 'M1 Voltage'
    current:
      name: 'M1 Current'
      filters:
        multiply: 0.1965
    power:
      name: 'M1 Power'
    energy:
      name: 'M1 Energy'
    frequency:
      name: "M1 Frequency"
      accuracy_decimals: 2

switch:
  - platform: gpio
    pin: 33
    name: "M1-relay"

binary_sensor:
  - platform: gpio
    pin: 32
    name: "M1-sensor-DI"

Print this item

  KC868-M1 ESP32 I/O pin define
Posted by: admin - 09-21-2023, 12:11 AM - Forum: KC868-M16 / M1 / MB / M30 - Replies (3)

IIC SDA:16
IIC SCL:15

Relay:33
Digital input:32

IR sender:4
IR receiver:5

energy meter BL0942 RXD: 13
energy meter BL0942 TXD: 14


Ethernet (LAN8720) I/O define:

#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

Print this item

  serial port issue
Posted by: bartek - 09-20-2023, 10:10 PM - Forum: KC868-A8S - Replies (3)

Dear Kincony,

I've recently received my KC868-A8S board from your store on Aliexpress.
However it seems like my new board is not functioning.

I've connected it to 12V power.
Then connected to USB-C cable from board to my laptop.
Nothing is showing up in new serial ports.
I've tested different cables, different usb ports and two different laptops.
My other esp32 board with ttl to serial converter ch340 work just fine.
Only my new kc868-a8s board does not want to work.

Kindly let me know what to do next.

Thank you.

Print this item

  Create light switch in home assistant using MQTT
Posted by: truongdq54 - 09-20-2023, 05:43 PM - Forum: KC868-A16 - Replies (3)

If I create a switch, it works ok,
switch:
  - name: 'a16-kcs-output-1'
    unique_id: a16-kcs-output-1
    state_topic: 'KC868_A16/B0B21CCF0978/STATE'
    command_topic: 'KC868_A16/B0B21CCF0978/SET'
    payload_on:  '{"output1":{"value":true}}'
    payload_off:  '{"output1":{"value":false}}'
    value_template: '{{ value_json.output1.value }}'
    state_on: true
    state_off: false

But if I create a "light",
light:
  - name: 'my_led'
    unique_id: a16-kcs-output-led-wc-1
    state_topic: 'KC868_A16/B0B21CCF0978/STATE'
    command_topic: 'KC868_A16/B0B21CCF0978/SET'
    payload_on:  '{"output1":{"value":true}}'
    payload_off:  '{"output1":{"value":false}}'
    state_value_template: '{{ value_json.output1.value }}'

the UI in home assistant showed "Unknown" status.     
Please help!

Print this item

  ould you please send me a high-quality picture of all the controllers
Posted by: engmohades - 09-20-2023, 12:06 PM - Forum: News - Replies (5)

Hi, could you please send me linlk a high-quality picture of all the controllers, please?

Print this item

Photo KC868-E16S ESP Home configuration with Home Assistant
Posted by: Tase - 09-19-2023, 02:43 PM - Forum: KC868-E16S/E16P - Replies (8)

Hi, since i am new to this, i need the users with time and patience to help out
Have installed ESP Home in Home Assistant, introduced the demo code yaml file (posted here on the frum by other users), but when trying to instal ESP32, by connecting the relay E162 via USB to Server Mini, i do not see the device.        
Am i missing or doing something wrong?

Print this item

Wink kc868 4ch
Posted by: alexgr2006 - 09-19-2023, 10:16 AM - Forum: Suggestions and feedback on KinCony's products - Replies (7)

hey can I use my device from garmin watch?

Print this item