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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,660
» Latest member: fv88vnnett
» Forum threads: 4,195
» Forum posts: 20,846

Full Statistics

Online Users
There are currently 42 online users.
» 0 Member(s) | 28 Guest(s)
Amazonbot, Crawl, Google, PetalBot, Semrush, bot

Latest Threads
KCS VERSUS ESPHOME
Forum: "KCS" v3 firmware
Last Post: EDVALDO DE MARINGA
5 hours ago
» Replies: 2
» Views: 29
KC868-AGv3
Forum: Getting Started with ESPHome and Home Assistant
Last Post: admin
08-20-2026, 10:18 PM
» Replies: 5
» Views: 75
[arduino code examples fo...
Forum: KC868-A32/A32 Pro
Last Post: huanmarie
08-19-2026, 07:09 AM
» Replies: 2
» Views: 1,595
KC868-H32B V5.08 firmware
Forum: News
Last Post: meoowu77
08-18-2026, 11:46 AM
» Replies: 24
» Views: 8,428
KinCony B2 Smart Controll...
Forum: News
Last Post: admin
08-17-2026, 01:07 PM
» Replies: 0
» Views: 51
KC868-A8v3 PCB layout CAD...
Forum: Schematic & diagram & Dimensions of KinCony PCB layout CAD file
Last Post: admin
08-17-2026, 08:44 AM
» Replies: 0
» Views: 58
CT Clamp Compatibility
Forum: KC868-M16 / M1 / MB / M30
Last Post: admin
08-16-2026, 11:08 PM
» Replies: 12
» Views: 2,071
N60 Sensor channel label
Forum: N60
Last Post: marekd1
08-14-2026, 09:14 PM
» Replies: 18
» Views: 2,473
solar production and cons...
Forum: N30
Last Post: admin
08-14-2026, 01:46 AM
» Replies: 3
» Views: 133
Current direction detecti...
Forum: N30
Last Post: admin
08-14-2026, 01:44 AM
» Replies: 3
» Views: 121

Wink [Arduino IDE demo source code for KC868-A32]--#04-PCF8574-DI
Posted by: KinCony Support - 03-24-2022, 06:53 AM - Forum: KC868-A32/A32 Pro - No Replies

Code:
/*
KeyPressed on PIN1
by Mischianti Renzo <http://www.mischianti.org>

https://www.mischianti.org/2019/01/02/pcf8574-i2c-digital-i-o-expander-fast-easy-usage/
*/

#include "Arduino.h"
#include "PCF8574.h"


// Instantiate Wire for generic use at 400kHz
TwoWire I2Cone = TwoWire(0);
// Instantiate Wire for generic use at 100kHz
TwoWire I2Ctwo = TwoWire(1);

// Set i2c address
PCF8574 pcf8574_I1(0x24);
PCF8574 pcf8574_I2(0x25);
PCF8574 pcf8574_I3(0x21);
PCF8574 pcf8574_I4(0x22);



unsigned long timeElapsed;
void setup()
{
    Serial.begin(115200);
    delay(1000);

//    pcf8574.pinMode(P0, OUTPUT);
pcf8574_I1.pinMode(P0, INPUT);
pcf8574_I1.pinMode(P1, INPUT);
pcf8574_I1.pinMode(P2, INPUT);
pcf8574_I1.pinMode(P3, INPUT);
pcf8574_I1.pinMode(P4, INPUT);
pcf8574_I1.pinMode(P5, INPUT);
pcf8574_I1.pinMode(P6, INPUT);
pcf8574_I1.pinMode(P7, INPUT);

pcf8574_I2.pinMode(P0, INPUT);
pcf8574_I2.pinMode(P1, INPUT);
pcf8574_I2.pinMode(P2, INPUT);
pcf8574_I2.pinMode(P3, INPUT);
pcf8574_I2.pinMode(P4, INPUT);
pcf8574_I2.pinMode(P5, INPUT);
pcf8574_I2.pinMode(P6, INPUT);
pcf8574_I2.pinMode(P7, INPUT);

pcf8574_I3.pinMode(P0, INPUT);
pcf8574_I3.pinMode(P1, INPUT);
pcf8574_I3.pinMode(P2, INPUT);
pcf8574_I3.pinMode(P3, INPUT);
pcf8574_I3.pinMode(P4, INPUT);
pcf8574_I3.pinMode(P5, INPUT);
pcf8574_I3.pinMode(P6, INPUT);
pcf8574_I3.pinMode(P7, INPUT);

pcf8574_I4.pinMode(P0, INPUT);
pcf8574_I4.pinMode(P1, INPUT);
pcf8574_I4.pinMode(P2, INPUT);
pcf8574_I4.pinMode(P3, INPUT);
pcf8574_I4.pinMode(P4, INPUT);
pcf8574_I4.pinMode(P5, INPUT);
pcf8574_I4.pinMode(P6, INPUT);
pcf8574_I4.pinMode(P7, INPUT);



    Serial.print("Init pcf8574...");
    if (pcf8574_I1.begin()){
        Serial.println("pcf8574_I1_OK");
    }else{
        Serial.println("pcf8574_I1_KO");
    }

  Serial.print("Init pcf8574...");
  if (pcf8574_I2.begin()){
    Serial.println("pcf8574_I2_OK");
  }else{
    Serial.println("pcf8574_I2_KO");
  }

  Serial.print("Init pcf8574_I3...");
  if (pcf8574_I3.begin()){
    Serial.println("pcf8574_I3_OK");
  }else{
    Serial.println("pcf8574_I3_KO");
  }

  Serial.print("Init pcf8574_I4...");
  if (pcf8574_I4.begin()){
    Serial.println("pcf8574_I4_OK");
  }else{
    Serial.println("pcf8574_I4_KO");
  }

}

void loop()
{
uint8_t val1 = pcf8574_I1.digitalRead(P0);
uint8_t val2 = pcf8574_I1.digitalRead(P1);
uint8_t val3 = pcf8574_I1.digitalRead(P2);
uint8_t val4 = pcf8574_I1.digitalRead(P3);
uint8_t val5 = pcf8574_I1.digitalRead(P4);
uint8_t val6 = pcf8574_I1.digitalRead(P5);
uint8_t val7 = pcf8574_I1.digitalRead(P6);
uint8_t val8 = pcf8574_I1.digitalRead(P7);

uint8_t val9 = pcf8574_I2.digitalRead(P0);
uint8_t val10 = pcf8574_I2.digitalRead(P1);
uint8_t val11 = pcf8574_I2.digitalRead(P2);
uint8_t val12 = pcf8574_I2.digitalRead(P3);
uint8_t val13 = pcf8574_I2.digitalRead(P4);
uint8_t val14 = pcf8574_I2.digitalRead(P5);
uint8_t val15 = pcf8574_I2.digitalRead(P6);
uint8_t val16 = pcf8574_I2.digitalRead(P7);


uint8_t val17 = pcf8574_I3.digitalRead(P0);
uint8_t val18 = pcf8574_I3.digitalRead(P1);
uint8_t val19 = pcf8574_I3.digitalRead(P2);
uint8_t val20 = pcf8574_I3.digitalRead(P3);
uint8_t val21 = pcf8574_I3.digitalRead(P4);
uint8_t val22 = pcf8574_I3.digitalRead(P5);
uint8_t val23 = pcf8574_I3.digitalRead(P6);
uint8_t val24 = pcf8574_I3.digitalRead(P7);


uint8_t val25 = pcf8574_I4.digitalRead(P0);
uint8_t val26 = pcf8574_I4.digitalRead(P1);
uint8_t val27 = pcf8574_I4.digitalRead(P2);
uint8_t val28 = pcf8574_I4.digitalRead(P3);
uint8_t val29 = pcf8574_I4.digitalRead(P4);
uint8_t val30 = pcf8574_I4.digitalRead(P5);
uint8_t val31 = pcf8574_I4.digitalRead(P6);
uint8_t val32 = pcf8574_I4.digitalRead(P7);
 
if (val1==LOW) Serial.println("KEY1 PRESSED");
if (val2==LOW) Serial.println("KEY2 PRESSED");
if (val3==LOW) Serial.println("KEY3 PRESSED");
if (val4==LOW) Serial.println("KEY4 PRESSED");
if (val5==LOW) Serial.println("KEY5 PRESSED");
if (val6==LOW) Serial.println("KEY6 PRESSED");
if (val7==LOW) Serial.println("KEY7 PRESSED");
if (val8==LOW) Serial.println("KEY8 PRESSED");

if (val9==LOW) Serial.println("KEY9 PRESSED");
if (val10==LOW) Serial.println("KEY10 PRESSED");
if (val11==LOW) Serial.println("KEY11 PRESSED");
if (val12==LOW) Serial.println("KEY12 PRESSED");
if (val13==LOW) Serial.println("KEY13 PRESSED");
if (val14==LOW) Serial.println("KEY14 PRESSED");
if (val15==LOW) Serial.println("KEY15 PRESSED");
if (val16==LOW) Serial.println("KEY16 PRESSED");

if (val17==LOW) Serial.println("KEY17 PRESSED");
if (val18==LOW) Serial.println("KEY18 PRESSED");
if (val19==LOW) Serial.println("KEY19 PRESSED");
if (val20==LOW) Serial.println("KEY20 PRESSED");
if (val21==LOW) Serial.println("KEY21 PRESSED");
if (val22==LOW) Serial.println("KEY22 PRESSED");
if (val23==LOW) Serial.println("KEY23 PRESSED");
if (val24==LOW) Serial.println("KEY24 PRESSED");

if (val25==LOW) Serial.println("KEY25 PRESSED");
if (val26==LOW) Serial.println("KEY26 PRESSED");
if (val27==LOW) Serial.println("KEY27 PRESSED");
if (val28==LOW) Serial.println("KEY28 PRESSED");
if (val29==LOW) Serial.println("KEY29 PRESSED");
if (val30==LOW) Serial.println("KEY30 PRESSED");
if (val31==LOW) Serial.println("KEY31 PRESSED");
if (val32==LOW) Serial.println("KEY32 PRESSED");
    delay(300);
}
       

Print this item

Wink [Arduino IDE demo source code for KC868-A32]--#03-Nextion TFT LCD Display
Posted by: KinCony Support - 03-24-2022, 06:34 AM - Forum: KC868-A32/A32 Pro - No Replies

Code:
int i=0;

void setup()
{
Serial2.begin(9600);
}

void loop()
{
i++;
if (i==100) i=0;

Serial2.print("n0.val=");
Serial2.print(i);
Serial2.write(0xff);
Serial2.write(0xff);
Serial2.write(0xff);
delay(200);

}
   

Print this item

Wink [Arduino IDE demo source code for KC868-A32]--#02-LAN8720_UDP
Posted by: KinCony Support - 03-24-2022, 06:29 AM - Forum: KC868-A32/A32 Pro - No Replies

Code:
#include <ETH.h>
#include <WiFiUdp.h>

#define ETH_ADDR        0
#define ETH_POWER_PIN  -1
#define ETH_MDC_PIN    23
#define ETH_MDIO_PIN   18
#define ETH_TYPE       ETH_PHY_LAN8720
#define ETH_CLK_MODE   ETH_CLOCK_GPIO17_OUT

WiFiUDP Udp;                      //Create UDP object
unsigned int localUdpPort = 4196; //local port
IPAddress local_ip(192, 168, 1, 200);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress dns(192, 168, 1, 1);

void setup()
{
  Serial.begin(115200);
  Serial.println();
   
  ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE); //start with ETH

  // write confir for static IP, gateway,subnet,dns1,dns2
  if (ETH.config(local_ip, gateway, subnet, dns, dns) == false) {
    Serial.println("LAN8720 Configuration failed.");
  }else{Serial.println("LAN8720 Configuration success.");}
 
/* while(!((uint32_t)ETH.localIP())) //wait for IP
  {

  }*/
  Serial.println("Connected");
  Serial.print("IP Address:");
  Serial.println(ETH.localIP());

  Udp.begin(localUdpPort); //begin UDP listener
}

