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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,210
» Latest member: guycaluwaerts
» Forum threads: 3,596
» Forum posts: 18,528

Full Statistics

Online Users
There are currently 40 online users.
» 0 Member(s) | 27 Guest(s)
AhrefsBot, Amazonbot, Applebot, Bing, Crawl, PetalBot, bot

Latest Threads
Pinout od AS Voice Assist...
Forum: KinCony AS
Last Post: ZodInLynn
9 hours ago
» Replies: 0
» Views: 9
KC868-A16 HTTP request co...
Forum: KC868-A16
Last Post: admin
11 hours ago
» Replies: 5
» Views: 36
Can the usb-c port be use...
Forum: F24
Last Post: admin
Today, 09:41 AM
» Replies: 3
» Views: 25
KC868-COLB Tuya Integrati...
Forum: Development
Last Post: admin
Today, 03:51 AM
» Replies: 9
» Views: 45
[Arduino IDE demo source ...
Forum: KC868-A16
Last Post: admin
Yesterday, 11:40 PM
» Replies: 16
» Views: 9,227
KC868-A2 SIM7600 with Tuy...
Forum: KC868-A2
Last Post: admin
Yesterday, 11:34 PM
» Replies: 29
» Views: 2,881
"KCS" v2 firmware MQTT pr...
Forum: "KCS" v2 firmware system
Last Post: admin
Yesterday, 11:33 PM
» Replies: 28
» Views: 9,732
PCF8574 INT pin on KC868-...
Forum: KC868-A6
Last Post: admin
Yesterday, 07:50 AM
» Replies: 3
» Views: 25
flash kc868-a4
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
Yesterday, 01:00 AM
» Replies: 7
» Views: 123
N30 installation for Home...
Forum: N30
Last Post: admin
12-05-2025, 09:07 AM
» Replies: 5
» Views: 47

  [arduino code examples for DM16]-04 RS485 communication test
Posted by: admin - 09-09-2025, 02:59 AM - Forum: DM16 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* RS485 Communication Test
*
* This program is a simple test for RS485 communication using ESP32-S3.
* It will send a message over RS485 and then read incoming messages.
* The TXD pin is defined as GPIO 18 and RXD pin is defined as GPIO 8.
*/

#include <HardwareSerial.h>

// Define RS485 pins
#define RS485_RXD 38
#define RS485_TXD 39

// Create a hardware serial object
HardwareSerial rs485Serial(1);

void setup() {
  // Start serial communication for debugging
  Serial.begin(115200);
  while (!Serial);

  // Initialize RS485 Serial communication
  rs485Serial.begin(9600, SERIAL_8N1, RS485_RXD, RS485_TXD);
 
  Serial.println("RS485 Test Start");
}

void loop() {
  // Send a test message
  rs485Serial.println("Hello from KinCony B16!");

  // Wait for a short period
  delay(1000);

  // Check if data is available to read
  if (rs485Serial.available()) {
    String receivedMessage = "";
    while (rs485Serial.available()) {
      char c = rs485Serial.read();
      receivedMessage += c;
    }
    // Print the received message
    Serial.print("Received: ");
    Serial.println(receivedMessage);
  }

  // Wait before sending the next message
  delay(2000);
}
arduino ino file download:

.zip   4-RS485-Test.zip (Size: 763 bytes / Downloads: 177)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: 

.zip   4-RS485-Test.ino.merged.zip (Size: 184.34 KB / Downloads: 205)

Print this item

  [arduino code examples for DM16]-03 Read ADS1115 analog input ports value
Posted by: admin - 09-09-2025, 02:53 AM - Forum: DM16 - No Replies

Code:
/*
* This program reads voltage values from the ADS1115 analog-to-digital converter
* on all four channels (A0, A1, A2, A3) and prints the results through the serial port.
* The ADS1115 communicates via the I2C protocol. This version of the code includes
* the capability to specify custom SDA and SCL pins for I2C communication.
*
* Copyright: Made by KinCony IoT: https://www.kincony.com
*
*/

#include <Wire.h>                // Library for I2C communication
#include <DFRobot_ADS1115.h>     // Library for ADS1115 ADC module

// Define the I2C SDA and SCL pins for communication with ADS1115
#define SDA_PIN 8 
#define SCL_PIN 18

// Initialize ADS1115 instance using the Wire library
DFRobot_ADS1115 ads(&Wire);

void setup(void)
{
    // Begin serial communication at a baud rate of 115200
    Serial.begin(115200);

    // Initialize the I2C bus using the defined SDA and SCL pins
    Wire.begin(SDA_PIN, SCL_PIN);

    // Set the I2C address for the ADS1115 (default: 0x49)
    ads.setAddr_ADS1115(ADS1115_IIC_ADDRESS0);   // Address is 0x49

    // Set the gain for the ADS1115 (2/3x gain allows for a maximum input voltage of 6.144V)
    ads.setGain(eGAIN_TWOTHIRDS);

    // Set the ADS1115 to operate in single-shot mode (each reading is a single conversion)
    ads.setMode(eMODE_SINGLE);

    // Set the sample rate to 128 samples per second (SPS)
    ads.setRate(eRATE_128);

    // Set the operational status mode to single-conversion start
    ads.setOSMode(eOSMODE_SINGLE);

    // Initialize the ADS1115 module
    ads.init();
}

void loop(void)
{
    // Check if the ADS1115 is properly connected and functioning
    if (ads.checkADS1115())
    {
        // Variables to store the voltage readings for each channel
        int16_t adc0, adc1, adc2, adc3;

        // Read the voltage from channel A0 and print the value
        adc0 = ads.readVoltage(0);
        Serial.print("A0:");
        Serial.print(adc0);
        Serial.print("mV,  ");    // Print the value in millivolts

        // Read the voltage from channel A1 and print the value
        adc1 = ads.readVoltage(1);
        Serial.print("A1:");
        Serial.print(adc1);
        Serial.print("mV,  ");    // Print the value in millivolts

        // Read the voltage from channel A2 and print the value
        adc2 = ads.readVoltage(2);
        Serial.print("A2:");
        Serial.print(adc2);
        Serial.print("mV,  ");    // Print the value in millivolts

        // Read the voltage from channel A3 and print the value
        adc3 = ads.readVoltage(3);
        Serial.print("A3:");
        Serial.print(adc3);
        Serial.println("mV");     // Print the value in millivolts and end the line
    }
    else
    {
        // If ADS1115 is not connected, print a message indicating disconnection
        Serial.println("ADS1115 Disconnected!");
    }

    // Wait for 1 second before the next loop iteration
    delay(1000);
}
arduino ino file download:

.zip   3-ads1115_adc.zip (Size: 1.2 KB / Downloads: 161)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: 

.zip   3-ads1115_adc.ino.merged.zip (Size: 190.05 KB / Downloads: 173)

Print this item

  [arduino code examples for DM16]-02 Read digital input ports state
Posted by: admin - 09-09-2025, 02:51 AM - Forum: DM16 - No Replies

Code:
/*
* -----------------------------------------------------------------------------
* KinCony DM16 16-Channel Digital Input Reader using PCF8575
*
* This Arduino sketch reads the state of 16 digital input channels from a
* PCF8575 I/O expander over I2C and prints their status to the serial monitor.
*
* Input logic:
*   - Input 0 = ON
*   - Input 1 = OFF (with pull-up logic)
*
* Hardware:
*   - PCF8575 I/O Expander (I2C Address: 0x22)
*   - Custom input pin mapping as defined below
*   - I2C SDA pin: GPIO8
*   - I2C SCL pin: GPIO18
*
* Author: KinCony IoT
* Website: https://www.kincony.com
* License: MIT License
* -----------------------------------------------------------------------------
*/

#include <Wire.h>
#include "PCF8575.h"

// Define I2C pins
#define I2C_SDA 8   // SDA pin
#define I2C_SCL 18  // SCL pin

// Set the I2C address for PCF8575
PCF8575 pcf8575_IN1(0x22); // 0x22 is the I2C address for the DM16 module

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

    // Initialize I2C with specified SDA and SCL pins
    Wire.begin(I2C_SDA, I2C_SCL);

    // Start communication with PCF8575 device
    pcf8575_IN1.begin();

    Serial.println("KinCony DM16 16 channel input state 0:ON  1:OFF");
}

void loop() {
    // Define custom pin read order to match hardware mapping
    uint8_t pin_order[16] = {
        8, 9, 10, 11, 12, 13, 14, 15,
        0, 1, 2, 3, 4, 5, 6, 7
    };

    Serial.print("Input state: ");

    // Loop through all 16 pins and read their state
    for (int i = 0; i < 16; i++) {
        bool state = pcf8575_IN1.read(pin_order[i]); // Read pin state (HIGH or LOW)
        Serial.print(state); // Print state: 0 = ON, 1 = OFF
        Serial.print(" ");
    }

    Serial.println(); // Print new line
    delay(500);       // Wait for 500ms before next read
}
arduino ino file download:

.zip   2-digital-input.zip (Size: 995 bytes / Downloads: 172)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download: 

.zip   2-digital-input.ino.merged.zip (Size: 192.34 KB / Downloads: 166)

Print this item

  [arduino code examples for DM16]-01 16 Channel DAC output by digital input
Posted by: admin - 09-09-2025, 02:49 AM - Forum: DM16 - No Replies

Code:
/*
* ----------------------------------------------------------------------------
* Copyright (c) 2025 KinCony IoT
*
* ----------------------------------------------------------------------------
*/

#include <Adafruit_PCF8575.h>
#include <HardwareSerial.h>

