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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,150
» Latest member: Mumbaibeautie
» Forum threads: 4,070
» Forum posts: 20,418

Full Statistics

Online Users
There are currently 67 online users.
» 0 Member(s) | 51 Guest(s)
AhrefsBot, Amazonbot, Applebot, Baidu, Bytespider, PetalBot, bot

Latest Threads
ESP32 Smart Controller – ...
Forum: Schematic & diagram & Dimensions of KinCony PCB layout CAD file
Last Post: vojtech
4 minutes ago
» Replies: 4
» Views: 367
connect 2 KC868 to homeas...
Forum: KC868-A16
Last Post: admin
31 minutes ago
» Replies: 1
» Views: 7
B4 Smart Controller Wirin...
Forum: B4
Last Post: vojtech
38 minutes ago
» Replies: 5
» Views: 165
INCREMENTAL ENCODER
Forum: KC868-A8
Last Post: admin
3 hours ago
» Replies: 3
» Views: 22
KC868-A8 OpenPLC Function...
Forum: KC868-A8
Last Post: admin
11 hours ago
» Replies: 0
» Views: 9
"KCS" v3.25.0 firmware BI...
Forum: "KCS" v3 firmware
Last Post: admin
06-07-2026, 01:43 AM
» Replies: 5
» Views: 602
"KCS" v3 Nx energy meter ...
Forum: "KCS" v3 firmware
Last Post: admin
06-07-2026, 01:39 AM
» Replies: 0
» Views: 24
"KCS" v3 TCP/IP Standard ...
Forum: "KCS" v3 firmware
Last Post: admin
06-07-2026, 01:36 AM
» Replies: 0
» Views: 25
"KCS" v3 Modbus RTU over ...
Forum: "KCS" v3 firmware
Last Post: admin
06-07-2026, 01:33 AM
» Replies: 0
» Views: 25
"KCS" v3 RS485 Standard M...
Forum: "KCS" v3 firmware
Last Post: admin
06-07-2026, 01:28 AM
» Replies: 0
» Views: 26

Photo What's H32B firmware how to download
Posted by: kenlgj - 06-10-2025, 09:02 AM - Forum: KC868-HxB series Smart Controller - Replies (3)

dear:  l have a device ATT some photos. can you tell me what's firmware for it?

PLS




Attached Files Thumbnail(s)
           
Print this item

  Sharing My ESP-IDF Project: KC868-A32M and KC868-HAv2 with Modbus
Posted by: mrwolfj - 06-09-2025, 05:20 PM - Forum: DIY Project - Replies (2)

I'm sharing a project I developed using ESP-IDF with the KC868-A32M and KC868-HAv2 boards, incorporating Modbus communication. 

While I won't be continuing active development on this particular project, I wanted to open-source my work to help others who might be embarking on a similar journey.

Developing with these boards and Modbus can present unique challenges, and my aim here is to provide a starting point and demonstrate how I approached the integration using ESP-IDF. 

My hope is that this project will serve as a valuable reference and save you some time and effort in your own development. Feel free to explore the code, adapt it to your needs, and build upon it  Smile

You can find the project files here TrigPLC-ESP

Print this item

  Communication between two A16 over RS485 on ESPHOME with uart not working
Posted by: MarioR - 06-09-2025, 04:50 PM - Forum: KC868-A16 - Replies (5)

Hello,

i would like to have two A16s communicate with uart via the RS485 in the ESPHome.
The two RS485 are cross-connected A=>B and B=>A.

One A16 is the transmitter and the other is the receiver.

When the binary sensor is triggered, a message should be sent to the receiver, which should then trigger an action.

So far the log says that the transmitter is transmitting, but according to the log nothing arrives at the receiver.

Transmitter, i have shortened the yaml to the essential parts:

Code:
substitutions:
  mydelay_on: 50ms
  mydelay_off: 300ms
  uartcommand_allup: 0xAC, 0xAB, 0x01, 0x99
  uartcommand_alldown: 0xAC, 0xAB, 0x02, 0x99

