Documentazione

Last modified by Micky Grillo on 2023/02/24 00:32

Pinout

http://192.168.82.200:2665/uploads/images/gallery/2023-02/kc868-e16s-1-04.jpg

I modelli che abbiamo acquistato usano 12V come alimentazione

I relays sono OMRON G2R-1-E

Schematica

http://192.168.82.200:2665/uploads/images/gallery/2023-02/2023-02-02-00-21-51-kc868-e16s-schematic-pdf-adobe-acrobat-reader-64-bit.png

KC868-E16S-schematic.pdf

Definizione e esempio YAML

Definizione:

ANALOG_A1  GPIO36
ANALOG_A2  GPIO35
ANALOG_A3  GPIO34
ANALOG_A4  GPIO39

IIC SDA:GPIO16
IIC SCL:GPIO15

PCF8574:U27 (relay1-8): 100 001 = 0x21
PCF8574:U28 (relay9-16): 100 101 = 0x25

PCF8574:U23 (DI1-8): 100 010 = 0x22
PCF8574:U24 (DI9-16): 100 100 = 0x24

RF433MHz wireless receiver: GPIO4

BEEP:GPIO2

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:GPIO13
TXD:GPIO32

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

YAML:

esphome:
 name: kc868-e16s
 platform: ESP32
 board: esp32dev
 
 
# Example configuration entry for ESP32
i2c:
 sda: 16
 scl: 15
 scan: true
 id: bus_a


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

 # Optional manual IP
#   manual_ip:
#    static_ip: 192.168.1.199
#    gateway: 192.168.1.1
#    subnet: 255.255.255.0  


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

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

  - id: 'pcf8574_hub_in_1'  # for input channel 1-8
   address: 0x22

  - id: 'pcf8574_hub_in_2'  # for input channel 9-16
   address: 0x24

# Individual outputs
switch:
  - platform: gpio
   name: "e16s-output1"
   pin:
     pcf8574: pcf8574_hub_out_1
     number: 0
     mode: OUTPUT
     inverted: true

  - platform: gpio
   name: "e16s-output2"
   pin:
     pcf8574: pcf8574_hub_out_1
     number: 1
     mode: OUTPUT
     inverted: true
     
  - platform: gpio
   name: "e16s-output3"
   pin:
     pcf8574: pcf8574_hub_out_1
     number: 2
     mode: OUTPUT
     inverted: true
     
  - platform: gpio
   name: "e16s-output4"
   pin:
     pcf8574: pcf8574_hub_out_1
     number: 3
     mode: OUTPUT
     inverted: true
     
  - platform: gpio
   name: "e16s-output5"
   pin:
     pcf8574: pcf8574_hub_out_1
     number: 4
     mode: OUTPUT
     inverted: true
     
  - platform: gpio
   name: "e16s-output6"
   pin:
     pcf8574: pcf8574_hub_out_1
     number: 5
     mode: OUTPUT
     inverted: true

  - platform: gpio
   name: "e16s-output7"
   pin:
     pcf8574: pcf8574_hub_out_1
     number: 6
     mode: OUTPUT
     inverted: true
     
  - platform: gpio
   name: "e16s-output8"
   pin:
     pcf8574: pcf8574_hub_out_1
     number: 7
     mode: OUTPUT
     inverted: true
     
  - platform: gpio
   name: "e16s-output9"
   pin:
     pcf8574: pcf8574_hub_out_2
     number: 0
     mode: OUTPUT
     inverted: true

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

  - platform: gpio
   name: "e16s-output11"
   pin:
     pcf8574: pcf8574_hub_out_2
     number: 2
     mode: OUTPUT
     inverted: true
     
  - platform: gpio
   name: "e16s-output12"
   pin:
     pcf8574: pcf8574_hub_out_2
     number: 3
     mode: OUTPUT
     inverted: true
     
  - platform: gpio
   name: "e16s-output13"
   pin:
     pcf8574: pcf8574_hub_out_2
     number: 4
     mode: OUTPUT
     inverted: true
     
  - platform: gpio
   name: "e16s-output14"
   pin:
     pcf8574: pcf8574_hub_out_2
     number: 5
     mode: OUTPUT
     inverted: true
     
  - platform: gpio
   name: "e16s-output15"
   pin:
     pcf8574: pcf8574_hub_out_2
     number: 6
     mode: OUTPUT
     inverted: true
     
  - platform: gpio
   name: "e16s-output16"
   pin:
     pcf8574: pcf8574_hub_out_2
     number: 7
     mode: OUTPUT
     inverted: true
     
binary_sensor:
  - platform: gpio
   name: "e16s-input1"
   pin:
     pcf8574: pcf8574_hub_in_1
     number: 0
     mode: INPUT
     inverted: true

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

# Enable logging
logger:

# Enable Home Assistant API
api: