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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 8,445
» Latest member: silloka9
» Forum threads: 3,702
» Forum posts: 19,058

Full Statistics

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

Latest Threads
KC868-E16T added Tuya mod...
Forum: KC868-E16T
Last Post: admin
1 hour ago
» Replies: 8
» Views: 1,693
N20 CT Shorting terminal ...
Forum: N20
Last Post: admin
1 hour ago
» Replies: 3
» Views: 47
Problem with KCS flash af...
Forum: "KCS" v2 firmware system
Last Post: tidek1507
Today, 12:39 AM
» Replies: 4
» Views: 29
Bulk IFTTT mapping
Forum: "KCS" v3 firmware
Last Post: admin
Today, 12:18 AM
» Replies: 1
» Views: 16
flash kc868-a4
Forum: KC868-A series and Uair Smart Controller
Last Post: Michel.nadin
Yesterday, 03:24 PM
» Replies: 21
» Views: 687
KC868-A16 ethernet work w...
Forum: KC868-A16
Last Post: Konstantin
Yesterday, 12:18 PM
» Replies: 17
» Views: 16,172
E16P Case / Cover
Forum: KC868-E16S/E16P
Last Post: admin
Yesterday, 01:38 AM
» Replies: 1
» Views: 14
B8M Schematic
Forum: B8M
Last Post: admin
Yesterday, 01:37 AM
» Replies: 5
» Views: 41
"KCS" v3.19.0 firmware BI...
Forum: "KCS" v3 firmware
Last Post: admin
Yesterday, 01:36 AM
» Replies: 2
» Views: 145
F32 and 433 Mhz
Forum: F32
Last Post: admin
01-15-2026, 11:25 PM
» Replies: 3
» Views: 16

  [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: 99)
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: 86)

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: 105)

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: 67)
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

  Using 24VAC with KC868-A16 Board Outputs
Posted by: Roselrade - 11-01-2025, 04:27 AM - Forum: KC868-HxB series Smart Controller - Replies (3)

I’ve recently got this board and intend to use it for operating several valves.
Could someone confirm if it’s possible to run 24 VAC through the output channels?
Thanks in advance!

Print this item

  Request for Technical Support – Controlling KC868-A8 Relays via Physical Buttons
Posted by: sson6203 - 10-31-2025, 08:47 AM - Forum: KC868-A8 - Replies (1)

1. 현재 설정
현재 MQTTHTTP 명령을 통해 KC868-A8 장치 의 릴레이를 제어하고 있습니다 .
(설치는 사진 1 에 표시된 지침에 따라 수행되었습니다 .)


2. 목표
물리적인 푸시 버튼을 사용하여 각 릴레이 채널(CH1~CH8)을 제어하고 싶습니다 .
물리적 버튼을 누르면 해당 릴레이가 토글되어야 하며, MQTT 상태도 그에 따라 업데이트되어 Home Assistant(HA) 토글도 실시간으로 변경되어야 합니다.


3. 문제 이를 달성하기 위해 여러 Arduino IDE 스케치를 시도했지만( 사진 2~7
참조 ) 컴파일 타임 오류가 발생했습니다.

========================
#error 이 코드는 ESP32 플랫폼에서 실행되도록 설계되었습니다! 도구->보드 설정을 확인하세요.
종료 상태 1
========================


보드 설정을 올바르게 구성하는 방법이나 MQTT 작업과 함께 물리적 버튼 제어를 구현하는 방법을 잘 모르겠습니다.



4. 요청
다음 사항에 대한 단계별 지침(초보자 수준)을 제공해 주세요 .



Attached Files Thumbnail(s)
                   

Image(s)
       
Print this item

  KC868-A16 - IP & PORT ?? Important !!!
Posted by: Guele1 - 10-29-2025, 07:28 PM - Forum: KC868-A16 - Replies (9)

KC868-A16 - IP & PORT ?? Important !!!

I would like to control my KC868-A16 (V1.6) module using my mobile phone within my local network (without Internet access).
When setting up the "K-Box Smart" (version 2.0.9) software, I’m asked to enter the IP address and PORT XXXX
The module is connected via LAN cable to my Fritz!Box 7530 router.
I was able to find the IP address in the router menu, but I’m not sure which port number I should enter in the app or where to find it.
Could someone please explain:

which port I should use for the KC868-A16, and
whether a port configuration is needed in the Fritz!Box
if I only want to use the system within my local network (without Internet access)?

Thank you very much for your support!

Best regards,
Günter Lehner

Print this item