esphome:
  name: roller-shutter-2
  friendly_name: Roller_Shutter_2
  on_boot:
    priority: -100
    then:
      - lambda: |-
          id(rollershutter_2).MySetup();
          id(rollershutter_2).InitialRun();

esp32:
  board: esp32dev
  framework:
    type: esp-idf

debug:

# Logger must be at least debug (default)
logger:
  level: DEBUG
  baud_rate: 9600

uart:
  - id: rs485
    tx_pin: GPIO13
    rx_pin: GPIO16
    baud_rate: 9600
    stop_bits: 1
    parity: NONE
    data_bits: 8
    debug:
      direction: BOTH
      dummy_receiver: false
      sequence:
        - lambda: |-
            UARTDebug::log_binary(direction, bytes, ';');
button:
  - platform: uart
    id: uart_master_all_up
    uart_id: rs485
    data: $uartcommand_allup
  - platform: uart
    uart_id: rs485
    id: uart_master_all_down
    data: $uartcommand_alldown

pcf8574:
  - id: inputs_1_8
    address: 0x22
    pcf8575: false
  - id: inputs_9_16
    address: 0x21
    pcf8575: false
  - id: outputs_1_8
    address: 0x24
    pcf8575: false
  - id: outputs_9_16
    address: 0x25
    pcf8575: false

binary_sensor:
  - platform: gpio
    name: "ZEN_I_U"
    pin:
      pcf8574: inputs_9_16
      number: 2
      mode: INPUT
      inverted: true
    filters:
      - delayed_on: $mydelay_on
      - delayed_off: $mydelay_off
    on_press:
      then:
        - uart.write: [0xAC, 0xAB, 0x01, 0x99]

  - platform: gpio
    name: "ZEN_I_D"
    pin:
      pcf8574: inputs_9_16
      number: 3
      mode: INPUT
      inverted: true
    filters:
      - delayed_on: $mydelay_on
      - delayed_off: $mydelay_off
    on_press:
      then:
        - uart.write: [0xAC, 0xAB, 0x02, 0x99]

  - platform: gpio
    name: "URL_I_UD"
    pin:
      pcf8574: inputs_9_16
      number: 4
      mode: INPUT
      inverted: true
    filters:
      - delayed_on: $mydelay_on
      - delayed_off: $mydelay_off
    on_press:
      then:
        - switch.turn_on: uart_master_holiday
    on_release:
      then:
        - switch.turn_off: uart_master_holiday

switch:
  - platform: template
    id: uart_master_holiday
    optimistic: True
    on_turn_on:
      then:
        - uart.write: [0xAC, 0xAB, 0x03, 0x99]
    on_turn_off:
      then:
        - uart.write: [0xAC, 0xAB, 0x04, 0x99]

Receiver, also  shortened:

Code:
esphome:
  name: roller-shutter-1
  friendly_name: Roller_Shutter_1

esp32:
  board: esp32dev
  framework:
    type: esp-idf

debug:

# Logger must be at least debug (default)
logger:
  level: DEBUG
  baud_rate: 9600

uart:
  - id: rs485
    tx_pin: GPIO13
    rx_pin: GPIO16
    baud_rate: 9600
    stop_bits: 1
    parity: NONE
    data_bits: 8
    debug:
      direction: RX
      dummy_receiver: true
      sequence:
        - lambda: |-
            UARTDebug::log_binary(direction, bytes, ';');

Where can i search the problem?

Best regards Mario

Print this item

  KC868-A128 INPUT toggle OUTPUT ESPhome yaml
Posted by: admin - 06-09-2025, 08:52 AM - Forum: KC868-A128 - No Replies

   
   

Code:
esphome:
  name: a128
  friendly_name: a128

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:


