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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,413
» Latest member: apexwebstudios
» Forum threads: 3,664
» Forum posts: 18,973

Full Statistics

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

Latest Threads
"KCS" v3.19.0 firmware BI...
Forum: "KCS" v3 firmware
Last Post: admin
1 hour ago
» Replies: 0
» Views: 3
flash Kincony software to...
Forum: DIY Project
Last Post: admin
2 hours ago
» Replies: 14
» Views: 80
KC868-A6 - how to connect...
Forum: KC868-A6
Last Post: admin
4 hours ago
» Replies: 10
» Views: 142
F8 physical on device swi...
Forum: F8
Last Post: admin
4 hours ago
» Replies: 3
» Views: 16
Feedback: Product line di...
Forum: Suggestions and feedback on KinCony's products
Last Post: mkai
6 hours ago
» Replies: 0
» Views: 6
flash kc868-a4
Forum: KC868-A series and Uair Smart Controller
Last Post: Sten
Yesterday, 01:09 PM
» Replies: 14
» Views: 557
KC868 A8v3 RF not working...
Forum: KC868-A8v3
Last Post: admin
Yesterday, 10:46 AM
» Replies: 1
» Views: 10
N30 Energy entry not work...
Forum: N30
Last Post: admin
Yesterday, 01:30 AM
» Replies: 30
» Views: 581
KC868-A16 v1 with KCS v2....
Forum: "KCS" v2 firmware system
Last Post: admin
01-11-2026, 11:52 PM
» Replies: 7
» Views: 54
Separate +12V to Kincony,...
Forum: T128M
Last Post: admin
01-11-2026, 11:51 PM
» Replies: 1
» Views: 19

  F4 ESP32-S3 IO pins define
Posted by: admin - 11-03-2025, 11:36 PM - Forum: F4 - 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

PCF8574:U23  i2c address:0x24

PCF8574->P0 (DI1)
PCF8574->P1 (DI2)
PCF8574->P2 (DI3)
PCF8574->P3 (DI4)

PCF8574->P4 (relay1)
PCF8574->P5 (relay2)
PCF8574->P6 (relay3)
PCF8574->P7 (relay4)

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:GPIO17
TXD:GPIO16
--------------------
Tuya module:
RXD:GPIO38
TXD:GPIO39

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

---------------------
1-wire (pull-up resistance on PCB):
1-wire1:GPIO48
1-wire2:GPIO47
1-wire3:GPIO21
1-wire4:GPIO15

1-wire (without resistance on PCB):
1-wire2:GPIO14
------------------------
SD Card:
SPI-MOSI:GPIO10
SPI-SCK:GPIO11
SPI-MISO:GPIO12
SPI-CS:GPIO9
SPI-CD:GPIO13
------------------------
24C02 EPROM i2c address: 0x50
DS3231 RTC i2c address: 0x68
SSD1306 display: i2c address:0x3c

Print this item

  [arduino code examples for F32]-11 digital INPUT trigger OUTPUT directly
Posted by: admin - 11-03-2025, 11:33 PM - Forum: F32 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* This program reads 32 input states from three PCF8575 I/O expanders and
* controls a corresponding 32-channel relay module.
* When an input pin is LOW, the corresponding relay is turned ON (LOW means ON for the relay).
* When the input pin is HIGH, the corresponding relay is turned OFF.
*
* Pin Definitions:
* - SDA: GPIO 8
* - SCL: GPIO 18

PCF8575:U27 (relay17-32) i2c address:0x25
PCF8575:U23 (DI1-16) i2c address:0x24
PCF8575:U49 i2c address: 0x26
  PCF8575(pin number0-7):DI17-24
  PCF8575(pin number8-11):relay13-16
  PCF8575(pin number12-15):relay9-12

PCF8575:U62 i2c address: 0x27
  PCF8575(pin number0-7):DI25-32
  PCF8575(pin number8-15):relay1-8
*/

#include <Wire.h>        // I2C communication
#include <PCF8575.h>     // Library to control the PCF8575 I/O expander

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

// I2C addresses for the PCF8575 modules
#define INPUT_I2C_ADDRESS_1 0x24   
#define INPUT_RELAY_I2C_ADDRESS_2 0x26 
#define RELAY_I2C_ADDRESS_3 0x25 
#define INPUT_RELAY_I2C_ADDRESS_3 0x27   

