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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,312
» Latest member: Lucknowescorts
» Forum threads: 3,629
» Forum posts: 18,737

Full Statistics

Online Users
There are currently 25 online users.
» 0 Member(s) | 14 Guest(s)
AhrefsBot, Amazonbot, Applebot, PetalBot, bot

Latest Threads
KC868-M16v2 configure yam...
Forum: KC868-M16 / M1 / MB / M30
Last Post: cmeyer5
57 minutes ago
» Replies: 121
» Views: 25,194
Replacing ESP32 with Kinc...
Forum: KC868-A16
Last Post: admin
12-24-2025, 11:43 PM
» Replies: 1
» Views: 14
N30 Energy entry not work...
Forum: N30
Last Post: admin
12-24-2025, 11:43 PM
» Replies: 11
» Views: 83
KC868-Server ESP32 Ethern...
Forum: KC868-Server Raspberry Pi4 local server
Last Post: admin
12-24-2025, 11:41 PM
» Replies: 7
» Views: 70
Single Moment switch
Forum: DIY Project
Last Post: admin
12-24-2025, 11:37 PM
» Replies: 1
» Views: 18
Help with Product Slectio...
Forum: Suggestions and feedback on KinCony's products
Last Post: admin
12-24-2025, 12:06 AM
» Replies: 5
» Views: 62
Loxone RS485
Forum: KinCony integrate with Loxone home automation
Last Post: admin
12-24-2025, 12:03 AM
» Replies: 9
» Views: 1,122
adaptor V2 and KC868 h32b...
Forum: KC868-ATC / Tuya adapter V2
Last Post: admin
12-23-2025, 01:19 AM
» Replies: 1
» Views: 24
KC868-A6 - how to connect...
Forum: KC868-A6
Last Post: admin
12-23-2025, 01:18 AM
» Replies: 1
» Views: 18
easy way to export/import...
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
12-23-2025, 01:09 AM
» Replies: 7
» Views: 5,647

  [arduino code examples for AIO Hybrid]-05 IR send
Posted by: admin - 09-15-2025, 01:29 AM - Forum: AIO Hybrid - No Replies

Code:
/*
* Copyright (c) 2025 KinCony IoT
* https://www.kincony.com
*
* Description:
* This program generates a 38 kHz PWM signal on a specified GPIO pin
* using the ESP32-S3 LEDC hardware peripheral.
* The output can be used to drive an IR LED for infrared signal transmission.
*/

#include <Arduino.h>
#include "driver/ledc.h"

#define IR_SEND_PIN 14  // GPIO pin connected to the IR LED

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

  // Configure the LEDC timer
  ledc_timer_config_t ledc_timer = {
      .speed_mode = LEDC_LOW_SPEED_MODE,       // Use low-speed mode
      .duty_resolution = LEDC_TIMER_8_BIT,     // 8-bit resolution (0-255)
      .timer_num = LEDC_TIMER_0,               // Select timer 0
      .freq_hz = 38000,                        // Set frequency to 38 kHz
      .clk_cfg = LEDC_AUTO_CLK                 // Automatically select the clock source
  };
  ledc_timer_config(&ledc_timer);

  // Configure the LEDC channel
  ledc_channel_config_t ledc_channel = {
      .gpio_num = IR_SEND_PIN,                 // Output GPIO pin
      .speed_mode = LEDC_LOW_SPEED_MODE,       // Use low-speed mode
      .channel = LEDC_CHANNEL_0,               // Channel 0
      .intr_type = LEDC_INTR_DISABLE,          // Disable interrupts
      .timer_sel = LEDC_TIMER_0,                // Use timer 0
      .duty = 128,                             // 50% duty cycle (128/255)
      .hpoint = 0                              // Start at high point 0
  };
  ledc_channel_config(&ledc_channel);

  Serial.println("38kHz PWM started.");
}

void loop() {
  // Continuously output the carrier wave
}
arduino ino file download:

.zip   5-IR-send-ESP32.zip (Size: 904 bytes / Downloads: 179)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:

.zip   5-IR-send-ESP32.ino.merged.zip (Size: 187.02 KB / Downloads: 154)

Print this item

  [arduino code examples for AIO Hybrid]-04 RS485 communication test
Posted by: admin - 09-15-2025, 01:28 AM - Forum: AIO Hybrid - 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 16 and RXD pin is defined as GPIO 17.
*/

#include <HardwareSerial.h>

// Define RS485 pins
#define RS485_RXD 47
#define RS485_TXD 3