void loop()
{
  int packetSize = Udp.parsePacket(); //get package size
  if (packetSize)                     //if have received data
  {
    char buf[packetSize];
    Udp.read(buf, packetSize); //read current data

    Serial.println();
    Serial.print("Received: ");
    Serial.println(buf);
    Serial.print("From IP: ");
    Serial.println(Udp.remoteIP());
    Serial.print("From Port: ");
    Serial.println(Udp.remotePort());

    Udp.beginPacket(Udp.remoteIP(), Udp.remotePort()); //ready to send data
    Udp.print("Received: ");   
    Udp.write((const uint8_t*)buf, packetSize); //copy data to sender buffer
    Udp.endPacket();            //send data
  }
}
   

Print this item

Wink [Arduino IDE demo source code for KC868-A32]--#01-ADC_INOUT
Posted by: KinCony Support - 03-24-2022, 06:22 AM - Forum: KC868-A32/A32 Pro - No Replies

Code:
#include "Arduino.h"

#define ANALOG_A1   39
#define ANALOG_A2   34
#define ANALOG_A3   36
#define ANALOG_A4   35

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

  pinMode(ANALOG_A1,INPUT);
  pinMode(ANALOG_A2,INPUT);
  pinMode(ANALOG_A3,INPUT);
  pinMode(ANALOG_A4,INPUT);
}