// Define Modbus RTU frame format constants
#define MODBUS_READ_COILS 0x01
#define MODBUS_READ_REGISTERS 0x03
#define MODBUS_WRITE_SINGLE_REGISTER 0x06
#define MODBUS_WRITE_MULTIPLE_REGISTERS 0x10

/* Example for 16 input buttons that are connected from the GPIO expander pins to ground.
* Note: The buttons must be connected with the other side of the switch to GROUND.
* There is a built-in pull-up resistor on each input, but no pull-down resistor capability.
*/
#define SDA_PIN 8
#define SCL_PIN 18
#define ADDRESS_PCF8575 0x22

#define ST_RX   4 //// ESP32 receive pin
#define ST_TX   6 //// ESP32 send pin
typedef enum {KEY_RELEASE=0, KEY_SHORT_PRESSED, KEY_LONG_PRESSED} KEY_STATUS;

typedef struct {
  uint8_t key_index;
  KEY_STATUS key_status;
  long key_time_start;
  long key_time_rec;
  long key_press_time;
  int16_t key_press_cnt;    //// Send serial data every 100ms
  int16_t key_press_cnt_old;
  float current_light;      /// Percentage of 0-4095
} KEY_PRESS_PROP;

KEY_PRESS_PROP key_press_prop[16] = {0};

Adafruit_PCF8575 pcf;
HardwareSerial myst_serial(1);

TwoWire myI2c = TwoWire(0);

// Modbus CRC16 calculation function
uint16_t modbus_crc16(uint8_t *data, uint16_t length) {
  uint16_t crc = 0xFFFF;
 
  for (uint16_t i = 0; i < length; i++) {
    crc ^= data[i];
    for (uint8_t j = 0; j < 8; j++) {
      if (crc & 0x0001) {
        crc = (crc >> 1) ^ 0xA001;
      } else {
        crc = crc >> 1;
      }
    }
  }
  return crc;
}

/**
* Send Modbus RTU frame
*
* @param serial HardwareSerial object
* @param address Slave address (1-247)
* @param function Function code
* @param data Data section
* @param dataLen Data length
*/
void send_modbus_frame(HardwareSerial &serial, uint8_t address, uint8_t function,
                      const uint8_t *data, uint16_t dataLen) {
  // Create send buffer
  uint16_t totalLen = 1 + 1 + dataLen + 2; // Address + Function code + Data + CRC
  uint8_t buffer[totalLen];
 
  // Fill address and function code
  buffer[0] = address;
  buffer[1] = function;
 
  // Copy data
  memcpy(&buffer[2], data, dataLen);
 
  // Calculate CRC (excluding CRC section)
  uint16_t crc = modbus_crc16(buffer, 2 + dataLen);
 
  // Add CRC (little-endian: low byte first)
  buffer[2 + dataLen] = crc & 0xFF;         // CRC low byte
  buffer[3 + dataLen] = (crc >> 8) & 0xFF;  // CRC high byte
 
  // Send complete frame
  for (uint16_t i = 0; i < totalLen; i++) {
    serial.write(buffer[i]);
  }
 
  // Flush send buffer to ensure all data is sent
  serial.flush();
}

// Encapsulation of common Modbus functions