// 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 Controller!");

  // 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: 766 bytes / Downloads: 160)
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: 189.46 KB / Downloads: 164)

Print this item

  [arduino code examples for AIO Hybrid]-03 Read analog input ports value
Posted by: admin - 09-15-2025, 01:27 AM - Forum: AIO Hybrid - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* Description:
* This Arduino program reads analog values from four analog input pins (A1, A2, A3, A4)
* and prints the values to the Serial Monitor. The analog inputs are defined with specific
* GPIO pins and the program reads the voltage levels from these pins every 2 seconds.
*
* Pin Definitions:
* - A1: GPIO 5
* - A2: GPIO 7
* - A3: GPIO 6
* - A4: GPIO 4
*/

#define ANALOG_A1   5   // Define GPIO pin for analog input A1
#define ANALOG_A2   7   // Define GPIO pin for analog input A2
#define ANALOG_A3   6   // Define GPIO pin for analog input A3
#define ANALOG_A4   4   // Define GPIO pin for analog input A4

void setup()
{
    Serial.begin(115200); // Initialize serial communication at 115200 baud rate
    delay(500); // Short delay to allow serial communication to start

    pinMode(ANALOG_A1, INPUT); // Set GPIO 5 as an input for analog signal A1
    pinMode(ANALOG_A2, INPUT); // Set GPIO 7 as an input for analog signal A2
    pinMode(ANALOG_A3, INPUT); // Set GPIO 6 as an input for analog signal A3
    pinMode(ANALOG_A4, INPUT); // Set GPIO 4 as an input for analog signal A4
}

void loop()
{
    // Read and print analog values from the defined pins
    Serial.print("A1=");
    Serial.println(analogRead(ANALOG_A1)); // Read and print the value from A1
    Serial.print("A2=");
    Serial.println(analogRead(ANALOG_A2)); // Read and print the value from A2
    Serial.print("A3=");
    Serial.println(analogRead(ANALOG_A3)); // Read and print the value from A3
    Serial.print("A4=");
    Serial.println(analogRead(ANALOG_A4)); // Read and print the value from A4
   
    delay(2000); // Wait for 2 seconds before the next reading
}
arduino ino file download:

.zip   3-analog-input.zip (Size: 769 bytes / Downloads: 164)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:

.zip   3-analog-input.ino.merged.zip (Size: 189.25 KB / Downloads: 184)

Print this item

  [arduino code examples for AIO Hybrid]-02 Read digital input ports state
Posted by: admin - 09-15-2025, 01:26 AM - Forum: AIO Hybrid - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* Description:
* This Arduino program continuously reads 12 digital inputs (P0~P11)
* from a PCF8575 I/O expander and prints their states to the Serial Monitor
* in binary format (0 = ON, 1 = OFF).
*
* Pin Definitions:
* - SDA: GPIO 8
* - SCL: GPIO 18
* - PCF8575 I2C Address: 0x24
*/

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

// I2C pin definitions
#define I2C_SDA 8
#define I2C_SCL 18

// PCF8575 object with I2C address 0x24
PCF8575 pcf8575_IN1(0x24);

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

    // Initialize I2C communication
    Wire.begin(I2C_SDA, I2C_SCL);

    // Initialize the PCF8575
    pcf8575_IN1.begin();

    Serial.println("Input state: 0=ON, 1=OFF");
}

void loop() {
    uint16_t state = 0;

    // Read the state of P0~P11
    for (int pin = 0; pin <= 11; pin++) {
        if (pcf8575_IN1.read(pin)) {
            state |= (1 << pin);
        }
    }

    // Print the state in binary format
    Serial.print("Input state: ");
    for (int pin = 11; pin >= 0; pin--) {
        Serial.print((state >> pin) & 1);
    }
    Serial.println();

    delay(500); // Polling delay
}
arduino ino file download:

.zip   2-digital-input.zip (Size: 764 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: 196.89 KB / Downloads: 166)

Print this item

  [arduino code examples for AIO Hybrid]-01 Turn ON/OFF relay
Posted by: admin - 09-15-2025, 01:24 AM - Forum: AIO Hybrid - No Replies

Code:
/*
* PCF8574 Relay Control Example
*
* Controls 5 relays connected to PCF8574 via I2C bus.
*
* Made By KinCony
* https://www.kincony.com
*/

#include <Arduino.h>
#include <Wire.h>
#include "PCF8574.h"

// I2C pin definitions
#define I2C_SDA 8
#define I2C_SCL 18

