Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-A16S configure yaml for ESPhome
#1
   

esphome:
  name: kc868-a16s
  platform: ESP32
  board: esp32dev
 
 
# Example configuration entry for ESP32
i2c:
  sda: 4
  scl: 5
  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: 0x24

  - 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: 0x23

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

# Enable logging
logger:

# Enable Home Assistant API
api:


.txt   Made_for_ESPHome_KC868-A16S.txt (Size: 5.63 KB / Downloads: 421)
Reply
#2
How are you configuring A1 - A4 in ESPHome?

Can A1 be used for digital input pulse sensor?
Reply
#3
How are you configuring A1 - A4 in ESPHome? you can use ADC in esphome: https://esphome.io/components/sensor/adc.html
Can A1 be used for digital input pulse sensor? yes, but you need to compare a voltage. the distance wire can't be too long.
Reply
#4
(04-15-2023, 03:29 AM)admin Wrote: How are you configuring A1 - A4 in ESPHome?      you can use ADC in esphome: https://esphome.io/components/sensor/adc.html
Can A1 be used for digital input pulse sensor?      yes, but you need to compare a voltage. the distance wire can't be too long.

Thank you.

So, if I used a switch pulled to 12V and used ADC to detect going to 0V, that would be OK with the board hardware?

Or, could I use GPIO33 (GSMTX) and GPIO14 (GSMRX) from the P2 HMI header?

The problem is that ESPHome Pulse Counter does not work with inputs from an expander.
Reply
#5
So, if I used a switch pulled to 12V and used ADC to detect going to 0V, that would be OK with the board hardware? no, analog input range is dc 0-5v, can't connect with dc12v.

Or, could I use GPIO33 (GSMTX) and GPIO14 (GSMRX) from the P2 HMI header? if you want use for HMI , also is ok, such as Nextion display is supported.
Reply
#6
Hello, sorry, I'm trying to copy the yaml file for kc868-A16S S to home assistant; but in the home assistant functions, with the right button, there is no paste...there are the cut and copy commands..I can't figure out if it's my version or I have to set some parameters..thanks
Reply
#7
keyboard : ctrl+v to paste.
Reply
#8
Thank you very much
Reply
#9
Hello everyone, im new here and i recently bought KC868-A16S, i already flashed the new firmware: Software Version v2.1.9
Build Date Sep 26 2023 14:42:27 and i  can connect to Kincony Admin page and can control the output from the MONITOR.
My problem is i cannot connect the board to HOME ASSISTANT, everytime I install the yaml file this error comes:

"<          INFO ESPHome 2023.10.6
INFO Reading configuration /config/esphome/a16s.yaml...
WARNING GPIO5 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-a...pping-pins
WARNING GPIO5 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-a...pping-pins
INFO Generating C++ source...
INFO Core config or version changed, cleaning build files...
INFO Deleting /data/build/kc868-a16s/.pioenvs
INFO Compiling app...
Processing kc868-a16s (board: esp32dev; framework: arduino; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
Platform Manager: Installing platformio/espressif32 @ 5.4.0
INFO Installing platformio/espressif32 @ 5.4.0
WARNING Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x7f0e82c235b0>: Failed to resolve 'api.registry.platformio.org' ([Errno -3] Temporary failure in name resolution)")': /v3/packages/platformio/platform/espressif32      >>


its API related i dont know how. please help me.. =)
Reply
#10
if you want use esphome, just config esphome yaml to download firmware, not use KCS firmware.
you can see our youtube channel esphome tour video for beginner:
https://www.youtube.com/playlist?list=PL...w6S3y9YM2V
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)