# Example configuration entry
i2c:
   - id: bus_a
     sda: 5
     scl: 16
     scan: true
     frequency: 400kHz
   - id: bus_b
     sda: 15
     scl: 4
     scan: true
     frequency: 400kHz
     

# 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.198
  #   gateway: 192.168.1.1
  #   subnet: 255.255.255.0 



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

  - id: 'pcf8574_hub_out_2'  # for output channel 17-32
    i2c_id: bus_a
    address: 0x25
    pcf8575: true

  - id: 'pcf8574_hub_out_3'  # for output channel 33-48
    i2c_id: bus_a
    address: 0x21
    pcf8575: true

  - id: 'pcf8574_hub_out_4'  # for output channel 49-64
    i2c_id: bus_a
    address: 0x22
    pcf8575: true
   
  - id: 'pcf8574_hub_out_5'  # for output channel 65-80
    i2c_id: bus_a
    address: 0x26
    pcf8575: true

  - id: 'pcf8574_hub_out_6'  # for output channel 81-96
    i2c_id: bus_a
    address: 0x27
    pcf8575: true

  - id: 'pcf8574_hub_out_7'  # for output channel 97-112
    i2c_id: bus_a
    address: 0x20
    pcf8575: true

  - id: 'pcf8574_hub_out_8'  # for output channel 113-128
    i2c_id: bus_a
    address: 0x23
    pcf8575: true



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

  - id: 'pcf8574_hub_in_2'  # for a128-input channel 17-32
    i2c_id: bus_b
    address: 0x25
    pcf8575: true

  - id: 'pcf8574_hub_in_3'  # for a128-input channel 33-48
    i2c_id: bus_b
    address: 0x21
    pcf8575: true

  - id: 'pcf8574_hub_in_4'  # for a128-input channel 49-64
    i2c_id: bus_b
    address: 0x22
    pcf8575: true   

  - id: 'pcf8574_hub_in_5'  # for a128-input channel 65-80
    i2c_id: bus_b
    address: 0x26
    pcf8575: true   

  - id: 'pcf8574_hub_in_6'  # for a128-input channel 81-96
    i2c_id: bus_b
    address: 0x27
    pcf8575: true   

  - id: 'pcf8574_hub_in_7'  # for a128-input channel 97-112
    i2c_id: bus_b
    address: 0x20
    pcf8575: true   

  - id: 'pcf8574_hub_in_8'  # for a128-input channel 113-128
    i2c_id: bus_b
    address: 0x23
    pcf8575: true   

   