// Create PCF8574 object with I2C address 0x26
PCF8574 pcf8574(0x26);

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

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

  // Set PCF8574 P3~P7 as OUTPUT (Relays)
  pcf8574.pinMode(P3, OUTPUT);
  pcf8574.pinMode(P4, OUTPUT);
  pcf8574.pinMode(P5, OUTPUT);
  pcf8574.pinMode(P6, OUTPUT);
  pcf8574.pinMode(P7, OUTPUT);

  Serial.print("Init pcf8574...");
  if (pcf8574.begin()) {
    Serial.println("OK");
  } else {
    Serial.println("KO");
    while (1); // Stop if initialization fails
  }

  // Turn OFF all relays at startup
  for (int pin = P3; pin <= P7; pin++) {
    pcf8574.digitalWrite(pin, LOW);
  }
}

void loop() {
  // Turn ON all relays one by one
  for (int pin = P3; pin <= P7; pin++) {
    pcf8574.digitalWrite(pin, HIGH);
    delay(500);
  }

  delay(1000); // Keep all relays ON for a while

  // Turn OFF all relays
  for (int pin = P3; pin <= P7; pin++) {
    pcf8574.digitalWrite(pin, LOW);
  }

  delay(1000); // Keep all relays OFF for a while
}
arduino ino file download:

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

.zip   1-relay.ino.merged.zip (Size: 198.37 KB / Downloads: 158)

Print this item

  AIO Hybrid ESPHome yaml for home assistant without tuya
Posted by: admin - 09-15-2025, 01:19 AM - Forum: AIO Hybrid - No Replies

Code:
esphome:
  name: aio-hybrid
  friendly_name: AIO-hybrid
  platformio_options:
    board_build.flash_mode: dio

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf
    sdkconfig_options:
      SOC_RMT_SUPPORT_RX_PINGPONG: "n"
# Enable logging
logger:
  hardware_uart: USB_SERIAL_JTAG
# Enable Home Assistant API
api:

uart:
  - id: uart_zsu
    baud_rate: 115200
    debug:
      direction: BOTH
      dummy_receiver: true
      after:
        timeout: 10ms
      sequence:
        - lambda: UARTDebug::log_string(direction, bytes);
    tx_pin: 15
    rx_pin: 48

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

i2c:
   - id: bus_a
     sda: 8
     scl: 18
     scan: true
     frequency: 400kHz

pcf8574:
  - id: 'pcf8574_hub_output_1'  # for output channel 5
    i2c_id: bus_a
    address: 0x26

  - id: 'pcf8574_hub_input_1'  # for input channel 1-12
    i2c_id: bus_a
    address: 0x24
    pcf8575: true


switch:

  - platform: uart
    uart_id: uart_zsu
    name: "UART zigbee"
    data: [0x55, 0xaa, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04] # ZSU zigbee module 

  - platform: gpio
    name: "AIO_hybrid-output01"
    id: "AIO_hybrid_output01"
    pin:
      pcf8574: pcf8574_hub_output_1
      number: 3
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-output02"
    id: "AIO_hybrid_output02"
    pin:
      pcf8574: pcf8574_hub_output_1
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-output03"
    id: "AIO_hybrid_output03"
    pin:
      pcf8574: pcf8574_hub_output_1
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-output04"
    id: "AIO_hybrid_output04"
    pin:
      pcf8574: pcf8574_hub_output_1
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-output05"
    id: "AIO_hybrid_output05"
    pin:
      pcf8574: pcf8574_hub_output_1
      number: 7
      mode: OUTPUT
      inverted: true

  - platform: template
    name: IR-Send1
    turn_on_action:
      - remote_transmitter.transmit_pronto:
          transmitter_id: ir1
          data: "0000 006C 0022 0002 015B 00AD 0016 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0575 015B 0057 0016 0E6C"

binary_sensor:
  - platform: gpio
    name: "AIO_hybrid-input01"
    id: "AIO_hybrid_input01"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input02"
    id: "AIO_hybrid_input02"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input03"
    id: "AIO_hybrid_input03"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input04"
    id: "AIO_hybrid_input04"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input05"
    id: "AIO_hybrid_input05"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input06"
    id: "AIO_hybrid_input06"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input07"
    id: "AIO_hybrid_input07"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input08"
    id: "AIO_hybrid_input08"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 7
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input09"
    id: "AIO_hybrid_input09"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 8
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input10"
    id: "AIO_hybrid_input10"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 9
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input11"
    id: "AIO_hybrid_input11"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 10
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input12"
    id: "AIO_hybrid_input12"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 11
      mode: INPUT
      inverted: true

