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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 4,482
» Latest member: hireforacademic
» Forum threads: 2,284
» Forum posts: 11,877

Full Statistics

Online Users
There are currently 44 online users.
» 1 Member(s) | 27 Guest(s)
Crawl, Facebook, Google, PetalBot, Semrush, bot, facebookexternalhit, owler

Latest Threads
a16 as basis for a securi...
Forum: KC868-A16
Last Post: admin
1 hour ago
» Replies: 8
» Views: 46
Usar entradas y oled i2c ...
Forum: KC868-A6
Last Post: admin
1 hour ago
» Replies: 3
» Views: 7
GSM CALL RELAY
Forum: KC868-A2
Last Post: admin
1 hour ago
» Replies: 9
» Views: 4,101
KC868-A16S or KC868-A8S
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
1 hour ago
» Replies: 3
» Views: 31
KC868-AG RF - sending rep...
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
1 hour ago
» Replies: 2
» Views: 3
KCS firmware
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
1 hour ago
» Replies: 10
» Views: 95
[Arduino IDE demo source ...
Forum: KC868-A6
Last Post: sistemasyusa
Yesterday, 09:03 AM
» Replies: 8
» Views: 4,563
Problem with DS1307 on KC...
Forum: KC868-A6
Last Post: sistemasyusa
Yesterday, 08:25 AM
» Replies: 18
» Views: 188
KC868-M16v2 configure yam...
Forum: KC868-M16 / M1 / MB / M30
Last Post: admin
Yesterday, 02:04 AM
» Replies: 24
» Views: 2,286
Sensor inputs
Forum: KinCony Server-Mini / Server-16 Raspberry Pi4 relay module
Last Post: admin
Yesterday, 12:34 AM
» Replies: 1
» Views: 12

  output turns off automaticly
Posted by: deibar - 05-06-2024, 06:34 PM - Forum: KC868-A series and Uair Smart Controller - Replies (1)

Hello, I have two Kincony A16 boards. Im using toggle buttons, but after some time output automatically turns off, and this happens with both Kincony boards with every output, wiring is good, what can be the reason? This how the code looks like:

esphome:
  name: esphome-web-af6e50
  friendly_name: Kincony2

esp32:
  board: esp32dev
  framework:
    type: arduino

# Example configuration entry for ESP32
i2c:
  sda: 4
  scl: 5
  scan: true
  id: bus_a

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "pbLoAOpRUI49e65b0pCUrVShaclU3bM38vlGfnNQ9YY="

ota:


wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-Af6E50"
    password: "ajhfwy1kFdbc"

captive_portal:

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

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

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

  - id: 'pcf8574_input2'  # for input channel 9-16
    address: 0x21

esphome:
  name: esphome-web-b050e4
  friendly_name: Kincony1

esp32:
  board: esp32dev
  framework:
    type: arduino

# Example configuration entry for ESP32
i2c:
  sda: 4
  scl: 5
  scan: true
  id: bus_a

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "tBC8hXDhMHsgklwFmZerS9tVQP0p+6Qus3+OyUTj+Jo="

ota:


wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-B050E4"
    password: "SziFua377JQb"

captive_portal:

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

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

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

  - id: 'pcf8574_input2'  # for input channel 9-16
    address: 0x21

# Outputs
switch:
  - platform: gpio
    id: livingroom 
    name: "Living room "
    pin:
      pcf8574: pcf8574_output2
      number: 7
      mode: OUTPUT
      inverted: true

# Inputs
binary_sensor:
  - platform: gpio
    name: "Living room switch"
    pin:
      pcf8574: pcf8574_input1
      number: 0
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: livingroom

Print this item

  Tuya adapter V2 arduino source code - RS485 temperature humidity sensor
Posted by: admin - 05-06-2024, 01:35 AM - Forum: KC868-ATC / Tuya adapter V2 - No Replies

let your own RS485 temperature and humidity sensor can work with Tuya app, so that can remote monitor sensor data and make AUTOMATION by Tuya app via internet.
   
         
   
arduino source code donwload: 
.zip   Tuya_AdapterV2_RS485_Temper_Hum.zip (Size: 1.98 KB / Downloads: 58)

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 SERIAL_NUM  2
#define SLAVE_ADDR  1
#define READ_ADDR  0
#define READ_NUM   2 

HardwareSerial My485Serial(SERIAL_NUM);
ModbusMaster node;
uint16_t rcv_buf[READ_NUM] = {0};
float get_value[2] = {0.0};

/* Current device DP values */
int temperature = 0;
int humidity = 0;

static void ReadInputRegs(void)
{
  uint8_t result = node.readInputRegisters(READ_ADDR, READ_NUM);
  if (result == node.ku8MBSuccess) {//if communicate successful then
    #if DEBUG
    Serial1.print("Result:"); 
    #endif
   
    for (uint8_t j = 0; j < READ_NUM; j++)
    {
      rcv_buf[j] = node.getResponseBuffer(j);
      #if 0 ///just for debug.
      Serial1.print(" 0x");
      Serial1.print( rcv_buf[j], HEX );//display data in hex.
      #endif
    }
    get_value[0] = rcv_buf[0]/10;///huminity
    get_value[1] = rcv_buf[1]/10;///temperature

    temperature = rcv_buf[0];
    humidity = get_value[1];
   
    #if DEBUG
    Serial1.print("humi.<"); 
    Serial1.print(get_value[1]);
    Serial1.print("%>");
    Serial1.print(" temp.<"); 
    Serial1.print(get_value[0]);
    Serial1.println("°c>");
    #endif

    //delay(300);
  }
  else
  {
    node.clearResponseBuffer();
  }
}

//---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 */
#define DPID_TEMP_CURRENT     1
#define DPID_HUMIDITY_CURRENT 2

#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_TEMP_CURRENT, DP_TYPE_VALUE},
  {DPID_HUMIDITY_CURRENT, DP_TYPE_VALUE},
};