# Individual outputs
switch:
  - platform: gpio
    name: "a128-light1"
    id: light1
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 0
      mode: OUTPUT
      inverted: true

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

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

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

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

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

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

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

  - platform: gpio
    name: "a128-light9"
    id: light9
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light10"
    id: light10
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light11"
    id: light11
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light12"
    id: light12
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 11
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light13"
    id: light13
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light14"
    id: light14
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light15"
    id: light15
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light16"
    id: light16
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 15
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light17"
    id: light17
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light18"
    id: light18
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light19"
    id: light19
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light20"
    id: light20
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 3
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light21"
    id: light21
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light22"
    id: light22
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light23"
    id: light23
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light24"
    id: light24
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 7
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light25"
    id: light25
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light26"
    id: light26
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light27"
    id: light27
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light28"
    id: light28
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 11
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light29"
    id: light29
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light30"
    id: light30
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light31"
    id: light31
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light32"
    id: light32
    pin:
      pcf8574: pcf8574_hub_out_2
      number: 15
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light33"
    id: light33
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light34"
    id: light34
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light35"
    id: light35
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light36"
    id: light36
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 3
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light37"
    id: light37
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light38"
    id: light38
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light39"
    id: light39
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light40"
    id: light40
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 7
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light41"
    id: light41
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light42"
    id: light42
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light43"
    id: light43
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light44"
    id: light44
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 11
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light45"
    id: light45
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light46"
    id: light46
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light47"
    id: light47
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light48"
    id: light48
    pin:
      pcf8574: pcf8574_hub_out_3
      number: 15
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light49"
    id: light49
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light50"
    id: light50
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light51"
    id: light51
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light52"
    id: light52
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 3
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light53"
    id: light53
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light54"
    id: light54
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light55"
    id: light55
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light56"
    id: light56
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 7
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light57"
    id: light57
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light58"
    id: light58
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light59"
    id: light59
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light60"
    id: light60
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 11
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light61"
    id: light61
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light62"
    id: light62
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light63"
    id: light63
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light64"
    id: light64
    pin:
      pcf8574: pcf8574_hub_out_4
      number: 15
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light65"
    id: light65
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light66"
    id: light66
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light67"
    id: light67
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light68"
    id: light68
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 3
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light69"
    id: light69
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light70"
    id: light70
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light71"
    id: light71
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light72"
    id: light72
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 7
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light73"
    id: light73
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light74"
    id: light74
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light75"
    id: light75
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light76"
    id: light76
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 11
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light77"
    id: light77
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light78"
    id: light78
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light79"
    id: light79
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light80"
    id: light80
    pin:
      pcf8574: pcf8574_hub_out_5
      number: 15
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light81"
    id: light81
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light82"
    id: light82
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light83"
    id: light83
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light84"
    id: light84
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 3
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light85"
    id: light85
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light86"
    id: light86
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light87"
    id: light87
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light88"
    id: light88
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 7
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light89"
    id: light89
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light90"
    id: light90
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light91"
    id: light91
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light92"
    id: light92
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 11
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light93"
    id: light93
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light94"
    id: light94
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light95"
    id: light95
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light96"
    id: light96
    pin:
      pcf8574: pcf8574_hub_out_6
      number: 15
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light97"
    id: light97
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light98"
    id: light98
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light99"
    id: light99
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light100"
    id: light100
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 3
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light101"
    id: light101
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light102"
    id: light102
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light103"
    id: light103
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light104"
    id: light104
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 7
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light105"
    id: light105
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light106"
    id: light106
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light107"
    id: light107
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light108"
    id: light108
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 11
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light109"
    id: light109
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light110"
    id: light110
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light111"
    id: light111
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light112"
    id: light112
    pin:
      pcf8574: pcf8574_hub_out_7
      number: 15
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light113"
    id: light113
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 0
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light114"
    id: light114
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 1
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light115"
    id: light115
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 2
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light116"
    id: light116
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 3
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light117"
    id: light117
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 4
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light118"
    id: light118
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 5
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light119"
    id: light119
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 6
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light120"
    id: light120
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 7
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light121"
    id: light121
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 8
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light122"
    id: light122
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 9
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light123"
    id: light123
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 10
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light124"
    id: light124
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 11
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light125"
    id: light125
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 12
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light126"
    id: light126
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 13
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light127"
    id: light127
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 14
      mode: OUTPUT
      inverted: true

  - platform: gpio
    name: "a128-light128"
    id: light128
    pin:
      pcf8574: pcf8574_hub_out_8
      number: 15
      mode: OUTPUT
      inverted: true


     