## without resistance on PCB
  - platform: gpio
    name: "AIO_hybrid-433M"
    pin:
      number: 40
      inverted:  false

  - platform: gpio
    name: "AIO_hybrid-io0"
    pin:
      number: 0
      inverted:  false

mcp4728:
  - id: dac_output

output:
- platform: mcp4728
  id: dimmer1
  mcp4728_id: dac_output
  channel: A
  vref: vdd
  power_down: normal # default

- platform: mcp4728
  id: dimmer2
  mcp4728_id: dac_output
  channel: B
  vref: vdd
  power_down: normal # default

- platform: mcp4728
  id: dimmer3
  mcp4728_id: dac_output
  channel: C
  vref: vdd
  power_down: normal # default

- platform: mcp4728
  id: dimmer4
  mcp4728_id: dac_output
  channel: D
  vref: vdd
  power_down: normal # default

light:
  - platform: monochromatic
    name: "dimmer-1"
    output: dimmer1
    gamma_correct: 1.0

  - platform: monochromatic
    name: "dimmer-2"
    output: dimmer2
    gamma_correct: 1.0

  - platform: monochromatic
    name: "dimmer-3"
    output: dimmer3
    gamma_correct: 1.0

  - platform: monochromatic
    name: "dimmer-4"
    output: dimmer4
    gamma_correct: 1.0

  - platform: esp32_rmt_led_strip
    rgb_order: GRB
    pin: GPIO21
    num_leds: 20
    chipset: ws2812
    name: "My Light IO21"

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

display:
  - platform: ssd1306_i2c
    i2c_id: bus_a
    model: "SSD1306 128x64"
    address: 0x3C
    lambda: |-
      it.printf(0, 0, id(roboto), "AIO-hybrid");

sensor:
  - platform: adc
    pin: 5
    name: "AIO_hybrid A1 Voltage"
    update_interval: 55s
    attenuation: 11db
    filters:
      - lambda:
          if (x >= 3.11) {
            return x * 1.60256;
          } else if (x <= 0.15) {
            return 0;
          } else {
            return x * 1.51;
          }
  - platform: adc
    pin: 7
    name: "AIO_hybrid A2 Voltage"
    update_interval: 55s
    attenuation: 11db
    filters:
      # - multiply: 1.51515
      - lambda:
          if (x >= 3.11) {
            return x * 1.60256;
          } else if (x <= 0.15) {
            return 0;
          } else {
            return x * 1.51;
          }
  - platform: adc
    pin: 6
    name: "AIO_hybrid A3 Current"
    update_interval: 55s
    unit_of_measurement: mA
    attenuation: 11db
    filters:
      - multiply: 6.66666666
  - platform: adc
    pin: 4
    name: "AIO_hybrid A4 Current"
    update_interval: 55s
    unit_of_measurement: mA
    attenuation: 11db
    filters:
      - multiply: 6.66666666

remote_receiver:
  pin: 17
  dump: all

remote_transmitter:
  - id: ir1
    pin: 14
    carrier_duty_percent: 50%



web_server:
  port: 80
download yaml file:

.txt   AIO-hybrid_pin_define-HA-without-Tuya.txt (Size: 7.62 KB / Downloads: 118)

Print this item

  AIO Hybrid ESPHome yaml for home assistant with tuya
Posted by: admin - 09-15-2025, 01:18 AM - Forum: AIO Hybrid - No Replies

Code:
esphome:
  name: aio-hybrid
  friendly_name: AIO-hybrid
  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

# Enable logging
#logger:
#  hardware_uart: USB_SERIAL_JTAG

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


# Enable Home Assistant API
api:

uart:
#  - id: uart_zsu
#    baud_rate: 115200
#    debug:
#      direction: BOTH
#      dummy_receiver: true
#      after:
#        timeout: 10ms
#      sequence:
#        - lambda: UARTDebug::log_string(direction, bytes);
#    tx_pin: 15
#3    rx_pin: 48

  - id: tuya_mcu_uart
    tx_pin: GPIO39
    rx_pin: GPIO38
    baud_rate: 9600

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

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

i2c:
   - id: bus_a
     sda: 8
     scl: 18
     scan: true
     frequency: 400kHz