void loop()
{
  delay(500);
  Serial.printf("Current Reading A1 on Pin(%d)=%d\n",ANALOG_A1,analogRead(ANALOG_A1));
  Serial.printf("Current Reading A2 on Pin(%d)=%d\n",ANALOG_A2,analogRead(ANALOG_A2));
  Serial.printf("Current Reading A1 on Pin(%d)=%d\n",ANALOG_A3,analogRead(ANALOG_A3));
  Serial.printf("Current Reading A2 on Pin(%d)=%d\n",ANALOG_A4,analogRead(ANALOG_A4));
}
   

Print this item

  KC868-A32 configure for ESPhome
Posted by: admin - 03-23-2022, 12:36 PM - Forum: KC868-A32/A32 Pro - Replies (29)

esphome:
  name: a32
  platform: ESP32
  board: esp32dev


# Enable logging
logger:

# Enable Home Assistant API
api:


# Example configuration entry
i2c:
  - id: bus_a
    sda: 15
    scl: 13
    scan: true
  - id: bus_b
    sda: 4
    scl: 5
    scan: true
   

# Example configuration entry
ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0

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

  - id: 'pcf8574_hub_out_2'  # for output channel 9-16
    i2c_id: bus_a
    address: 0x25

  - id: 'pcf8574_hub_out_3'  # for output channel 17-24
    i2c_id: bus_a
    address: 0x21

  - id: 'pcf8574_hub_out_4'  # for output channel 25-32
    i2c_id: bus_a
    address: 0x22
   
  - id: 'pcf8574_hub_in_1'  # for input channel 1-8
    i2c_id: bus_b
    address: 0x24

  - id: 'pcf8574_hub_in_2'  # for input channel 9-16
    i2c_id: bus_b
    address: 0x25

  - id: 'pcf8574_hub_in_3'  # for input channel 17-24
    i2c_id: bus_b
    address: 0x21

  - id: 'pcf8574_hub_in_4'  # for input channel 25-32
    i2c_id: bus_b
    address: 0x22   
   