# Individual inputs
binary_sensor:
  - platform: gpio
    name: "a128-input1"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light1

  - platform: gpio
    name: "a128-input2"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 1
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light2

  - platform: gpio
    name: "a128-input3"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 2
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light3

  - platform: gpio
    name: "a128-input4"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 3
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light4

  - platform: gpio
    name: "a128-input5"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 4
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light5

  - platform: gpio
    name: "a128-input6"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 5
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light6

  - platform: gpio
    name: "a128-input7"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 6
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light7

  - platform: gpio
    name: "a128-input8"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 7
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light8

  - platform: gpio
    name: "a128-input9"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 8
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light9

  - platform: gpio
    name: "a128-input10"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 9
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light10

  - platform: gpio
    name: "a128-input11"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 10
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light11

  - platform: gpio
    name: "a128-input12"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 11
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light12

  - platform: gpio
    name: "a128-input13"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 12
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light13

  - platform: gpio
    name: "a128-input14"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 13
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light14

  - platform: gpio
    name: "a128-input15"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 14
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light15

  - platform: gpio
    name: "a128-input16"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 15
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light16

  - platform: gpio
    name: "a128-input17"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 0
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light17

  - platform: gpio
    name: "a128-input18"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 1
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light18

  - platform: gpio
    name: "a128-input19"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 2
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light19

  - platform: gpio
    name: "a128-input20"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 3
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light20

  - platform: gpio
    name: "a128-input21"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 4
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light21

  - platform: gpio
    name: "a128-input22"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 5
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light22

  - platform: gpio
    name: "a128-input23"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 6
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light23

  - platform: gpio
    name: "a128-input24"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 7
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light24

  - platform: gpio
    name: "a128-input25"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 8
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light25

  - platform: gpio
    name: "a128-input26"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 9
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light26

  - platform: gpio
    name: "a128-input27"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 10
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light27

  - platform: gpio
    name: "a128-input28"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 11
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light28

  - platform: gpio
    name: "a128-input29"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 12
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light29

  - platform: gpio
    name: "a128-input30"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 13
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light30

  - platform: gpio
    name: "a128-input31"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 14
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light31

  - platform: gpio
    name: "a128-input32"
    pin:
      pcf8574: pcf8574_hub_in_2
      number: 15
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light32

  - platform: gpio
    name: "a128-input33"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 0
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light33

  - platform: gpio
    name: "a128-input34"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 1
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light34

  - platform: gpio
    name: "a128-input35"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 2
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light35

  - platform: gpio
    name: "a128-input36"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 3
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light36

  - platform: gpio
    name: "a128-input37"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 4
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light37

  - platform: gpio
    name: "a128-input38"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 5
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light38

  - platform: gpio
    name: "a128-input39"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 6
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light39

  - platform: gpio
    name: "a128-input40"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 7
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light40

  - platform: gpio
    name: "a128-input41"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 8
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light41

  - platform: gpio
    name: "a128-input42"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 9
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light42

  - platform: gpio
    name: "a128-input43"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 10
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light43

  - platform: gpio
    name: "a128-input44"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 11
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light44

  - platform: gpio
    name: "a128-input45"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 12
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light45

  - platform: gpio
    name: "a128-input46"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 13
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light46

  - platform: gpio
    name: "a128-input47"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 14
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light47

  - platform: gpio
    name: "a128-input48"
    pin:
      pcf8574: pcf8574_hub_in_3
      number: 15
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light48

  - platform: gpio
    name: "a128-input49"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 0
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light49

  - platform: gpio
    name: "a128-input50"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 1
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light50

  - platform: gpio
    name: "a128-input51"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 2
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light51

  - platform: gpio
    name: "a128-input52"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 3
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light52

  - platform: gpio
    name: "a128-input53"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 4
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light53

  - platform: gpio
    name: "a128-input54"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 5
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light54

  - platform: gpio
    name: "a128-input55"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 6
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light55

  - platform: gpio
    name: "a128-input56"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 7
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light56

  - platform: gpio
    name: "a128-input57"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 8
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light57

  - platform: gpio
    name: "a128-input58"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 9
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light58

  - platform: gpio
    name: "a128-input59"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 10
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light59

  - platform: gpio
    name: "a128-input60"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 11
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light60

  - platform: gpio
    name: "a128-input61"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 12
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light61

  - platform: gpio
    name: "a128-input62"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 13
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light62

  - platform: gpio
    name: "a128-input63"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 14
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light63

  - platform: gpio
    name: "a128-input64"
    pin:
      pcf8574: pcf8574_hub_in_4
      number: 15
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light64

  - platform: gpio
    name: "a128-input65"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 0
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light65

  - platform: gpio
    name: "a128-input66"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 1
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light66

  - platform: gpio
    name: "a128-input67"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 2
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light67

  - platform: gpio
    name: "a128-input68"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 3
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light68

  - platform: gpio
    name: "a128-input69"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 4
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light69

  - platform: gpio
    name: "a128-input70"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 5
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light70

  - platform: gpio
    name: "a128-input71"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 6
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light71

  - platform: gpio
    name: "a128-input72"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 7
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light72

  - platform: gpio
    name: "a128-input73"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 8
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light73

  - platform: gpio
    name: "a128-input74"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 9
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light74

  - platform: gpio
    name: "a128-input75"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 10
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light75

  - platform: gpio
    name: "a128-input76"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 11
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light76

  - platform: gpio
    name: "a128-input77"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 12
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light77

  - platform: gpio
    name: "a128-input78"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 13
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light78

  - platform: gpio
    name: "a128-input79"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 14
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light79

  - platform: gpio
    name: "a128-input80"
    pin:
      pcf8574: pcf8574_hub_in_5
      number: 15
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light80

  - platform: gpio
    name: "a128-input81"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 0
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light81

  - platform: gpio
    name: "a128-input82"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 1
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light82

  - platform: gpio
    name: "a128-input83"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 2
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light83

  - platform: gpio
    name: "a128-input84"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 3
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light84

  - platform: gpio
    name: "a128-input85"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 4
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light85

  - platform: gpio
    name: "a128-input86"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 5
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light86

  - platform: gpio
    name: "a128-input87"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 6
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light87

  - platform: gpio
    name: "a128-input88"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 7
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light88

  - platform: gpio
    name: "a128-input89"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 8
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light89

  - platform: gpio
    name: "a128-input90"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 9
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light90

  - platform: gpio
    name: "a128-input91"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 10
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light91

  - platform: gpio
    name: "a128-input92"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 11
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light92

  - platform: gpio
    name: "a128-input93"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 12
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light93

  - platform: gpio
    name: "a128-input94"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 13
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light94

  - platform: gpio
    name: "a128-input95"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 14
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light95

  - platform: gpio
    name: "a128-input96"
    pin:
      pcf8574: pcf8574_hub_in_6
      number: 15
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light96

  - platform: gpio
    name: "a128-input97"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 0
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light97

  - platform: gpio
    name: "a128-input98"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 1
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light98

  - platform: gpio
    name: "a128-input99"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 2
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light99

  - platform: gpio
    name: "a128-input100"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 3
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light100

  - platform: gpio
    name: "a128-input101"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 4
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light101

  - platform: gpio
    name: "a128-input102"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 5
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light102

  - platform: gpio
    name: "a128-input103"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 6
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light103

  - platform: gpio
    name: "a128-input104"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 7
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light104

  - platform: gpio
    name: "a128-input105"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 8
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light105

  - platform: gpio
    name: "a128-input106"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 9
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light106

  - platform: gpio
    name: "a128-input107"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 10
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light107

  - platform: gpio
    name: "a128-input108"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 11
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light108

  - platform: gpio
    name: "a128-input109"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 12
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light109

  - platform: gpio
    name: "a128-input110"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 13
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light110

  - platform: gpio
    name: "a128-input111"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 14
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light111

  - platform: gpio
    name: "a128-input112"
    pin:
      pcf8574: pcf8574_hub_in_7
      number: 15
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light112

  - platform: gpio
    name: "a128-input113"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 0
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light113

  - platform: gpio
    name: "a128-input114"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 1
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light114

  - platform: gpio
    name: "a128-input115"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 2
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light115

  - platform: gpio
    name: "a128-input116"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 3
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light116

  - platform: gpio
    name: "a128-input117"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 4
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light117

  - platform: gpio
    name: "a128-input118"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 5
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light118

  - platform: gpio
    name: "a128-input119"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 6
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light119

  - platform: gpio
    name: "a128-input120"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 7
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light120

  - platform: gpio
    name: "a128-input121"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 8
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light121

  - platform: gpio
    name: "a128-input122"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 9
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light122

  - platform: gpio
    name: "a128-input123"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 10
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light123

  - platform: gpio
    name: "a128-input124"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 11
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light124

  - platform: gpio
    name: "a128-input125"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 12
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light125

  - platform: gpio
    name: "a128-input126"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 13
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light126

  - platform: gpio
    name: "a128-input127"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 14
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light127

  - platform: gpio
    name: "a128-input128"
    pin:
      pcf8574: pcf8574_hub_in_8
      number: 15
      mode: INPUT
      inverted: true
    on_press:
      then:
        - switch.toggle: light128