/**
* Send "Read Holding Registers" request
*
* @param serial HardwareSerial object
* @param address Slave address
* @param startReg Start register address
* @param numRegs Number of registers to read
*/
void modbus_read_registers(HardwareSerial &serial, uint8_t address,
                          uint16_t startReg, uint16_t numRegs) {
  uint8_t data[4];
 
  // Fill register address and quantity in big-endian
  data[0] = (startReg >> 8) & 0x
arduino ino file download:

.zip   1-dac-16ch.zip (Size: 1.47 KB / Downloads: 178)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:

.zip   1-dac-16ch.ino.merged.zip (Size: 205.57 KB / Downloads: 176)

Print this item

  DM16 ESPHome yaml for home assistant with tuya
Posted by: admin - 09-09-2025, 02:39 AM - Forum: DM16 - No Replies

Code:
esphome:
  name: dm16
  friendly_name: dm16
  platformio_options:
    board_build.extra_flags:
      # WIFI_CONTROL_SELF_MODE = 0
      # WIFI_CONTROL_SELF_MODE = 1
      - "-DWIFI_CONTROL_SELF_MODE=1"

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino

external_components:
  - source:
      type: git
      url: https://github.com/hzkincony/esphome-tuya-wifi-mcu
      ref: v1.2.0

# Enable logging
logger:
  baud_rate: 0
  hardware_uart: UART0

# Enable Home Assistant API
api:

ota:
  platform: esphome

web_server:
  port: 80

ethernet:
  type: W5500
  clk_pin: GPIO1
  mosi_pin: GPIO2
  miso_pin: GPIO41
  cs_pin: GPIO42
  interrupt_pin: GPIO43
  reset_pin: GPIO44

i2c:
   - id: bus_a
     sda: 8
     scl: 18
     scan: true
     frequency: 400kHz
     
text_sensor:
  - platform: ethernet_info
    ip_address:
      name: ESP IP Address
      id: eth_ip
      address_0:
        name: ESP IP Address 0
      address_1:
        name: ESP IP Address 1
      address_2:
        name: ESP IP Address 2
      address_3:
        name: ESP IP Address 3
      address_4:
        name: ESP IP Address 4
    dns_address:
      name: ESP DNS Address
    mac_address:
      name: ESP MAC Address

font:
  - file: "gfonts://Roboto"
    id: roboto
    size: 15

display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    address: 0x3C
    lambda: |-
      it.printf(0, 15, id(roboto), "IP: %s", id(eth_ip).state.c_str());
uart:
  - id: dac_uart
    rx_pin: 4
    tx_pin: 6
    baud_rate: 115200
    stop_bits: 1
    data_bits: 8
    parity: NONE
  - id: tuya_mcu_uart 
    tx_pin: 16
    rx_pin: 17
    baud_rate: 9600

tuya_wifi_mcu:
  # tuya mcu product id
  product_id: qdmpkznox0g9kkvo
  uart_id: tuya_mcu_uart
  wifi_reset_pin: 28
  wifi_led_pin: 16

modbus:
  - uart_id: dac_uart

modbus_controller:
  - address: 1
    update_interval: 5s

output:
  # CH1 (0x0FA0 / 4000)
  - platform: modbus_controller
    id: dac_ch1_out
    address: 0x0FA0
    value_type: U_WORD
    write_lambda: |-
      // state = 0.0 ~ 1.0 → 0 ~ 4095
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH2 (0x0FA1 / 4001)
  - platform: modbus_controller
    id: dac_ch2_out
    address: 0x0FA1
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH3
  - platform: modbus_controller
    id: dac_ch3_out
    address: 0x0FA2
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH4
  - platform: modbus_controller
    id: dac_ch4_out
    address: 0x0FA3
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH5
  - platform: modbus_controller
    id: dac_ch5_out
    address: 0x0FA4
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH6
  - platform: modbus_controller
    id: dac_ch6_out
    address: 0x0FA5
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH7
  - platform: modbus_controller
    id: dac_ch7_out
    address: 0x0FA6
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH8
  - platform: modbus_controller
    id: dac_ch8_out
    address: 0x0FA7
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH9
  - platform: modbus_controller
    id: dac_ch9_out
    address: 0x0FA8
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH10
  - platform: modbus_controller
    id: dac_ch10_out
    address: 0x0FA9
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH11
  - platform: modbus_controller
    id: dac_ch11_out
    address: 0x0FAA
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH12
  - platform: modbus_controller
    id: dac_ch12_out
    address: 0x0FAB
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH13
  - platform: modbus_controller
    id: dac_ch13_out
    address: 0x0FAC
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH14
  - platform: modbus_controller
    id: dac_ch14_out
    address: 0x0FAD
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH15
  - platform: modbus_controller
    id: dac_ch15_out
    address: 0x0FAE
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH16
  - platform: modbus_controller
    id: dac_ch16_out
    address: 0x0FAF
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

# -------------------
# 16 路 Light (调光灯)
# -------------------
light:
  - platform: monochromatic
    name: "DAC CH1"
    output: dac_ch1_out
    id: light_1
    default_transition_length: 0s
 
  - platform: tuya_wifi_mcu
    name: "Tuya DAC CH1"
    # bind other light, sync state
    bind_light_id: light_1
    output: dac_ch1_out
    dp_id: 2
    # hide from homeassistant ui
    internal: true

  - platform: monochromatic
    name: "DAC CH2"
    output: dac_ch2_out
    id: light_2
    default_transition_length: 0s
 
  - platform: tuya_wifi_mcu
    name: "Tuya DAC CH2"
    # bind other light, sync state
    bind_light_id: light_2
    output: dac_ch2_out
    dp_id: 8
    # hide from homeassistant ui
    internal: true

  - platform: monochromatic
    name: "DAC CH3"
    output: dac_ch3_out
    id: light_3
    default_transition_length: 0s

  - platform: tuya_wifi_mcu
    name: "Tuya DAC CH3"
    # bind other light, sync state
    bind_light_id: light_3
    output: dac_ch3_out
    dp_id: 16
    # hide from homeassistant ui
    internal: true

  - platform: monochromatic
    name: "DAC CH4"
    output: dac_ch4_out
    id: light_4
    default_transition_length: 0s
 
  - platform: tuya_wifi_mcu
    name: "Tuya DAC CH4"
    # bind other light, sync state
    bind_light_id: light_4
    output: dac_ch4_out
    dp_id: 101
    # hide from homeassistant ui
    internal: true

  - platform: monochromatic
    name: "DAC CH5"
    output: dac_ch5_out
    id: light_5
    default_transition_length: 0s

  - platform: tuya_wifi_mcu
    name: "Tuya DAC CH5"
    # bind other light, sync state
    bind_light_id: light_5
    output: dac_ch5_out
    dp_id: 102
    # hide from homeassistant ui
    internal: true

  - platform: monochromatic
    name: "DAC CH6"
    output: dac_ch6_out
    id: light_6
    default_transition_length: 0s

  - platform: tuya_wifi_mcu
    name: "Tuya DAC CH6"
    # bind other light, sync state
    bind_light_id: light_6
    output: dac_ch6_out
    dp_id: 103
    # hide from homeassistant ui
    internal: true

  - platform: monochromatic
    name: "DAC CH7"
    output: dac_ch7_out
    id: light_7
    default_transition_length: 0s
 
  - platform: tuya_wifi_mcu
    name: "Tuya DAC CH7"
    # bind other light, sync state
    bind_light_id: light_7
    output: dac_ch7_out
    dp_id: 104
    # hide from homeassistant ui
    internal: true

  - platform: monochromatic
    name: "DAC CH8"
    output: dac_ch8_out
    id: light_8
    default_transition_length: 0s
 
  - platform: tuya_wifi_mcu
    name: "Tuya DAC CH8"
    # bind other light, sync state
    bind_light_id: light_8
    output: dac_ch8_out
    dp_id: 105
    # hide from homeassistant ui
    internal: true

  - platform: monochromatic
    name: "DAC CH9"
    output: dac_ch9_out
    id: light_9
    default_transition_length: 0s
 
  - platform: tuya_wifi_mcu
    name: "Tuya DAC CH9"
    # bind other light, sync state
    bind_light_id: light_9
    output: dac_ch9_out
    dp_id: 106
    # hide from homeassistant ui
    internal: true

  - platform: monochromatic
    name: "DAC CH10"
    output: dac_ch10_out
    id: light_10
    default_transition_length: 0s

  - platform: tuya_wifi_mcu
    name: "Tuya DAC CH10"
    # bind other light, sync state
    bind_light_id: light_10
    output: dac_ch10_out
    dp_id: 107
    # hide from homeassistant ui
    internal: true

  - platform: monochromatic
    name: "DAC CH11"
    output: dac_ch11_out
    id: light_11
    default_transition_length: 0s
 
  - platform: tuya_wifi_mcu
    name: "Tuya DAC CH11"
    # bind other light, sync state
    bind_light_id: light_11
    output: dac_ch11_out
    dp_id: 108
    # hide from homeassistant ui
    internal: true

  - platform: monochromatic
    name: "DAC CH12"
    output: dac_ch12_out
    id: light_12
    default_transition_length: 0s

  - platform: tuya_wifi_mcu
    name: "Tuya DAC CH12"
    # bind other light, sync state
    bind_light_id: light_12
    output: dac_ch12_out
    dp_id: 109
    # hide from homeassistant ui
    internal: true

  - platform: monochromatic
    name: "DAC CH13"
    output: dac_ch13_out
    id: light_13
    default_transition_length: 0s

  - platform: tuya_wifi_mcu
    name: "Tuya DAC CH13"
    # bind other light, sync state
    bind_light_id: light_13
    output: dac_ch13_out
    dp_id: 110
    # hide from homeassistant ui
    internal: true

  - platform: monochromatic
    name: "DAC CH14"
    output: dac_ch14_out
    id: light_14
    default_transition_length: 0s

  - platform: tuya_wifi_mcu
    name: "Tuya DAC CH14"
    # bind other light, sync state
    bind_light_id: light_14
    output: dac_ch14_out
    dp_id: 111
    # hide from homeassistant ui
    internal: true

  - platform: monochromatic
    name: "DAC CH15"
    output: dac_ch15_out
    id: light_15
    default_transition_length: 0s
 
  - platform: tuya_wifi_mcu
    name: "Tuya DAC CH15"
    # bind other light, sync state
    bind_light_id: light_15
    output: dac_ch15_out
    dp_id: 112
    # hide from homeassistant ui
    internal: true

  - platform: monochromatic
    name: "DAC CH16"
    output: dac_ch16_out
    id: light_16
    default_transition_length: 0s
 
  - platform: tuya_wifi_mcu
    name: "Tuya DAC CH16"
    # bind other light, sync state
    bind_light_id: light_16
    output: dac_ch16_out
    dp_id: 113
    # hide from homeassistant ui
    internal: true



pcf8574:
  - id: 'pcf8574_hub_in_1'  # for input channel 1-16
    i2c_id: bus_a
    address: 0x22
    pcf8575: true

binary_sensor:
  - platform: gpio
    name: "dm16-input01"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 8
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input02"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 9
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input03"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 10
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input04"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 11
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input05"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 12
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input06"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 13
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input07"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 14
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input08"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 15
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input09"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input10"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input11"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input12"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input13"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input14"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input15"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input16"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true

ads1115:
  - address: 0x48
sensor:
  - platform: ads1115
    multiplexer: 'A0_GND'
    gain: 6.144
    resolution: 16_BITS
    name: "ADS1115 Channel A0-GND"
    update_interval: 5s
  - platform: ads1115
    multiplexer: 'A1_GND'
    gain: 6.144
    name: "ADS1115 Channel A1-GND"
    update_interval: 5s
  - platform: ads1115
    multiplexer: 'A2_GND'
    gain: 6.144
    name: "ADS1115 Channel A2-GND"
    update_interval: 5s
  - platform: ads1115
    multiplexer: 'A3_GND'
    gain: 6.144
    name: "ADS1115 Channel A3-GND"
    update_interval: 5s
esphome yaml file download:

.txt   DM16-HA-with-Tuya.txt (Size: 13.11 KB / Downloads: 86)

Print this item

  KinCony DM16 Smart Dimmer Controller released
Posted by: admin - 09-09-2025, 02:25 AM - Forum: News - No Replies

KinCony DM16 ESP32 smart dimmer controller based on ESP32-S3-WROOM-1U (N16R8) wifi chip. Support 16 channel DC 0-10v output, 7 channel 1-wire GPIOs, 4 channel ADS1115 16bit analog input ports. One SD card using SPI bus. DM16 include DS3231 high precision RTC clock chip. OLED display will show wifi and ethernet IP address and Tuya connection state. DM16 have 2pcs of RS485 port. one RS485 connect with ARM CPU, support use by modbus directly. Another RS485 work with ESP32. You can write any code by Arduino IDE / MicroPython / ESP-IDF development tool to ESP32 module. We will supply Arduino / ESP-IDF demo code for different samples. Everyone can modify and change the code for your own smart home automation system project. it support use by ESPHome for home assistant or tasmota firmware for smart home automation DIY. DM16 use KCS v3 firmware, it support home assistant auto discovery function by MQTT, so without write any config code (zero code) for home assistant. KCS v3 support KinCony cloud service (official shop customer free 2 years), remote monitor and control device by webpage in anywhere. KCS v3 support KinCony board integrate to Loxone Miniserver. Support Apple HomeKit for Siri.
[Image: DM16-1.jpg]
Model No. KinCony DM16
Description: KinCony 16 Channel ESP32-S3 Smart Dimmer Controller – DM16
Power supply: 12-24V DC
Processor: ESP32-S3-WROOM-1U (N16R8)
Size: 174mm*83mm*59mm
interfaces: Ethernet(RJ45)-LAN 100Mbps IPv4/IPv6,WiFi,RS485,Bluetooth,USB-C,OLED,Tuya Module
RTC: DS3231 high precision chip (battery socket on PCB)
SD Card: SPI bus
Installation method: DIN RAIL
OLED: SSD1306 I2C display
Outputs:
16CH 0-10v Outputs.
Inputs:
ADS1115 16bit ADC: 2CH analog input DC0-5V (A1,A2) 2CH analog input 4-20mA (A3,A4)
16CH dry contact inputs (optocoupler isolation, long distance circuit for MAX 500 meters cable)
4 buttons: 1:ESP32 Reset 2:ESP32 Download 3:Tuya config 4: ARM CPU Reset
1-Wire GPIO: 4CH (with pull-up resistance on PCB)
Free GPIO: 4CH (ESP32 pin directly, without pull-up resistance on PCB)
[Image: DM16-2.jpg]

Print this item

  DM16 ESPHome yaml for home assistant without tuya
Posted by: admin - 09-09-2025, 02:17 AM - Forum: DM16 - No Replies

Code:
esphome:
  name: dm16
  friendly_name: dm16

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  platform: esphome

web_server:
  port: 80

ethernet:
  type: W5500
  clk_pin: GPIO1
  mosi_pin: GPIO2
  miso_pin: GPIO41
  cs_pin: GPIO42
  interrupt_pin: GPIO43
  reset_pin: GPIO44

i2c:
   - id: bus_a
     sda: 8
     scl: 18
     scan: true
     frequency: 400kHz
     
text_sensor:
  - platform: ethernet_info
    ip_address:
      name: ESP IP Address
      id: eth_ip
      address_0:
        name: ESP IP Address 0
      address_1:
        name: ESP IP Address 1
      address_2:
        name: ESP IP Address 2
      address_3:
        name: ESP IP Address 3
      address_4:
        name: ESP IP Address 4
    dns_address:
      name: ESP DNS Address
    mac_address:
      name: ESP MAC Address

font:
  - file: "gfonts://Roboto"
    id: roboto
    size: 15

display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    address: 0x3C
    lambda: |-
      it.printf(0, 15, id(roboto), "IP: %s", id(eth_ip).state.c_str());
uart:
  id: dac_uart
  rx_pin: 4
  tx_pin: 6
  baud_rate: 115200
  stop_bits: 1
  data_bits: 8
  parity: NONE
  debug:

modbus:

modbus_controller:
  - address: 1
    update_interval: 5s

output:
  # CH1 (0x0FA0 / 4000)
  - platform: modbus_controller
    id: dac_ch1_out
    address: 0x0FA0
    value_type: U_WORD
    write_lambda: |-
      // state = 0.0 ~ 1.0 → 0 ~ 4095
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH2 (0x0FA1 / 4001)
  - platform: modbus_controller
    id: dac_ch2_out
    address: 0x0FA1
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH3
  - platform: modbus_controller
    id: dac_ch3_out
    address: 0x0FA2
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH4
  - platform: modbus_controller
    id: dac_ch4_out
    address: 0x0FA3
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH5
  - platform: modbus_controller
    id: dac_ch5_out
    address: 0x0FA4
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH6
  - platform: modbus_controller
    id: dac_ch6_out
    address: 0x0FA5
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH7
  - platform: modbus_controller
    id: dac_ch7_out
    address: 0x0FA6
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH8
  - platform: modbus_controller
    id: dac_ch8_out
    address: 0x0FA7
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH9
  - platform: modbus_controller
    id: dac_ch9_out
    address: 0x0FA8
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH10
  - platform: modbus_controller
    id: dac_ch10_out
    address: 0x0FA9
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH11
  - platform: modbus_controller
    id: dac_ch11_out
    address: 0x0FAA
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH12
  - platform: modbus_controller
    id: dac_ch12_out
    address: 0x0FAB
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH13
  - platform: modbus_controller
    id: dac_ch13_out
    address: 0x0FAC
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH14
  - platform: modbus_controller
    id: dac_ch14_out
    address: 0x0FAD
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH15
  - platform: modbus_controller
    id: dac_ch15_out
    address: 0x0FAE
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

  # CH16
  - platform: modbus_controller
    id: dac_ch16_out
    address: 0x0FAF
    value_type: U_WORD
    write_lambda: |-
      uint16_t reg = (uint16_t) round(x * 4095.0);
      return reg;

# -------------------
# 16 Channel Dimmer
# -------------------
light:
  - platform: monochromatic
    name: "DAC CH1"
    output: dac_ch1_out
    default_transition_length: 0s

  - platform: monochromatic
    name: "DAC CH2"
    output: dac_ch2_out
    default_transition_length: 0s

  - platform: monochromatic
    name: "DAC CH3"
    output: dac_ch3_out
    default_transition_length: 0s

  - platform: monochromatic
    name: "DAC CH4"
    output: dac_ch4_out
    default_transition_length: 0s

  - platform: monochromatic
    name: "DAC CH5"
    output: dac_ch5_out
    default_transition_length: 0s

  - platform: monochromatic
    name: "DAC CH6"
    output: dac_ch6_out
    default_transition_length: 0s

  - platform: monochromatic
    name: "DAC CH7"
    output: dac_ch7_out
    default_transition_length: 0s

  - platform: monochromatic
    name: "DAC CH8"
    output: dac_ch8_out
    default_transition_length: 0s

  - platform: monochromatic
    name: "DAC CH9"
    output: dac_ch9_out
    default_transition_length: 0s

  - platform: monochromatic
    name: "DAC CH10"
    output: dac_ch10_out
    default_transition_length: 0s

  - platform: monochromatic
    name: "DAC CH11"
    output: dac_ch11_out
    default_transition_length: 0s

  - platform: monochromatic
    name: "DAC CH12"
    output: dac_ch12_out
    default_transition_length: 0s

  - platform: monochromatic
    name: "DAC CH13"
    output: dac_ch13_out
    default_transition_length: 0s

  - platform: monochromatic
    name: "DAC CH14"
    output: dac_ch14_out
    default_transition_length: 0s

  - platform: monochromatic
    name: "DAC CH15"
    output: dac_ch15_out
    default_transition_length: 0s

  - platform: monochromatic
    name: "DAC CH16"
    output: dac_ch16_out
    default_transition_length: 0s



pcf8574:
  - id: 'pcf8574_hub_in_1'  # for input channel 1-16
    i2c_id: bus_a
    address: 0x22
    pcf8575: true

binary_sensor:
  - platform: gpio
    name: "dm16-input01"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 8
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input02"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 9
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input03"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 10
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input04"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 11
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input05"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 12
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input06"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 13
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input07"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 14
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input08"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 15
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input09"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input10"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input11"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input12"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input13"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input14"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input15"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "dm16-input16"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true

ads1115:
  - address: 0x48
sensor:
  - platform: ads1115
    multiplexer: 'A0_GND'
    gain: 6.144
    resolution: 16_BITS
    name: "ADS1115 Channel A0-GND"
    update_interval: 5s
  - platform: ads1115
    multiplexer: 'A1_GND'
    gain: 6.144
    name: "ADS1115 Channel A1-GND"
    update_interval: 5s
  - platform: ads1115
    multiplexer: 'A2_GND'
    gain: 6.144
    name: "ADS1115 Channel A2-GND"
    update_interval: 5s
  - platform: ads1115
    multiplexer: 'A3_GND'
    gain: 6.144
    name: "ADS1115 Channel A3-GND"
    update_interval: 5s
   
esphome yaml file download:

.txt   DM16-HA-without Tuya.txt (Size: 9.49 KB / Downloads: 92)

Print this item

Sad AG Pro - Disappointed
Posted by: vishal.alex@gmail.com - 09-08-2025, 11:54 AM - Forum: KC868-AG / AG Pro / AG8 / Z1 - Replies (5)

I brought the AG Pro in June of 2024 when i saw that it had all in one as a Gateway. It was advertised in such a way that it was all in one solution. But as soon as i received it, i found that many of the things advertised is not functioning out of the box. the Zigbee had to be used with tasmota and remaining functions like IR, RF, Tuya and to be with Kincony firmware. and on top of this both firmware cannot work together. I some how managed to flash the Tasmota firmware because i needed the ZHA integration.. and this worked until last month. Now the tasmota firmware has failed to recognize the Zigbee device inside. i tried rolling back to several tasmota version but it all remains the same. 

I sent a message to their support and all the response i get is to change the firmware. I feel dumped.. Kincony should have either fixed the firmware issues or informed the customer that these problems exits. 92$(inc Shipping) wasted.

Print this item

  1-WIRE multiple sensors
Posted by: Ndogo - 09-08-2025, 09:29 AM - Forum: KC868-A16v3 - Replies (1)

Can I connect multiple DS18B20 sensors to one 47 GPIO in the native firmware?

Print this item

  KinCony Raspberry Pi CM5 Linux Server released
Posted by: admin - 09-07-2025, 08:59 AM - Forum: News - No Replies

KinCony Pi5 is a Raspberry Pi CM5 server for smart home automation and industrial automation control. It can use for home assistant local server. It's a Linux computer, you can install software by yourself, such as Node red. The product default CM5 version is CM5004000. It without Bluetooth and wifi, RAM:4G Lite version.
[Image: Pi5_1.jpg]
Model No. KinCony Pi5
Description: KinCony Automation Local Server – Pi5
Power supply: 12-24V DC
Processor: Raspberry Pi Compute Module 5
Size: 139mm*83mm*56mm
interfaces: Ethernet(RJ45)-LAN 1000Mbps IPv4/IPv6,USB-C
Installation method: DIN RAIL
2 × USB 3 sockets
microSD card socket for CM5 Lite modules
M.2 M key PCIe socket
1 × full-size HDMI 2.0 connectors
DIP SWITCH for jumpers
[Image: Pi5_2.jpg]

Print this item