pcf8574:
  - id: 'pcf8574_hub_output_1'  # for output channel 5
    i2c_id: bus_a
    address: 0x26

  - id: 'pcf8574_hub_input_1'  # for input channel 1-12
    i2c_id: bus_a
    address: 0x24
    pcf8575: true


switch:

#  - platform: uart
#    uart_id: uart_zsu
#    name: "UART zigbee"
#    data: [0x55, 0xaa, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04] # ZSU zigbee module 

  - platform: gpio
    name: "AIO_hybrid-output01"
    id: "AIO_hybrid_output01"
    pin:
      pcf8574: pcf8574_hub_output_1
      number: 3
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: AIO_hybrid-output1-tuya
    dp_id: 1
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "AIO_hybrid_output01"


  - platform: gpio
    name: "AIO_hybrid-output02"
    id: "AIO_hybrid_output02"
    pin:
      pcf8574: pcf8574_hub_output_1
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-output03"
    id: "AIO_hybrid_output03"
    pin:
      pcf8574: pcf8574_hub_output_1
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-output04"
    id: "AIO_hybrid_output04"
    pin:
      pcf8574: pcf8574_hub_output_1
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-output05"
    id: "AIO_hybrid_output05"
    pin:
      pcf8574: pcf8574_hub_output_1
      number: 7
      mode: OUTPUT
      inverted: true

  - platform: template
    name: IR-Send1
    turn_on_action:
      - remote_transmitter.transmit_pronto:
          transmitter_id: ir1
          data: "0000 006C 0022 0002 015B 00AD 0016 0041 0016 0016 0016 0041 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0041 0016 0575 015B 0057 0016 0E6C"

binary_sensor:
  - platform: gpio
    name: "AIO_hybrid-input01"
    id: "AIO_hybrid_input01"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input02"
    id: "AIO_hybrid_input02"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input03"
    id: "AIO_hybrid_input03"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input04"
    id: "AIO_hybrid_input04"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input05"
    id: "AIO_hybrid_input05"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input06"
    id: "AIO_hybrid_input06"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input07"
    id: "AIO_hybrid_input07"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input08"
    id: "AIO_hybrid_input08"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 7
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input09"
    id: "AIO_hybrid_input09"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 8
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input10"
    id: "AIO_hybrid_input10"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 9
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input11"
    id: "AIO_hybrid_input11"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 10
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "AIO_hybrid-input12"
    id: "AIO_hybrid_input12"
    pin:
      pcf8574: pcf8574_hub_input_1
      number: 11
      mode: INPUT
      inverted: true

## without resistance on PCB
  - platform: gpio
    name: "AIO_hybrid-433M"
    pin:
      number: 40
      inverted:  false

  - platform: gpio
    name: "AIO_hybrid-io0"
    pin:
      number: 0
      inverted:  false

mcp4728:
  - id: dac_output

output:
- platform: mcp4728
  id: dimmer1
  mcp4728_id: dac_output
  channel: A
  vref: vdd
  power_down: normal # default

- platform: mcp4728
  id: dimmer2
  mcp4728_id: dac_output
  channel: B
  vref: vdd
  power_down: normal # default

- platform: mcp4728
  id: dimmer3
  mcp4728_id: dac_output
  channel: C
  vref: vdd
  power_down: normal # default

- platform: mcp4728
  id: dimmer4
  mcp4728_id: dac_output
  channel: D
  vref: vdd
  power_down: normal # default

light:
  - platform: monochromatic
    name: "dimmer-1"
    output: dimmer1
    gamma_correct: 1.0

  - platform: monochromatic
    name: "dimmer-2"
    output: dimmer2
    gamma_correct: 1.0

  - platform: monochromatic
    name: "dimmer-3"
    output: dimmer3
    gamma_correct: 1.0

  - platform: monochromatic
    name: "dimmer-4"
    output: dimmer4
    gamma_correct: 1.0



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

display:
  - platform: ssd1306_i2c
    i2c_id: bus_a
    model: "SSD1306 128x64"
    address: 0x3C
    lambda: |-
      it.printf(0, 0, id(roboto), "AIO-hybrid");