web_server:
  port: 80
yaml file download:

.txt   KC868-A128-HA-input-toggle-output.txt (Size: 50.21 KB / Downloads: 269)

firmware BIN file download (download at 0x0 address , directly to use): 

.zip   a128-input-toggle-output.zip (Size: 418.19 KB / Downloads: 464)

after download firmware, ethernet will work as DHCP mode. find the IP address from your router, then use IP address login by web browser.

Print this item

  Does KCS v3 firmware for KC868-H16S3 support a 'delay' parameter in MQTT SET commands
Posted by: itzek - 06-09-2025, 06:21 AM - Forum: B16 - Replies (1)

Hello admin
I am using a B16 smart relay controller with your KCS v3 firmware. I am integrating it with Home Assistant to control a Somfy WT roller shutter.
For this application, I need to send an MQTT command to activate a relay for a specific duration (e.g., "turn on output1 for 3 seconds, then turn it off automatically").
I've reviewed the KCS v3 MQTT protocol document (specifically, section 1 about setting ON/OFF of a digital output channel). It shows how to turn relays ON or OFF:

Code:
{"outputX":{"value":true}}

Code:
{"outputX":{"value":false}}
My question is: Does KCS v3 firmware support an additional parameter like
Code:
{"delay": milliseconds}
within the MQTT SET command, similar to how some other firmwares allow?
For example, would a command like this work to turn on
Code:
output1
for 3 seconds and then automatically turn it off?
Code:
{"output1":{"value":true}},{"delay":3000}
If not, what is the recommended method for implementing time-based relay control (e.g., activating a relay for a specific duration) when integrating with Home Assistant using KCS v3 firmware?
Thank you for your assistance.