unsigned char pid[] = {"dpyditdgaadmqw8m"};
unsigned char mcu_ver[] = {"1.0.0"};

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

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()
{
  ReadInputRegs();  // 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)) {
    my_device.mcu_dp_update(DPID_TEMP_CURRENT, temperature, 1);
    my_device.mcu_dp_update(DPID_HUMIDITY_CURRENT, humidity, 1);
  }

  delay(1000);
}

/**
* @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)
{
  /* all DP only report */
  return TY_SUCCESS;
}

/**
* @description: Upload all DP status of the current device.
* @param {*}
* @return {*}
*/
void dp_update_all(void)
{
  my_device.mcu_dp_update(DPID_TEMP_CURRENT, temperature, 1);
  my_device.mcu_dp_update(DPID_HUMIDITY_CURRENT, humidity, 1);
}

Print this item

  KC868-A32 relay board Loxone integration
Posted by: IoP1984 - 05-04-2024, 01:08 PM - Forum: KC868-A32/A32 Pro - Replies (1)

Hi!

What is the easiest way to integrate the A32 board into the Loxone system? If there are multiple methods, what are my options?

Print this item

  COL + rs485 meter
Posted by: athxp - 05-02-2024, 08:51 PM - Forum: KC868-HxB series Smart Controller - Replies (3)

HI,
I have a Kincony RS-484 meter. I would like to use it to monitor a photovoltaic system and carry out automations with COL.
we are talking about around 6000-6500w of power and currents around 30A. will the meter have problems?
Furthermore, can I program COL using the simple IFTTT rules linked to the meter measurements?
 thanks

Print this item

  KC868-A4S Analog Inputs
Posted by: DabblerIOT - 05-02-2024, 07:36 PM - Forum: Development - Replies (2)

Hi.   Sorting out analog inputs using esp32home. Thank you for any response, board working well.

Using this right now..

- platform: adc
    pin: 36
    name: "ADC-IN1"
    update_interval: 5s
    attenuation: 11db
    filters:
      - lambda: if (x <= 0.15) { return 0; } return x * 1.51;

Several questions:
(1) I saw some example code posted to this forum where about x of 3.1 it used a higher multiplier. Why? This code is going to cause a large increase in output value at 3.111 x. Would a better approach be to read ground and vcc to the esp, and then scale your input readings according to those two readings using those values as 0 and 100% of input span? (0-3.3 after the voltage divider, or 0-5v at the input terminal).

(2) If I want to read a 10k ntc thermistor, it looks like a voltage divider, of 5.1k/10k is already there on the input... so if I power a 10k ntc thermistor with 3.3 volts, wouldn't I be essentially just adding the resistance value of my thermistor onto the 5.1k on-board resistor? (Allowing me to subtract 5.1k from the read value, and then normalizing my reading using the on-board code). My voltage isn't what I expect if this were true. (I am not an expert on the electronics side). Just enough to be dangerous.

Code was here.
https://www.kincony.com/forum/showthread...hlight=adc
sensor:
- platform: adc
pin: 36
name: "A8S A1 Voltage"
update_interval: 5s
attenuation: 11db
filters:
- lambda:
if (x >= 3.11) {
return x * 1.60256;
} else if (x <= 0.15) {
return 0;
} else {
return x * 1.51;
}

Print this item

  KC868 A4 for education
Posted by: Sidboudk - 05-01-2024, 06:33 PM - Forum: Apply for free sample product - No Replies

I'm requesting a KC868-A4 equipment for educational purpos. I'm associated professor at Evry-paris saclay university and we want to teach our students microcontroller programming and basic concepts of electricity and electronics.

Print this item

  E16T IFTTT Limit and Logs
Posted by: ByteCrusader22 - 04-30-2024, 05:08 AM - Forum: "KCS" firmware system - Replies (1)

Hello, 


I'm currently running E16T using E16S KCS Firmware and linked to Tuya APP


1. Is there a limit to how many IFTTT automations can be run on E16T using KCS firmware without running into memory issues and causing instability?
2. Can IFTTT and Tuya automations be run at the same time? If so which will override the other if there are clashes.
3. ⁠Is it possible to check the memory utilisation using the KCS firmware?
4. ⁠Can the device post logs to external databases using IFTTT?

Print this item

  Wiring diagram KC868-A16
Posted by: Brouk - 04-29-2024, 08:33 PM - Forum: KC868-A16 - Replies (3)

Hello to everybody,
I am planning to buy the module "KC868-A16" to connect with Home Assistant with NodeRed. For proper connection, I need a wiring harness (di. inputs, di. outputs, DS18B20 temperature sensors, etc. Can you please provide me with a wiring diagram?

Print this item

  KC868-A2 and SIM7600G-H
Posted by: jpinto97 - 04-28-2024, 10:52 PM - Forum: KC868-A2 - Replies (1)

Hello, what are the pins to connect a sim7600g-h module to the KC868-A2-V2.4 board?

Print this item

  Digital Inputs with 2.2K ohm resistor
Posted by: bruces - 04-28-2024, 04:32 PM - Forum: KC868-AI - Replies (3)

So I need to know if i were to connect a DI to ground through a 2200 ohm resistor would the input trip.
I am trying to replace an old security system and all of the inputs have two states, open circuit or 2200 ohm in the line.
I would just remove the 2200 ohm resistor but most of them are not accessible.

Print this item