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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,481
» Latest member: exoticdreamdc
» Forum threads: 3,711
» Forum posts: 19,122

Full Statistics

Online Users
There are currently 19 online users.
» 0 Member(s) | 12 Guest(s)
Amazonbot, PetalBot, bot

Latest Threads
F32 and 433 Mhz
Forum: F32
Last Post: lulu01
1 hour ago
» Replies: 4
» Views: 39
KinCony E8v3 RS485 Din Ra...
Forum: News
Last Post: admin
11 hours ago
» Replies: 0
» Views: 8
KinCony E24v3 RS485 Din R...
Forum: News
Last Post: admin
Today, 01:32 AM
» Replies: 0
» Views: 6
Connect um330 and kc828 a...
Forum: DIY Project
Last Post: admin
Today, 01:14 AM
» Replies: 34
» Views: 3,762
F16 tuya reverse sw. func...
Forum: F16
Last Post: admin
Today, 12:07 AM
» Replies: 1
» Views: 8
Relay board wiring error?
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
Today, 12:04 AM
» Replies: 1
» Views: 20
KC868-A16 ethernet work w...
Forum: KC868-A16
Last Post: Konstantin
Yesterday, 05:26 PM
» Replies: 23
» Views: 16,386
KinCony E16v3 RS485 Din R...
Forum: News
Last Post: ldebacker
Yesterday, 12:29 PM
» Replies: 1
» Views: 222
KC868-A16 - IP & PORT ?? ...
Forum: KC868-A16
Last Post: admin
Yesterday, 12:19 PM
» Replies: 13
» Views: 946
[arduino code examples fo...
Forum: B24M
Last Post: admin
Yesterday, 05:32 AM
» Replies: 4
» Views: 276

  Smoke Sensor Connected to KC868-AI
Posted by: fdcemb5 - 04-28-2024, 11:19 AM - Forum: KC868-A series and Uair Smart Controller - Replies (1)

I connect the Smoke sensor to the KC868-AI, to input 3, the smoke sensor is constantly turn the input On. The sensor's 2 LED are constantly constantly green. I introduced smoke flame to the sensor but the green light still remains green and the input is turned on. This behavior is wired. Any help what is happening.

The Sensor is connected to pin 1+ve and pin 2 -ve, pin 3 to KCOM, and pin 4 to AI input pin 3.

Print this item

  [Arduino source code for KC868-ASR]-03 Relay auto ON/OFF by date time
Posted by: admin - 04-28-2024, 05:21 AM - Forum: KC868-ASR - No Replies

This is an arduino sample code for KC868-ASR , auto control relay ON/OFF by date and time. for example ,the demo is every year 4-26 (April 26th) relay will ON, every year 5-2 (May 2nd) relay will OFF. it support command by serial port (USB cable) to send date/time and read date/time.
   

Code:
#include <DS3231.h>
#include <Wire.h>

String serial_cmd_rcv = ""; //serial port receiver

typedef struct
{
  byte year;// Last two digits of the year, lib will add 2000.
  byte month;
  byte day;
  byte hour ;
  byte minute ;
  byte second ;
}MY_DATE_STR;

MY_DATE_STR my_date_str = {0};

#define OPEN_RLY_DATA   26
#define OPEN_RLY_MONTH  4

#define CLOSE_RLY_DATA   2
#define CLOSE_RLY_MONTH   5

#define SDA_PIN   26
#define SCL_PIN   27

#define RLY1_PIN  19
#define RLY2_PIN  5

DS3231  rtc;
bool h12Flag;
bool pmFlag;
static bool bCentury = false;
static bool old_level_high = false;
static bool old_level_low = false;

static bool CompareOpenDate()
{
  return (rtc.getDate()==OPEN_RLY_DATA)&(rtc.getMonth(bCentury)==OPEN_RLY_MONTH);
}

static bool CompareCloseDate()
{
  return (rtc.getDate()==CLOSE_RLY_DATA)&(rtc.getMonth(bCentury)==CLOSE_RLY_MONTH);
}

static void PrintfCurTime()
{
  Serial.print("current time is: ");
  int year = rtc.getYear() + 2000;
  Serial.print(year);
  Serial.print("-");
 
  Serial.print(rtc.getMonth(bCentury), DEC);
  Serial.print("-");
 
  // then the date
  Serial.print(rtc.getDate(), DEC);
  Serial.print(" ");
 
  // and the day of the week
  //Serial.print(rtc.getDoW(), DEC);
  //Serial.print(" ");
 
  // Finally the hour, minute, and second
  Serial.print(rtc.getHour(h12Flag, pmFlag), DEC);
  Serial.print(":");
  Serial.print(rtc.getMinute(), DEC);
  Serial.print(":");
  Serial.println(rtc.getSecond(), DEC);
 
}
static void GetSerialCmd()
{ ////format:D2024-04-28T11:50:22

  /*while (Serial.available() > 0)
  {
    serial_cmd_rcv += char(Serial.read());
    delay(5); 
  } */
  if(Serial.available() > 0)
  {
    delay(100);
    int num_read = Serial.available();
    while(num_read--)
      serial_cmd_rcv += char(Serial.read());
  }
  else return;
  
  serial_cmd_rcv.trim();

  if(serial_cmd_rcv == "current time")
  {
    PrintfCurTime();
    serial_cmd_rcv = "";
    return;
  }

  Serial.print("rcv length:");
  Serial.println(serial_cmd_rcv.length());

  int indexof_d = serial_cmd_rcv.indexOf('D');
  int indexof_t = serial_cmd_rcv.indexOf('T');

  Serial.print("d index:");Serial.print(indexof_d);
  Serial.print(" t index:");Serial.println(indexof_t);
 
  if (serial_cmd_rcv.length() != 20 ||
      serial_cmd_rcv.substring(0,1) != "D" ||
      serial_cmd_rcv.substring(11,12) != "T") 
  {
   
    Serial.println(serial_cmd_rcv);
    serial_cmd_rcv="";
    return;
    }
   
  Serial.println("setting is start!");
 
  my_date_str.year = (byte)serial_cmd_rcv.substring(3,5).toInt();
  my_date_str.month = (byte)serial_cmd_rcv.substring(6,8).toInt();
  my_date_str.day = (byte)serial_cmd_rcv.substring(9,11).toInt();

  my_date_str.hour = (byte)serial_cmd_rcv.substring(12,14).toInt();
  my_date_str.minute = (byte)serial_cmd_rcv.substring(15,17).toInt();
  my_date_str.second = (byte)serial_cmd_rcv.substring(18).toInt();

  rtc.setYear(my_date_str.year);
  rtc.setMonth(my_date_str.month);
  rtc.setDate(my_date_str.day);
  rtc.setHour(my_date_str.hour);
  rtc.setMinute(my_date_str.minute);
  rtc.setSecond(my_date_str.second);
 
  serial_cmd_rcv = "";

  Serial.println("setting is ending!");
}

static bool GetEdgeP(bool cur,bool old)  {return (cur & !old);}
static bool bOpen,bClose;

void setup() {
  // put your setup code here, to run once:
  // Start the I2C interface
  Wire.begin(SDA_PIN,SCL_PIN,40000);
 
  // Setup Serial connection
  Serial.begin(115200);
 
  pinMode(RLY1_PIN,OUTPUT);
  pinMode(RLY2_PIN,OUTPUT);
 
  // Set 12/24h mode. True is 12-h, false is 24-hour.
  rtc.setClockMode(false);////24h

  PrintfCurTime();

  while(Serial.read()>=0){}

}

void loop() {
  // put your main code here, to run repeatedly:
  
  GetSerialCmd();
 
  bOpen = CompareOpenDate();
  bClose = CompareCloseDate();
  if(GetEdgeP(bOpen,old_level_high)) digitalWrite(RLY1_PIN,HIGH);
  if(GetEdgeP(bClose,old_level_low)) digitalWrite(RLY1_PIN,LOW);


  old_level_high = bOpen;
  old_level_low = bClose;
  //delay (1000);
 
}
source code download ZIP file: 
.zip   DS3231TST-20240428.zip (Size: 1.53 KB / Downloads: 497)
before use code need install DS3231 arduino library firstly.
   
download firmware by arduino IDE: 
   
serial port by USB 115200bps
set date and time command example: D2024-04-28T11:50:22
print current date and time: current time
   
   

because it's not easy to battery by air plane, so if you want timer work when power off, you can install the CR1220 on KC868-ASR PCB bottom side.
   
   

Print this item

  AK not connecting to controller
Posted by: mutaz - 04-28-2024, 03:23 AM - Forum: KC868-AK - Replies (19)

Hi

My AK board is not connecting to controller. Only one light red showing. It was working before but suddenly stop.
I tried to use a different AK to the same controller but also didn't work.

What should I do?

Print this item

Exclamation No Response
Posted by: Vaughan2024 - 04-27-2024, 08:54 AM - Forum: KC868-A series and Uair Smart Controller - Replies (3)

I have a KC868-A16S with the following code on it , After installing it it now will not respond,
the relays will only activate via the on board push button not via home assistant interface?
Home assistant show the switch turn on but the board does nothing.

I there any suggestion why this is happing ?

Dose the code look ok and can I reset the board and reload the firmware.

Code:
esphome:
  name: esphome_io_board
  friendly_name: ESPHome IO Board

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:

# Example configuration entry
ota:
  safe_mode: true
  password: !sectet ota_password

# Example configuration entry for ESP32
i2c:
  sda: 4
  scl: 5
  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.3
    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: 0x24

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

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

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

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

  - platform: gpio
    name: "relay2"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true
    
  - platform: gpio
    name: "relay3"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true
    
  - platform: gpio
    name: "relay4"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true
    
  - platform: gpio
    name: "relay5"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true
    
  - platform: gpio
    name: "relay6"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "relay7"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true
    
  - platform: gpio
    name: "relay8"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "relay9"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 8
      mode: OUTPUT
      inverted: true
    
  - platform: gpio
    name: "relay10"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 9
      mode: OUTPUT
      inverted: true
 
  - platform: gpio
    name: "relay11"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "relay12"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 11
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "relay13"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "relay14"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "relay15"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "relay16"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 15
      mode: OUTPUT
      inverted: true                             

binary_sensor:
  - platform: gpio
    name: "input1"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: false

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

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

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

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

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

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

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

  - platform: gpio
    name: "input9"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 8
      mode: INPUT
      inverted: false

  - platform: gpio
    name: "input10"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 9
      mode: INPUT
      inverted: false

  - platform: gpio
    name: "input11"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 10
      mode: INPUT
      inverted: false

  - platform: gpio
    name: "input12"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 11
      mode: INPUT
      inverted: false

  - platform: gpio
    name: "input13"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 12
      mode: INPUT
      inverted: false

  - platform: gpio
    name: "input14"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 13
      mode: INPUT
      inverted: false

  - platform: gpio
    name: "input15"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 14
      mode: INPUT
      inverted: false

  - platform: gpio
    name: "input16"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 15
      mode: INPUT
      inverted: false

Print this item

  KC868-A4 Bluetooth momentary Switch
Posted by: franco.demei@gmail.com - 04-27-2024, 08:39 AM - Forum: KC868-A4 - Replies (3)

I'm trying to program four momentary switch via bluetooth commands. I don't understand why I can't enable  "Relay3".
To compile KC868-A4 code I'm using "Arduino IDE". To program Android code  "MIT App Inventory" .
 Here is the codes I Used.  Can some one help me to understand where is a mistake ? Tank You.

AI Code     

Arduino IDE Code:

#include "BluetoothSerial.h"
BluetoothSerial SerialBT; // RX | TX
int Relay1 = 2;
int Relay2 = 5;
int Relay3 = 15;
int Relay4 = 4;
void setup() {
  pinMode(Relay1, OUTPUT);
  pinMode(Relay2, OUTPUT);
  pinMode(Relay3, OUTPUT);
  pinMode(Relay4, OUTPUT);
 
  Serial.begin(19200);   // Serial monitor
  SerialBT.begin(19200); // Bluetooth serial communication
 
  Serial.println("Bluetooth Control for KC868-A4 Relays");
}
void loop() {
  if (SerialBT.available()) {
    char command = SerialBT.read();
   
    // Command format: '1' to '4' for relays 1 to 4
    if (command >= '1' && command <= '4') {
      int relay = command - '1' + 2; // Calculate the relay control pin
         
      digitalWrite(relay, !digitalRead(relay));
   
      Serial.print("Relay ");
      Serial.print(command);
      Serial.print(" is ");
      Serial.println(digitalRead(relay) ? "ON" : "OFF");
    }
  }
}

Print this item

  Flux Sensor
Posted by: diegover - 04-25-2024, 06:24 PM - Forum: News - Replies (1)

Hello, 


I can use a flux sensor in KC868-A16S in ports AI1-AI4?

I think sensor use pulses.


Thanks

Print this item

  Develop on my own question
Posted by: mottibz - 04-25-2024, 01:36 PM - Forum: KC868-AG / AG Pro / AG8 / Z1 - Replies (3)

Hello, I am an IoT Maker and I would like to ask regarding the KC868-AG IR Controller:
1. What software do I get with the device when I purchase it?
2. Does the software come in source code? I am asking this as I would like to develop my own code for the device (extend its capabilities)
3. Is there a version of the device with just only its IR capabilities (no need for RF433) for a reduced price? I only need its IR capabilities to control my AC and other IR controlled devices at home
Thanks a lot!

Print this item

  Screws to lock the board on the back of the box
Posted by: Domdsq - 04-25-2024, 10:27 AM - Forum: KC868-A16 - Replies (8)

Hi everyone, I need to know which screws to buy to be able to fix the card directly to the back of the box (as indicated in the photo). I need to remove the front part of the box because in the European control panel the default box does not fit, it does not allow it to be closed correctly, so I have to find the correct screws to be able to do it. I attach photos. Thank you
[Image: photo-2024-04-25-12-26-04.jpg]

Print this item

  Smart lighting project - DIY software
Posted by: JackT99 - 04-21-2024, 11:53 AM - Forum: DIY Project - Replies (26)

Hi Kincony,

I am building a new house and looking to use Kincony products to control lighting only. Well, maybe some aspects of security as well.

Differences from a usual case are:
1. Not interested in any existing home automation software, I want to write my own software in Arduino to do specific tasks only.
2. Not interested in things like Wifi control, phone apps etc etc. Mostly for it to work standalone.
3. Also not interested in 4G, voice controls etc etc.

I want to use wireless light switches only, for my own reasons. They can be Zigbee or RF433 from what I see sold on Aliexpress. I would like to have them talk to one central wireless hub that either talks to the central controller or is a central controller itself. 
Estimating <32 line outputs for lights, so probably using something like 2x KC868-E16V2 would work?

Can you recommend a suitable Kincony product(s) for this case and are there enough examples on how to work with Zigbee or RF433 and Kincony?

Many thanks,
Jack

Print this item

  Issue with KC868-AIO-EXTAO--V1.2
Posted by: mahafree - 04-20-2024, 02:16 PM - Forum: KC868-AIO - Replies (9)

Hello,
Since a few days I have been having problems with the analog outputs on my KC868-AIO. (KC868-AIO-EXTAO--V1.2)
channels 1 to 6 work normally
Channels 7 and 8 are off and no longer respond to anything. (the LEDs on the PCB are also off. With a voltmeter I measure 0V on the output)
channel 9 works normally.
Channels 10 and 11 are off and no longer respond to anything. (the LEDs on the PCB burn at 100%. With a voltmeter I measure 11.72V on the output)
When other channels are at 100% I measure 10.2V on the output.
channels 12 to 16 work normally.
When I disconnect all outputs, the above remains the same.
All other inputs and outputs work normally.

I have no idea what happened.
My configuration has not changed.
All outputs are connected to the exact same type of dimmers.

What else can I test?
Is there something wrong with the "KC868-AIO-EXTAO--V1.2" board?

Thank you in advance!
   
   

Print this item