Print this item

  KinCony KC868-A8v3 ESP32-S3 8 Channel Relay Module released
Posted by: admin - 06-09-2025, 02:41 AM - Forum: News - Replies (6)

KinCony KC868-A8v3 ESP32-S3 smart controller based on ESP32-S3-WROOM-1U (N16R8) wifi chip. It have 8 channel digital input and 8 channel relay output, 4 channel 1-wire GPIOs. One SD card using SPI bus. KinCony KC868-A8v3 include DS3231 high precision RTC clock chip. LCD display will show wifi and ethernet IP address. A8v3 have RS485 port. You can write any code by Arduino IDE / MicroPython / ESP-IDF development tool to ESP32S3 module. We will supply Arduino / ESP-IDF demo code for different samples. Everyone can modify and change the code for your own smart home automation system project. it support use by ESPHome for home assistant or tasmota firmware for smart home automation DIY. A8v3 use KCS v3 firmware, it support home assistant auto discovery function by MQTT, so without write any config code (zero code) for home assistant. KCS v3 support Apple HomeKit.
[Image: A8v3-3.jpg]
Model No. KinCony KC868-A8v3
Description: KinCony 8 Channel ESP32-S3 Relay Controller – A8v3
Power supply: 12/24V DC
Processor: ESP32-S3-WROOM-1U (N16R8)
PCB Size: 105mm*148mm
interfaces: Ethernet(RJ45)-LAN 100Mbps IPv4/IPv6,WiFi,RS485,Bluetooth,USB-C,LCD, i2c extender
RTC: DS3231 high precision chip (battery socket on PCB)
SD Card: SPI bus
Installation method: DIN RAIL (with plastic shell)
LCD: SSD1306 I2C display
Outputs:
8CH Relay Outputs, every channel relay's load MAX250V10A COM,NO,NC
Inputs:
8CH dry contact inputs (optocoupler isolation, long distance circuit for MAX 500 meters cable)
3 buttons: S1:Tuya S2:ESP32 Reset S3:ESP32 Download (GPIO0)
1-Wire GPIO: 4CH (with pull-up resistance on PCB)
[Image: A8v3-4.jpg]
[Image: A8v3_diagram-1.jpg]
[Image: A8v3_diagram-2.jpg]