# Individual outputs
switch:
  - platform: gpio
    name: "light1"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light2"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light3"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light4"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "light5"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light6"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light7"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light8"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 7
      mode: OUTPUT
      inverted: true


  - platform: gpio
    name: "light9"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light10"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light11"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light12"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "light13"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light14"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light15"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light16"
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 7
      mode: OUTPUT
      inverted: true
     
     
  - platform: gpio
    name: "light17"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light18"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light19"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light20"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "light21"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light22"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light23"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light24"
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 7
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "light25"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light26"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light27"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light28"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "light29"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light30"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light31"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "light32"
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 7
      mode: OUTPUT
      inverted: true
     
     
     
# Individual outputs
binary_sensor:
  - platform: gpio
    name: "input1"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true

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

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

  - platform: gpio
    name: "input4"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "input5"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true

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

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

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


  - platform: gpio
    name: "input9"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 0
      mode: INPUT
      inverted: true

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

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

  - platform: gpio
    name: "input12"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 3
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "input13"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 4
      mode: INPUT
      inverted: true

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

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

  - platform: gpio
    name: "input16"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 7
      mode: INPUT
      inverted: true
     
     
  - platform: gpio
    name: "input17"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input18"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input19"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input20"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 3
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "input21"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input22"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input23"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input24"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 7
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "input25"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input26"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input27"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input28"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 3
      mode: INPUT
      inverted: true
     
  - platform: gpio
    name: "input29"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input30"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input31"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "input32"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 7
      mode: INPUT
      inverted: true