sensor:
  - platform: adc
    pin: 5
    name: "AIO_hybrid A1 Voltage"
    update_interval: 55s
    attenuation: 11db
    filters:
      - lambda:
          if (x >= 3.11) {
            return x * 1.60256;
          } else if (x <= 0.15) {
            return 0;
          } else {
            return x * 1.51;
          }
  - platform: adc
    pin: 7
    name: "AIO_hybrid A2 Voltage"
    update_interval: 55s
    attenuation: 11db
    filters:
      # - multiply: 1.51515
      - lambda:
          if (x >= 3.11) {
            return x * 1.60256;
          } else if (x <= 0.15) {
            return 0;
          } else {
            return x * 1.51;
          }
  - platform: adc
    pin: 6
    name: "AIO_hybrid A3 Current"
    update_interval: 55s
    unit_of_measurement: mA
    attenuation: 11db
    filters:
      - multiply: 6.66666666
  - platform: adc
    pin: 4
    name: "AIO_hybrid A4 Current"
    update_interval: 55s
    unit_of_measurement: mA
    attenuation: 11db
    filters:
      - multiply: 6.66666666

remote_receiver:
  pin: 17
  dump: all

remote_transmitter:
  - id: ir1
    pin: 14
    carrier_duty_percent: 50%



web_server:
  port: 80
download yaml file:

.txt   AIO-hybrid_pin_define-HA-with-Tuya.txt (Size: 8.12 KB / Downloads: 101)

Print this item

  AIO Hybrid ESP32-S3 IO pins define
Posted by: admin - 09-15-2025, 01:16 AM - Forum: AIO Hybrid - No Replies

ANALOG_A1(0-5v)    GPIO5
ANALOG_A2(0-5v)    GPIO7
ANALOG_A3(4-20mA)  GPIO6
ANALOG_A4(4-20mA)  GPIO4

IIC SDA:GPIO8
IIC SCL:GPIO18

PCF8575:  i2c address:0x24

PCF8575->P0 (DI1)
PCF8575->P1 (DI2)
PCF8575->P2 (DI3)
PCF8575->P3 (DI4)
PCF8575->P4 (DI5)
PCF8575->P5 (DI6)
PCF8575->P6 (DI7)
PCF8575->P7 (DI8)
PCF8575->P8 (DI9)
PCF8575->P9 (DI10)
PCF8575->P10 (DI11)
PCF8575->P11 (DI12)

PCF8574:  i2c address:0x26
PCF8574->P3 (RELAY1)
PCF8574->P4 (RELAY2)
PCF8574->P5 (RELAY3)
PCF8574->P6 (RELAY4)
PCF8574->P7 (RELAY5)

IR Sender: GPIO14
IR Receiver: GPIO17
RF433MHz wireless receiver: GPIO40
------------------------

Ethernet (W5500) I/O define:

clk_pin: GPIO42
mosi_pin: GPIO43
miso_pin: GPIO44
cs_pin: GPIO41

interrupt_pin: GPIO2
reset_pin: GPIO1

--------------------
RS485:
RXD:GPIO47
TXD:GPIO3
--------------------
Tuya wifi module:
RXD:GPIO38
TXD:GPIO39

Tuya network button: Toya module's P28
Tuya network LED: Tuya module's P16

--------------------

Tuya Zigbee module:
RXD: GPIO48
TXD: GPIO15

------------------------
SD Card:
SPI-MOSI:GPIO10
SPI-SCK:GPIO11
SPI-MISO:GPIO12
SPI-CS:GPIO9
SPI-CD:GPIO13
------------------------
24C02 EPROM i2c address: 0x50
SSD1306 display: i2c address:0x3c
DS3231 RTC i2c address: 0x68
MCP4728 DAC: i2c address:0x60

Print this item

Exclamation Change PIN define
Posted by: JuDie07 - 09-14-2025, 02:54 PM - Forum: KC868-A series and Uair Smart Controller - Replies (1)

KC868-a8v3
Great, I have spent a whole afternoon looking for a bug!
And then, we quietly changed the PIN Define file without saying anythingAngry

ESP32 I/O pin define: https://www.kincony.com/forum/showthread.php?tid=7970

Huh Is it so difficult to issue a short INFO?



Attached Files Thumbnail(s)
   
Print this item

  Board recommendation ?
Posted by: Lory - 09-14-2025, 01:53 PM - Forum: DIY Project - Replies (3)

Hello,

I have 8 wooden doors and I want to install a 12v electric lock in each one and also a NFC card reader in each one.

To power the electric locks I can use a kincony board with 8 relays, but each card reader needs to be connected via SPI or with I2C

Is there a kincony board that can resolve this needs?

Edit:
problem is that the card readers might have the same I2C address, probably I do need a I2C multiplexor TCA9548A?

Also, if I want to use Kincony F series I see that the I2C port is utilized by a LCD screen… how can I overcome this difficulty?

Thanks

Print this item