PCF8575 pcf8575_IN1(INPUT_I2C_ADDRESS_1);   
PCF8575 pcf8575_IN2(INPUT_RELAY_I2C_ADDRESS_2);   
PCF8575 pcf8575_RL(RELAY_I2C_ADDRESS_3);   
PCF8575 pcf8575_IN3(INPUT_RELAY_I2C_ADDRESS_3);

void setup() {
  // Initialize I2C communication
  Wire.begin(SDA, SCL);
 
  // Initialize serial communication
  Serial.begin(115200);
 
  // Initialize input and relay modules
  pcf8575_IN1.begin(); 
  pcf8575_IN2.begin(); 
  pcf8575_IN3.begin();
  pcf8575_RL.begin(); 
 
  // Turn off all relays at the start (LOW means OFF)
  for (int i = 8; i < 16; i++) {
    pcf8575_IN2.write(i, HIGH);
  }
  for (int i = 0; i < 16; i++) {
    pcf8575_RL.write(i, HIGH);
  }
  for (int i = 8; i < 16; i++) {
    pcf8575_IN3.write(i, HIGH); 
  }
  Serial.println("System started: Input state controlling 24 relays");
}

void loop() {
    bool inputState;
    inputState = pcf8575_IN1.read(0);  // input1 control relay1
    if (inputState) {
      pcf8575_IN3.write(8, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_IN3.write(8, LOW);   // If input is LOW, turn the corresponding relay ON
    }
 
    inputState = pcf8575_IN1.read(1);  // input2 control relay2
    if (inputState) {
      pcf8575_IN3.write(9, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_IN3.write(9, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN1.read(2);  // input3 control relay3
    if (inputState) {
      pcf8575_IN3.write(10, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_IN3.write(10, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN1.read(3);  // input4 control relay4
    if (inputState) {
      pcf8575_IN3.write(11, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_IN3.write(11, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN1.read(4);  // input5 control relay5
    if (inputState) {
      pcf8575_IN3.write(12, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_IN3.write(12, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN1.read(5);  // input6 control relay6
    if (inputState) {
      pcf8575_IN3.write(13, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_IN3.write(13, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN1.read(6);  // input7 control relay7
    if (inputState) {
      pcf8575_IN3.write(14, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_IN3.write(14, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN1.read(7);  // input8 control relay8
    if (inputState) {
      pcf8575_IN3.write(15, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_IN3.write(15, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN1.read(8);  // input9 control relay9
    if (inputState) {
      pcf8575_IN2.write(12, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_IN2.write(12, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN1.read(9);  // input10 control relay10
    if (inputState) {
      pcf8575_IN2.write(13, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_IN2.write(13, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN1.read(10);  // input11 control relay11
    if (inputState) {
      pcf8575_IN2.write(14, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_IN2.write(14, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN1.read(11);  // input12 control relay12
    if (inputState) {
      pcf8575_IN2.write(15, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_IN2.write(15, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN1.read(12);  // input13 control relay13
    if (inputState) {
      pcf8575_IN2.write(8, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_IN2.write(8, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN1.read(13);  // input14 control relay14
    if (inputState) {
      pcf8575_IN2.write(9, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_IN2.write(9, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN1.read(14);  // input15 control relay15
    if (inputState) {
      pcf8575_IN2.write(10, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_IN2.write(10, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN1.read(15);  // input16 control relay16
    if (inputState) {
      pcf8575_IN2.write(11, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_IN2.write(11, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN2.read(0);  // input17 control relay17
    if (inputState) {
      pcf8575_RL.write(0, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_RL.write(0, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN2.read(1);  // input18 control relay18
    if (inputState) {
      pcf8575_RL.write(1, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_RL.write(1, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN2.read(2);  // input19 control relay19
    if (inputState) {
      pcf8575_RL.write(2, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_RL.write(2, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN2.read(3);  // input20 control relay20
    if (inputState) {
      pcf8575_RL.write(3, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_RL.write(3, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN2.read(4);  // input21 control relay21
    if (inputState) {
      pcf8575_RL.write(4, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_RL.write(4, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN2.read(5);  // input22 control relay22
    if (inputState) {
      pcf8575_RL.write(5, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_RL.write(5, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN2.read(6);  // input23 control relay23
    if (inputState) {
      pcf8575_RL.write(6, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_RL.write(6, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN2.read(7);  // input24 control relay24
    if (inputState) {
      pcf8575_RL.write(7, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_RL.write(7, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN3.read(0);  // input25 control relay25
    if (inputState) {
      pcf8575_RL.write(8, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_RL.write(8, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN3.read(1);  // input26 control relay26
    if (inputState) {
      pcf8575_RL.write(9, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_RL.write(9, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN3.read(2);  // input27 control relay27
    if (inputState) {
      pcf8575_RL.write(10, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_RL.write(10, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN3.read(3);  // input28 control relay28
    if (inputState) {
      pcf8575_RL.write(11, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_RL.write(11, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN3.read(4);  // input29 control relay29
    if (inputState) {
      pcf8575_RL.write(12, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_RL.write(12, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN3.read(5);  // input30 control relay30
    if (inputState) {
      pcf8575_RL.write(13, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_RL.write(13, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN3.read(6);  // input31 control relay31
    if (inputState) {
      pcf8575_RL.write(14, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_RL.write(14, LOW);   // If input is LOW, turn the corresponding relay ON
    }

    inputState = pcf8575_IN3.read(7);  // input32 control relay32
    if (inputState) {
      pcf8575_RL.write(15, HIGH);  // If input is HIGH, turn the corresponding relay OFF
    } else {
      pcf8575_RL.write(15, LOW);   // If input is LOW, turn the corresponding relay ON
    }

  // Delay for 500 milliseconds
  delay(500);
}
arduino ino file download:

.zip   11-input-trigger-output.zip (Size: 1.54 KB / Downloads: 95)
BIN file (you can use esp32 download tool download to ESP32-S3 with address 0x0 then directly to use) download:

.zip   11-input-trigger-output.ino.merged.zip (Size: 198.09 KB / Downloads: 95)

Print this item

  [arduino code examples for F32]-02 Read digital input ports state
Posted by: admin - 11-03-2025, 11:27 PM - Forum: F32 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
*
* Pin Definitions:
* - SDA: GPIO 8
* - SCL: GPIO 18
* - PCF8575 I2C Address: 0x24 for inputs 1-16, 0x26 for inputs 17-24, 0x27 for inputs 18-25
*/

#include "Arduino.h"
#include "PCF8575.h"

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

// Set I2C addresses
PCF8575 pcf8575_IN1(0x24); // The I2C address of the first PCF8575 (inputs 1-16)
PCF8575 pcf8575_IN2(0x26); // The I2C address of the second PCF8575 (inputs 17-24)
PCF8575 pcf8575_IN3(0x27); // The I2C address of the second PCF8575 (inputs 25-32)

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

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

    // Initialize both PCF8575 modules
    pcf8575_IN1.begin();
    pcf8575_IN2.begin();
    pcf8575_IN3.begin();

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

void loop() {
    uint32_t state = 0; // Use a 32-bit variable to store the state of all 24 pins

    // Read the state of each pin from the first PCF8575 (inputs 1-16)
    for (int pin = 0; pin < 16; pin++) {
        if (pcf8575_IN1.read(pin)) {
            state |= (1UL << pin); // Set the bit for the active pin (inputs 1-16)
        }
    }

    // Read the state of each pin from the second PCF8575 (inputs 17-24, corresponding to pins 0-7)
    for (int pin = 0; pin < 8; pin++) {
        if (pcf8575_IN2.read(pin)) {
            state |= (1UL << (pin + 16)); // Set the bit for the active pin (inputs 17-24)
        }
    }

    // Read the state of each pin from the second PCF8575 (inputs 25-32, corresponding to pins 0-7)
    for (int pin = 0; pin < 8; pin++) {
        if (pcf8575_IN3.read(pin)) {
            state |= (1UL << (pin + 24));
        }
    }

    // Print the state of all 24 inputs in binary format
    Serial.print("Input state: ");
    Serial.println(state, BIN); // Print the state of inputs in binary

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

.zip   2-digital-input.zip (Size: 885 bytes / Downloads: 92)
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: 197.91 KB / Downloads: 96)

Print this item

  [arduino code examples for F32]-01 Turn ON/OFF relay
Posted by: admin - 11-03-2025, 11:25 PM - Forum: F32 - No Replies

Code:
/*
* Made by KinCony IoT: https://www.kincony.com
*
* This program controls a 32-channel relay board via two PCF8575 I/O expanders.
* It sequentially turns on each relay and then turns them off in a loop.
*
* Pin Definitions:
* - SDA: GPIO 8
* - SCL: GPIO 18
*
* Delay Time:
* - 200 milliseconds between switching relays
*/

#include <Wire.h>        // Include the Wire library for I2C communication
#include <PCF8575.h>     // Include the PCF8575 library to control the I/O expander

#define SDA 8            // Define the SDA pin
#define SCL 18           // Define the SCL pin
#define DELAY_TIME 200   // Define the delay time in milliseconds

// Set I2C addresses of the PCF8575 modules
#define I2C_ADDRESS_R1 0x25 // I2C address of the first PCF8575 module
#define I2C_ADDRESS_R2 0x26 // I2C address of the second PCF8575 module
#define I2C_ADDRESS_R3 0x27 // I2C address of the second PCF8575 module

PCF8575 pcf8575_R1(I2C_ADDRESS_R1); // Create a PCF8575 object for the first module (for relays 17-32)
PCF8575 pcf8575_R2(I2C_ADDRESS_R2); // Create a PCF8575 object for the second module (for relays 9-16)
PCF8575 pcf8575_R3(I2C_ADDRESS_R3); // Create a PCF8575 object for the second module (for relays 1-8)

void setup() {
  // Initialize I2C communication
  Wire.begin(SDA, SCL); // SDA on GPIO 8, SCL on GPIO 18 (according to your board's configuration)
 
  // Initialize serial communication for debugging (optional)
  Serial.begin(115200);
  Serial.println("PCF8575 Relay Control: Starting...");

  // Initialize the PCF8575 modules
  pcf8575_R1.begin();
  pcf8575_R2.begin();
  pcf8575_R3.begin();

  // Turn off all relays initially (set all pins HIGH)
  for (int i = 0; i < 16; i++) {
    pcf8575_R1.write(i, HIGH); // Set relays 17-32 to OFF (assuming HIGH means OFF for relays)
    pcf8575_R2.write(i, HIGH); // Set relays 9-16 to OFF (assuming HIGH means OFF for relays)
  }

  // Turn off all relays initially (set all pins HIGH)
  for (int i = 8; i < 16; i++) {
    pcf8575_R3.write(i, HIGH); // Set relays 1-8 to OFF (assuming HIGH means OFF for relays)
  }

}

void loop() {
  // Sequentially turn on each relay (1-32)

  // First control the relays on the second PCF8575 (relays 1-8, corresponding to pins 8-15)
  for (int i = 8; i < 16; i++) {
    pcf8575_R3.write(i, LOW);   // Turn on the relay at pin i (LOW means ON for the relay)
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds
  }

  // First control the relays on the second PCF8575 (relays 9-16, corresponding to pins 8-15)
  for (int i = 8; i < 16; i++) {
    pcf8575_R2.write(i, LOW);   // Turn on the relay at pin i (LOW means ON for the relay)
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds
  }

  // Then control the relays on the first PCF8575 (relays 17-32)
  for (int i = 0; i < 16; i++) {
    pcf8575_R1.write(i, LOW);   // Turn on the relay at pin i (LOW means ON for the relay)
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds
  }

  // Sequentially turn off each relay (1-24)
 
  // First control the relays on the second PCF8575 (relays 1-8, corresponding to pins 8-15)
  for (int i = 8; i < 16; i++) {
    pcf8575_R3.write(i, HIGH);   // Turn on the relay at pin i (LOW means ON for the relay)
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds
  }

  // First control the relays on the second PCF8575 (relays 9-16, corresponding to pins 8-15)
  for (int i = 8; i < 16; i++) {
    pcf8575_R2.write(i, HIGH);  // Turn off the relay at pin i (HIGH means OFF for the relay)
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds
  }

  // Then control the relays on the first PCF8575 (relays 17-32)
  for (int i = 0; i < 16; i++) {
    pcf8575_R1.write(i, HIGH);  // Turn off the relay at pin i (HIGH means OFF for the relay)
    delay(DELAY_TIME);          // Wait for DELAY_TIME milliseconds
  }
}
arduino ino file download:

.zip   1-relay.zip (Size: 1.08 KB / Downloads: 88)
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: 197.73 KB / Downloads: 82)

Print this item

  F32 ESPHome yaml for home assistant without tuya
Posted by: admin - 11-03-2025, 11:22 PM - Forum: F32 - Replies (2)

Code:
esphome:
  name: f32
  friendly_name: f32

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

# Enable logging

logger:
  level: DEBUG 
  hardware_uart: USB_CDC
# Enable Home Assistant API

api:

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_out_1'  # for output channel 17-32
    i2c_id: bus_a
    address: 0x25
    pcf8575: true

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

  - id: 'pcf8574_hub_out_in_2'  # for output channel 9-16  + (input 17-24)
    i2c_id: bus_a
    address: 0x26
    pcf8575: true

  - id: 'pcf8574_hub_out_in_3'  # for output channel 1-8  + (input 17-24)
    i2c_id: bus_a
    address: 0x27
    pcf8575: true

uart:
  - id: uart_1    #RS485
    baud_rate: 9600
    debug:
      direction: BOTH
      dummy_receiver: true
      after:
        timeout: 10ms
    tx_pin: 16
    rx_pin: 17

switch:
  - platform: uart
    uart_id: uart_1
    name: "RS485 Button"
    data: [0x11, 0x22, 0x33, 0x44, 0x55]

  - platform: gpio
    name: "f32-output01"
    id: "f32_output01"
    pin:
      pcf8574: pcf8574_hub_out_in_3
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output02"
    id: "f32_output02"
    pin:
      pcf8574: pcf8574_hub_out_in_3
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output03"
    id: "f32_output03"
    pin:
      pcf8574: pcf8574_hub_out_in_3
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output04"
    id: "f32_output04"
    pin:
      pcf8574: pcf8574_hub_out_in_3
      number: 11
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output05"
    id: "f32_output05"
    pin:
      pcf8574: pcf8574_hub_out_in_3
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output06"
    id: "f32_output06"
    pin:
      pcf8574: pcf8574_hub_out_in_3
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output07"
    id: "f32_output07"
    pin:
      pcf8574: pcf8574_hub_out_in_3
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output08"
    id: "f32_output08"
    pin:
      pcf8574: pcf8574_hub_out_in_3
      number: 15
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output09"
    id: "f32_output09"
    pin:
      pcf8574: pcf8574_hub_out_in_2
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output10"
    id: "f32_output10"
    pin:
      pcf8574: pcf8574_hub_out_in_2
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output11"
    id: "f32_output11"
    pin:
      pcf8574: pcf8574_hub_out_in_2
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output12"
    id: "f32_output12"
    pin:
      pcf8574: pcf8574_hub_out_in_2
      number: 15
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output13"
    id: "f32_output13"
    pin:
      pcf8574: pcf8574_hub_out_in_2
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output14"
    id: "f32_output14"
    pin:
      pcf8574: pcf8574_hub_out_in_2
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output15"
    id: "f32_output15"
    pin:
      pcf8574: pcf8574_hub_out_in_2
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output16"
    id: "f32_output16"
    pin:
      pcf8574: pcf8574_hub_out_in_2
      number: 11
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output17"
    id: "f32_output17"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output18"
    id: "f32_output18"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output19"
    id: "f32_output19"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output20"
    id: "f32_output20"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output21"
    id: "f32_output21"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output22"
    id: "f32_output22"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output23"
    id: "f32_output23"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output24"
    id: "f32_output24"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output25"
    id: "f32_output25"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output26"
    id: "f32_output26"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output27"
    id: "f32_output27"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output28"
    id: "f32_output28"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 11
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output29"
    id: "f32_output29"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output30"
    id: "f32_output30"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output31"
    id: "f32_output31"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "f32-output32"
    id: "f32_output32"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 15
      mode: OUTPUT
      inverted: true


binary_sensor:
  - platform: gpio
    name: "f32-input01"
    id: "f32_input01"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input02"
    id: "f32_input02"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input03"
    id: "f32_input03"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input04"
    id: "f32_input04"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input05"
    id: "f32_input05"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input06"
    id: "f32_input06"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input07"
    id: "f32_input07"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input08"
    id: "f32_input08"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input09"
    id: "f32_input09"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 8
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input10"
    id: "f32_input10"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 9
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input11"
    id: "f32_input11"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 10
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input12"
    id: "f32_input12"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 11
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input13"
    id: "f32_input13"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 12
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input14"
    id: "f32_input14"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 13
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input15"
    id: "f32_input15"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 14
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input16"
    id: "f32_input16"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 15
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "f32-input17"
    id: "f32_input17"
    pin:
      pcf8574: pcf8574_hub_out_in_2
      number: 0
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "f32-input18"
    id: "f32_input18"
    pin:
      pcf8574: pcf8574_hub_out_in_2
      number: 1
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "f32-input19"
    id: "f32_input19"
    pin:
      pcf8574: pcf8574_hub_out_in_2
      number: 2
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "f32-input20"
    id: "f32_input20"
    pin:
      pcf8574: pcf8574_hub_out_in_2
      number: 3
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "f32-input21"
    id: "f32_input21"
    pin:
      pcf8574: pcf8574_hub_out_in_2
      number: 4
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "f32-input22"
    id: "f32_input22"
    pin:
      pcf8574: pcf8574_hub_out_in_2
      number: 5
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "f32-input23"
    id: "f32_input23"
    pin:
      pcf8574: pcf8574_hub_out_in_2
      number: 6
      mode: INPUT
      inverted: true


  - platform: gpio
    name: "f32-input24"
    id: "f32_input24"
    pin:
      pcf8574: pcf8574_hub_out_in_2
      number: 7
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input25"
    id: "f32_input25"
    pin:
      pcf8574: pcf8574_hub_out_in_3
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input26"
    id: "f32_input26"
    pin:
      pcf8574: pcf8574_hub_out_in_3
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input27"
    id: "f32_input27"
    pin:
      pcf8574: pcf8574_hub_out_in_3
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input28"
    id: "f32_input28"
    pin:
      pcf8574: pcf8574_hub_out_in_3
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input29"
    id: "f32_input29"
    pin:
      pcf8574: pcf8574_hub_out_in_3
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input30"
    id: "f32_input30"
    pin:
      pcf8574: pcf8574_hub_out_in_3
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input31"
    id: "f32_input31"
    pin:
      pcf8574: pcf8574_hub_out_in_3
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "f32-input32"
    id: "f32_input32"
    pin:
      pcf8574: pcf8574_hub_out_in_3
      number: 7
      mode: INPUT
      inverted: true

##pull-up resistance on PCB
  - platform: gpio
    name: "f32-W1-io48"
    pin:
      number: 48
      inverted: true

  - platform: gpio
    name: "f32-W1-io47"
    pin:
      number: 47
      inverted: true

  - platform: gpio
    name: "f32-W1-io21"
    pin:
      number: 21
      inverted: true

  - platform: gpio
    name: "f32-W1-io15"
    pin:
      number: 15
      inverted: true
## without resistance on PCB
  - platform: gpio
    name: "f32-W1-io13"
    pin:
      number: 13
      inverted: false

  - platform: gpio
    name: "f32-W1-io14"
    pin:
      number: 14
      inverted:  false

  - platform: gpio
    name: "f32-433M"
    pin:
      number: 40
      inverted:  false

sensor:
  - platform: adc
    pin: 5
    name: "f32 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;
          }
  - platform: adc
    pin: 7
    name: "f32 A2 Voltage"
    update_interval: 5s
    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: "f32 A3 Current"
    update_interval: 5s
    unit_of_measurement: mA
    attenuation: 11db
    filters:
      - multiply: 6.66666666
  - platform: adc
    pin: 4
    name: "f32 A4 Current"
    update_interval: 5s
    unit_of_measurement: mA
    attenuation: 11db
    filters:
      - multiply: 6.66666666

web_server:
  port: 80

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), "KinCony F32");
download yaml file:

.txt   F32-HA-without-tuya.txt (Size: 14.25 KB / Downloads: 98)

Print this item

  F32 ESP32-S3 IO pins define
Posted by: admin - 11-03-2025, 11:21 PM - Forum: F32 - Replies (2)

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:U27 (relay17-32) i2c address:0x25
PCF8575:U23 (DI1-16) i2c address:0x24
PCF8575:U49 i2c address: 0x26
  PCF8575(pin number0-7): DI17-24
  PCF8575(pin number8-11): relay13-16
  PCF8575(pin number12-15): relay9-12

PCF8575:U62 i2c address: 0x27
  PCF8575(pin number0-7)Big GrinI25-32
  PCF8575(pin number8-15):relay1-8


if config by ESPHome:

relay9: pcf8575(U49) number:12
relay10: pcf8575(U49) number:13
relay11: pcf8575(U49) number:14
relay12: pcf8575(U49) number:15
relay13: pcf8575(U49) number:8
relay14: pcf8575(U49) number:9
relay15: pcf8575(U49) number:10
relay16: pcf8575(U49) number:11

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:GPIO17
TXD:GPIO16
--------------------
Tuya module:
RXD:GPIO38
TXD:GPIO39

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

---------------------
1-wire (pull-up resistance on PCB):
1-wire1:GPIO48
1-wire2:GPIO47
1-wire3:GPIO21
1-wire4:GPIO15

1-wire (without resistance on PCB):
1-wire1:GPIO13
1-wire2:GPIO14
------------------------
SD Card:
SPI-MOSI:GPIO10
SPI-SCK:GPIO11
SPI-MISO:GPIO12
SPI-CS:GPIO9
------------------------
24C02 EPROM i2c address: 0x50
DS3231 RTC i2c address: 0x68
SSD1306 display: i2c address:0x3c

Print this item

  Using KC868_A8 as switch
Posted by: dco333 - 11-02-2025, 03:52 PM - Forum: KC868-A8 - Replies (3)

Hi

I want to use the board as a switch with the relays.
I have installed KCS Firmware 2.2.14 and activated MQTT to my MQTT broker on Home Assistant.
I followed the instructions with the configuration.yaml File and also replaced all serials by mine.
I can see the switches in HomeAssistant. But when I push the switches, nothing happens on the board. No relay is clicking.

I think I missed something. What else do I have to configure in the KCS Firmware Gui to switch the relays?
I've read many tutorials, intructions and so on, but I don't understand it how to switch the relays.
Also in the KCS Gui I didn't find any switches to test is.
I think, there has to be configured more in the firmware.

I hope to get any adice from you.

Regards
dco333

Print this item

  Update ESPHome-Firmware 2023.12.9 -> 2025.10.1
Posted by: Nobby888 - 11-02-2025, 03:01 PM - Forum: KC868-E16S/E16P - Replies (1)

Hi Community,

friend of mine had ordered a Tiny House and long story short: she was left alone with her automation in HomeAssistant.

First Problem:
- she got screwed with the server. HomeAssistant-OS (HAOS) didn't work and we couldn't reinstall it, because the PC was toast. So we ordered a new Mini-PC (with an Intel N150, 8GB Ram and 500GB NVMe-SSD) and installed HAOS (Version 2025.something) and HACS. We installed the Backup-File (stored on Google) and because there was already a version-gap from 2023 (the time they originally installed HomeAssistant) and 2025 (the time we are trying to fix it) I wanted to update the whole system and the modules in HAOS.

And now the probelm:
I want to update the ESPHome firmware of the KC868-E16S over OTA. Because of the Version-gap between ESPHome-Builder and the Frimware of the relay-module the integration doesn't work properly in HAOS.

Hardware: KC868-E16S
The Version of ESP Home Builder: 2025.10.1
The Version of the ESP Home Firmware 2023.12.9


I found out, that there are a lot of changes over the time, so I already made some changes in the original YAML-File (see attachet):
- adding on OTA: platform: esphome
- changed "dallas" to "one-wire"
but I could not make an OTA.

After trying to make an OTA I get the attachet message.
   

Please help! What am I doing wrong? What am I missing? Could you please correct the YAML-file?!
And please avoid: "Why did you update?! Never touch a running system ... well, it wasn't running and I like an up-to-date-system"

Thank you so much for your help!!



Attached Files
.txt   Relay modul.txt (Size: 9.78 KB / Downloads: 65)
Print this item

  KinCony AG Pro Wireless ALL IN ONE Controller
Posted by: fdcemb5 - 11-01-2025, 08:12 AM - Forum: KC868-AG / AG Pro / AG8 / Z1 - Replies (1)

My gateway refused to connect, as shown in the attached picture. It was working before, but it started misbehaving recently. See attached picture for your help



Attached Files Thumbnail(s)
   
Print this item

  kc868-server16
Posted by: fdcemb5 - 11-01-2025, 08:05 AM - Forum: KC868-Server Raspberry Pi4 local server - Replies (4)

My server started behaving strangely yesterday, showing 'out of memory,' and a process was killed during the update of the ESPHome device. I have tried but could not resolve the issue. Any help will be appreciated. See picture



Attached Files Image(s)
   
Print this item