# Example configuration entry
sensor:
  - platform: adc
    pin: 39
    name: "analog-1"
    update_interval: 10s
    attenuation: 11db

  - platform: adc
    pin: 34
    name: "analog-2"
    update_interval: 10s
    attenuation: 11db
   
  - platform: adc
    pin: 36
    name: "analog-3"
    update_interval: 10s
    attenuation: 11db
   
  - platform: adc
    pin: 35
    name: "analog-4"
    update_interval: 10s
    attenuation: 11db

Print this item

  KC868-A32 ESP32 I/O pin define
Posted by: admin - 03-23-2022, 12:35 PM - Forum: KC868-A32/A32 Pro - Replies (3)

#define ANALOG_A1  GPIO39
#define ANALOG_A2  GPIO34
#define ANALOG_A3  GPIO36
#define ANALOG_A4  GPIO35

IIC Bus:A

SDA-A:GPIO15
SCL-A:GPIO13

PCF8574:U16 (relay1-8): 100 100 = 0x24
PCF8574:U32 (relay9-16): 100 101 = 0x25
PCF8574:U58 (relay17-24): 100 001 = 0x21
PCF8574:U59 (relay25-32): 100 010 = 0x22

IIC Bus:B
SDA-B:GPIO4
SCL-B:GPIO5

PCF8574:U14 (DI1-8): 100 100 = 0x24
PCF8574:U31 (DI9-16): 100 101 = 0x25
PCF8574:U56 (DI17-24): 100 001 = 0x21
PCF8574:U57 (DI25-32): 100 010 = 0x22

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

Ethernet (LAN8720) I/O define:

#define ETH_ADDR        0
#define ETH_POWER_PIN  -1
#define ETH_MDC_PIN    23
#define ETH_MDIO_PIN  18
#define ETH_TYPE      ETH_PHY_LAN8720
#define ETH_CLK_MODE  ETH_CLOCK_GPIO17_OUT

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

RS485:
RXD:GPIO16
TXD:GPIO14

Extend serial port (3.3v TTL level):
RXD:GPIO33
TXD:GPIO32

Print this item

  KC868-A32 schematic diagram download
Posted by: admin - 03-23-2022, 12:34 PM - Forum: KC868-A32/A32 Pro - No Replies

https://www.kincony.com/download/KC868-A...ematic.pdf

Print this item

  KC868-A32, more information need
Posted by: duky - 03-23-2022, 09:42 AM - Forum: KC868-A32/A32 Pro - Replies (5)

Could you post ESPHome configuration file and schematic?

Thank you.

Print this item

  Lesson7 - install home assistant mobile phone application
Posted by: admin - 03-19-2022, 10:16 PM - Forum: Home automation training courses - No Replies


Configuration in home assistant

    Basic configuration

    default_ config:

    or

    mobile_app:
    discovery:

It is recommended to add this when using iOS app

    ios:

App Download

    iOS: Search and install home assistant directly in the app store

    Android:
        Google Play Store
        https://play.google.com/store/apps/detai...on.android

        GitHub Download
        https://github.com/home-assistant/android/tags

functions for use

Connection information
    Provide configuration of Internet URL address and Intranet URL address
Sensor
Mobile location
Notification
    Push message in Android is based on Google play services.
    You need to obtain the push ID under iOS to use the push message function
    500 messages can be sent every day
More features
  Multimedia message
  Message control mobile phone
  Apple watch

Print this item

  Lesson6 - configure integration of home assistant
Posted by: admin - 03-18-2022, 10:45 PM - Forum: Home automation training courses - No Replies


intergration in Home assistant

1. All integration (components)
https://www.home-assistant.io/integrations/

2. Main functions of integration (component)

Realize the logic of some state generation and change, and realize some services that can be called

3. Configuration of integration (component)

Some can only be in configuration "configuration.yaml" file;
Some can only be configured in the front-end interface;
Some can be configured in both places


Configuring COVID-19 data
https://www.home-assistant.io/integrations/coronavirus/

Configure the moon
   

# Example configuration. yaml entry
sensor:
  - platform: moon

https://www.home-assistant.io/integrations/moon/

Set location of home assistant

how to find out your house latitude and longitude?     https://www.openstreetmap.org/

zone:
  - name: home
    latitude: 30.29595
    longitude: 120.06699
    icon: mdi:home
    radius: 100

Configure the sun
   

Integration and Add-on

Integration is part of home assistant, but Add-on is not
Home assistant loads the integration program through configuration, and home assistant supervisor manages the installation / configuration / startup and shutdown of Add-on

Print this item