Print this item

  KC 868 A32
Posted by: SP9HYX - 06-08-2025, 10:26 AM - Forum: KC868-A32/A32 Pro - Replies (4)

Good day
Some time ago I bought KC868 A32 and today I tried to connect to the board for the second time. I updated the driver Regarding CH341. On one of the laptops I have W11 and on the other W10/
1. I am trying to scan AP via wifi and it is not on two laptops and a phone (there is no such network - kv868)
2. I am doing a scan (IP scanner) through the router and directly connected to the laptop socket - no effect.
3. I am trying to scan if UPD Scan will show the board but it does not see it
Please help.

Print this item

  M30 Extension MODBUS RTU Controller
Posted by: markwj - 06-07-2025, 08:09 AM - Forum: KC868-M16 / M1 / MB / M30 - Replies (2)

I'm trying to connect another 6 channels to the M30 using an external modbus rtu energy meter.

I've configured the external meter as ID 16 (0x10), 38400 baud, and can query it directly.

But when I configure in yaml, I don't get any result.

The relevant part of my config is as follows:

Code:
uart:
  id: modbus_uart
  rx_pin: 32
  tx_pin: 33
  baud_rate: 115200
  stop_bits: 1
  data_bits: 8
  parity: NONE
 
debug:
  update_interval: 5s

modbus:
  id: modbus_hub
  uart_id: modbus_uart

modbus_controller:
  - id: modbus_hub_m30
    address: 1
    modbus_id: modbus_hub
    update_interval: 5s
  - id: modbus_ext_m6
    address: 16
    modbus_id: modbus_hub
    update_interval: 5s

sensor:
  - platform: modbus_controller
    modbus_controller_id: modbus_ext_m6
    address: 0
    register_type: holding
    name: "Modbus Extension Model Number"
    id: mext6_model_number
    value_type: U_WORD
 
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 100
    register_type: holding
    name: "Lights Current"
    id: m30_1_current_1
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098

Is this possible, and if so any ideas what I am doing wrong? I am just seeing 'NA' for the sensor and seemingly no polling.

Print this item

  Kincony Cloud
Posted by: ia1 - 06-07-2025, 04:29 AM - Forum: KC868-A16v3 - Replies (1)

Hello

I am unable to add a16v3 board in https://mq.kincony.com/qq/

is there any subscription for this ?
please let me know
Imran Alam

Print this item

  USB serial not working
Posted by: mikesloper - 06-04-2025, 09:35 PM - Forum: KC868-A6v3 - Replies (6)

I just received the A6v3 board but it won't connect to my computer properly. I have to reconnected the cable about 30-40 times before I get a working serial connection. I have tried 5 different usbc and usba cables and it makes no difference. I also tried it on 2 computers using all available usb ports. I have also tried reinstalling all USB drivers. 

I have never had a problem with any ESP32 board including A6v1, A4 or any esp32 dev module including the espressif esp32-s3 devkit module.

What am I doing wrong or is this board faulty?

Board was purchased from Kincony controller store on aliexpress.

[Image: Screenshot-2025-06-04-221731.png]

Print this item