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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 5,368
» Latest member: Alan.llm
» Forum threads: 2,574
» Forum posts: 13,305

Full Statistics

Online Users
There are currently 48 online users.
» 1 Member(s) | 29 Guest(s)
Bing, Bytespider, Crawl, Google, PetalBot, Semrush, Yandex, bot, yurgel

Latest Threads
KC868-A2 ESP32 I/O pin de...
Forum: KC868-A2
Last Post: tugra
1 hour ago
» Replies: 7
» Views: 2,261
change wake up name
Forum: KinCony AS
Last Post: gal
8 hours ago
» Replies: 12
» Views: 78
A32 Pro ESPHome yaml incl...
Forum: KC868-A32/A32 Pro
Last Post: xarouli5
9 hours ago
» Replies: 17
» Views: 181
Need help with configurat...
Forum: KC868-HxB series Smart Controller
Last Post: admin
Today, 04:32 AM
» Replies: 32
» Views: 392
ESP32 S3 set up issue
Forum: Extender module
Last Post: admin
Yesterday, 11:43 PM
» Replies: 10
» Views: 65
KC868-A8 Schematic
Forum: KC868-A8
Last Post: admin
Yesterday, 11:40 PM
» Replies: 7
» Views: 46
"KCS" v2.2.8 firmware BIN...
Forum: "KCS" firmware system
Last Post: admin
Yesterday, 11:38 PM
» Replies: 2
» Views: 171
Dimensions/drawings of bo...
Forum: Schematic and diagram
Last Post: admin
Yesterday, 11:37 PM
» Replies: 1
» Views: 22
how to use AS ESP32-S3 vo...
Forum: KinCony AS
Last Post: admin
12-16-2024, 10:55 PM
» Replies: 12
» Views: 447
Problem with IFTTT automa...
Forum: "KCS" firmware system
Last Post: admin
12-16-2024, 10:53 PM
» Replies: 5
» Views: 34

  A32 Pro ESPHome yaml for home assistant and Tuya app work simultaneously without MQTT
Posted by: admin - 05-31-2024, 02:50 AM - Forum: KC868-A32/A32 Pro - No Replies

   
   

Code:
esphome:
  name: a32-pro-arduino
  friendly_name: a32-Pro-arduino
  platformio_options:
    board_build.extra_flags:
      # WIFI_CONTROL_SELF_MODE = 0
      # WIFI_CONTROL_SELF_MODE = 1
      - "-DWIFI_CONTROL_SELF_MODE=0"

external_components:
  - source:
      type: git
      url: https://github.com/hzkincony/esphome-tuya-wifi-mcu
      ref: v1.1.0

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino

# Enable logging
# logger:

# Enable Home Assistant API
api:
  encryption:
    key: "fBpihEYPVlfKaE4ZIcY0uRcJ134u7DBKzzskk994+Lw="

ethernet:
  type: W5500
  clk_pin: GPIO42
  mosi_pin: GPIO44
  miso_pin: GPIO40
  cs_pin: GPIO39
  interrupt_pin: GPIO41
  reset_pin: GPIO43

uart:
  tx_pin: 15
  rx_pin: 16
  id: tuya_mcu_uart
  baud_rate: 9600

tuya_wifi_mcu:
  # tuya mcu product id
  product_id: fwy7fk4mzay3kern
  uart_id: tuya_mcu_uart
  wifi_reset_pin: 21
  wifi_led_pin: 45

i2c:
   - id: bus_a
     sda: 11
     scl: 10
     scan: true
     frequency: 400kHz

xl9535:
  - id: xl9535_hub_out1 # for output channel 1-16
    address: 0x21
  - id: xl9535_hub_out2 # for output channel 17-32
    address: 0x22
  - id: xl9535_hub_in1 # for input channel 1-16
    address: 0x24
  - id: xl9535_hub_in2 # for input channel 17-32
    address: 0x25

pcf8574:
  - id: 'pcf8574_in_3'  # for input channel 33-40
    address: 0x23



switch:

  - platform: gpio
    pin: 45
    name: "LED"

  - platform: gpio
    name: A32 Pro Switch01
    id: "a32_pro_switch01"
    pin:
      xl9535: xl9535_hub_out1
      number: 0
      mode: OUTPUT
      inverted: true
 
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch01 Tuya
    dp_id: 101
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch01"
 
 
  - platform: gpio
    name: A32 Pro Switch02
    id: "a32_pro_switch02"
    pin:
      xl9535: xl9535_hub_out1
      number: 1
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch02 Tuya
    dp_id: 102
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch02"

  - platform: gpio
    name: A32 Pro Switch03
    id: "a32_pro_switch03"
    pin:
      xl9535: xl9535_hub_out1
      number: 2
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch03 Tuya
    dp_id: 103
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch03"

  - platform: gpio
    name: A32 Pro Switch04
    id: "a32_pro_switch04"
    pin:
      xl9535: xl9535_hub_out1
      number: 3
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch04 Tuya
    dp_id: 104
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch04"

  - platform: gpio
    name: A32 Pro Switch05
    id: "a32_pro_switch05"
    pin:
      xl9535: xl9535_hub_out1
      number: 4
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch05 Tuya
    dp_id: 105
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch05"

  - platform: gpio
    name: A32 Pro Switch06
    id: "a32_pro_switch06"
    pin:
      xl9535: xl9535_hub_out1
      number: 5
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch06 Tuya
    dp_id: 106
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch06"

  - platform: gpio
    name: A32 Pro Switch07
    id: "a32_pro_switch07"
    pin:
      xl9535: xl9535_hub_out1
      number: 6
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch07 Tuya
    dp_id: 107
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch07"

  - platform: gpio
    name: A32 Pro Switch08
    id: "a32_pro_switch08"
    pin:
      xl9535: xl9535_hub_out1
      number: 7
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch08 Tuya
    dp_id: 108
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch08"

  - platform: gpio
    name: A32 Pro Switch09
    id: "a32_pro_switch09"
    pin:
      xl9535: xl9535_hub_out1
      number: 10
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch09 Tuya
    dp_id: 109
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch09"

  - platform: gpio
    name: A32 Pro Switch10
    id: "a32_pro_switch10"
    pin:
      xl9535: xl9535_hub_out1
      number: 11
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch10 Tuya
    dp_id: 110
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch10"

  - platform: gpio
    name: A32 Pro Switch11
    id: "a32_pro_switch11"
    pin:
      xl9535: xl9535_hub_out1
      number: 12
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch11 Tuya
    dp_id: 111
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch11"

  - platform: gpio
    name: A32 Pro Switch12
    id: "a32_pro_switch12"
    pin:
      xl9535: xl9535_hub_out1
      number: 13
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch12 Tuya
    dp_id: 112
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch12"

  - platform: gpio
    name: A32 Pro Switch13
    id: "a32_pro_switch13"
    pin:
      xl9535: xl9535_hub_out1
      number: 14
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch13 Tuya
    dp_id: 113
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch13"

  - platform: gpio
    name: A32 Pro Switch14
    id: "a32_pro_switch14"
    pin:
      xl9535: xl9535_hub_out1
      number: 15
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch14 Tuya
    dp_id: 114
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch14"

  - platform: gpio
    name: A32 Pro Switch15
    id: "a32_pro_switch15"
    pin:
      xl9535: xl9535_hub_out1
      number: 16
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch15 Tuya
    dp_id: 115
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch15"

  - platform: gpio
    name: A32 Pro Switch16
    id: "a32_pro_switch16"
    pin:
      xl9535: xl9535_hub_out1
      number: 17
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch16 Tuya
    dp_id: 116
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch16"

  - platform: gpio
    name: A32 Pro Switch17
    id: "a32_pro_switch17"
    pin:
      xl9535: xl9535_hub_out2
      number: 0
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch17 Tuya
    dp_id: 117
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch17"

  - platform: gpio
    name: A32 Pro Switch18
    id: "a32_pro_switch18"
    pin:
      xl9535: xl9535_hub_out2
      number: 1
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch18 Tuya
    dp_id: 118
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch18"

  - platform: gpio
    name: A32 Pro Switch19
    id: "a32_pro_switch19"
    pin:
      xl9535: xl9535_hub_out2
      number: 2
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch19 Tuya
    dp_id: 119
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch19"

  - platform: gpio
    name: A32 Pro Switch20
    id: "a32_pro_switch20"
    pin:
      xl9535: xl9535_hub_out2
      number: 3
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch20 Tuya
    dp_id: 120
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch20"

  - platform: gpio
    name: A32 Pro Switch21
    id: "a32_pro_switch21"
    pin:
      xl9535: xl9535_hub_out2
      number: 4
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch21 Tuya
    dp_id: 121
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch21"

  - platform: gpio
    name: A32 Pro Switch22
    id: "a32_pro_switch22"
    pin:
      xl9535: xl9535_hub_out2
      number: 5
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch22 Tuya
    dp_id: 122
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch22"

  - platform: gpio
    name: A32 Pro Switch23
    id: "a32_pro_switch23"
    pin:
      xl9535: xl9535_hub_out2
      number: 6
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch23 Tuya
    dp_id: 123
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch23"

  - platform: gpio
    name: A32 Pro Switch24
    id: "a32_pro_switch24"
    pin:
      xl9535: xl9535_hub_out2
      number: 7
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch24 Tuya
    dp_id: 124
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch24"

  - platform: gpio
    name: A32 Pro Switch25
    id: "a32_pro_switch25"
    pin:
      xl9535: xl9535_hub_out2
      number: 10
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch25 Tuya
    dp_id: 125
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch25"

  - platform: gpio
    name: A32 Pro Switch26
    id: "a32_pro_switch26"
    pin:
      xl9535: xl9535_hub_out2
      number: 11
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch26 Tuya
    dp_id: 126
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch26"

  - platform: gpio
    name: A32 Pro Switch27
    id: "a32_pro_switch27"
    pin:
      xl9535: xl9535_hub_out2
      number: 12
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch27 Tuya
    dp_id: 127
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch27"

  - platform: gpio
    name: A32 Pro Switch28
    id: "a32_pro_switch28"
    pin:
      xl9535: xl9535_hub_out2
      number: 13
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch28 Tuya
    dp_id: 128
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch28"

  - platform: gpio
    name: A32 Pro Switch29
    id: "a32_pro_switch29"
    pin:
      xl9535: xl9535_hub_out2
      number: 14
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch29 Tuya
    dp_id: 129
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch29"

  - platform: gpio
    name: A32 Pro Switch30
    id: "a32_pro_switch30"
    pin:
      xl9535: xl9535_hub_out2
      number: 15
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch30 Tuya
    dp_id: 130
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch30"

  - platform: gpio
    name: A32 Pro Switch31
    id: "a32_pro_switch31"
    pin:
      xl9535: xl9535_hub_out2
      number: 16
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch31 Tuya
    dp_id: 131
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch31"

  - platform: gpio
    name: A32 Pro Switch32
    id: "a32_pro_switch32"
    pin:
      xl9535: xl9535_hub_out2
      number: 17
      mode: OUTPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro Switch32 Tuya
    dp_id: 132
    # hide from homeassistant ui
    internal: true
    # bind other switch, sync state
    bind_switch_id: "a32_pro_switch32"

binary_sensor:
  - platform: gpio
    name: A32 Pro DI01
    id: "a32_pro_di01"
    pin:
      xl9535: xl9535_hub_in1
      number: 0
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro DI01 Tuya
    dp_id: 133
    bind_binary_sensor_id: a32_pro_di01
    internal: true



  - platform: gpio
    name: A32 Pro DI02
    id: "a32_pro_di02"
    pin:
      xl9535: xl9535_hub_in1
      number: 1
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro DI02 Tuya
    dp_id: 134
    bind_binary_sensor_id: a32_pro_di02
    internal: true

  - platform: gpio
    name: A32 Pro DI03
    id: "a32_pro_di03"
    pin:
      xl9535: xl9535_hub_in1
      number: 2
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro DI03 Tuya
    dp_id: 135
    bind_binary_sensor_id: a32_pro_di03
    internal: true

  - platform: gpio
    name: A32 Pro DI04
    id: "a32_pro_di04"
    pin:
      xl9535: xl9535_hub_in1
      number: 3
      mode: INPUT
      inverted: true
  - platform: tuya_wifi_mcu
    name: A32 Pro DI04 Tuya
    dp_id: 136
    bind_binary_sensor_id: a32_pro_di04
    internal: true

  - platform: gpio
    name: A32 Pro DI05
    pin:
      xl9535: xl9535_hub_in1
      number: 4
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI06
    pin:
      xl9535: xl9535_hub_in1
      number: 5
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI07
    pin:
      xl9535: xl9535_hub_in1
      number: 6
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI08
    pin:
      xl9535: xl9535_hub_in1
      number: 7
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI09
    pin:
      xl9535: xl9535_hub_in1
      number: 10
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI10
    pin:
      xl9535: xl9535_hub_in1
      number: 11
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI11
    pin:
      xl9535: xl9535_hub_in1
      number: 12
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI12
    pin:
      xl9535: xl9535_hub_in1
      number: 13
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI13
    pin:
      xl9535: xl9535_hub_in1
      number: 14
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI14
    pin:
      xl9535: xl9535_hub_in1
      number: 15
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI15
    pin:
      xl9535: xl9535_hub_in1
      number: 16
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI16
    pin:
      xl9535: xl9535_hub_in1
      number: 17
      mode: INPUT
      inverted: true

  - platform: gpio
    name: "A32 Pro TMP1"
    pin:
      number: 1
      inverted: true


  - platform: gpio
    name: "A32 Pro TMP2"
    pin:
      number: 2
      inverted: true

  - platform: gpio
    name: "A32 Pro DL"
    pin:
      number: 0
      inverted: true

  - platform: gpio
    name: "A32 Pro DTUYA"
    pin:
      number: 21
      inverted: true

  - platform: gpio
    name: A32 Pro DI17
    pin:
      xl9535: xl9535_hub_in2
      number: 0
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI18
    pin:
      xl9535: xl9535_hub_in2
      number: 1
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI19
    pin:
      xl9535: xl9535_hub_in2
      number: 2
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI20
    pin:
      xl9535: xl9535_hub_in2
      number: 3
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI21
    pin:
      xl9535: xl9535_hub_in2
      number: 4
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI22
    pin:
      xl9535: xl9535_hub_in2
      number: 5
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI23
    pin:
      xl9535: xl9535_hub_in2
      number: 6
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI24
    pin:
      xl9535: xl9535_hub_in2
      number: 7
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI25
    pin:
      xl9535: xl9535_hub_in2
      number: 10
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI26
    pin:
      xl9535: xl9535_hub_in2
      number: 11
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI27
    pin:
      xl9535: xl9535_hub_in2
      number: 12
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI28
    pin:
      xl9535: xl9535_hub_in2
      number: 13
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI29
    pin:
      xl9535: xl9535_hub_in2
      number: 14
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI30
    pin:
      xl9535: xl9535_hub_in2
      number: 15
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI31
    pin:
      xl9535: xl9535_hub_in2
      number: 16
      mode: INPUT
      inverted: true
  - platform: gpio
    name: A32 Pro DI32
    pin:
      xl9535: xl9535_hub_in2
      number: 17
      mode: INPUT
      inverted: true

  - platform: gpio
    name: A32 Pro DI33
    pin:
      pcf8574: pcf8574_in_3
      number: 0
      mode: INPUT
      inverted: true

  - platform: gpio
    name: A32 Pro DI34
    pin:
      pcf8574: pcf8574_in_3
      number: 1
      mode: INPUT
      inverted: true

  - platform: gpio
    name: A32 Pro DI35
    pin:
      pcf8574: pcf8574_in_3
      number: 2
      mode: INPUT
      inverted: true

  - platform: gpio
    name: A32 Pro DI36
    pin:
      pcf8574: pcf8574_in_3
      number: 3
      mode: INPUT
      inverted: true

  - platform: gpio
    name: A32 Pro DI37
    pin:
      pcf8574: pcf8574_in_3
      number: 4
      mode: INPUT
      inverted: true

  - platform: gpio
    name: A32 Pro DI38
    pin:
      pcf8574: pcf8574_in_3
      number: 5
      mode: INPUT
      inverted: true

  - platform: gpio
    name: A32 Pro DI39
    pin:
      pcf8574: pcf8574_in_3
      number: 6
      mode: INPUT
      inverted: true

  - platform: gpio
    name: A32 Pro DI40
    pin:
      pcf8574: pcf8574_in_3
      number: 7
      mode: INPUT
      inverted: true

gp8403:
  id: my_gp8403
  voltage: 10V

output:
  - platform: gp8403
    id: gp8403_output_1
    gp8403_id: my_gp8403
    channel: 0
  - platform: gp8403
    id: gp8403_output_2
    gp8403_id: my_gp8403
    channel: 1

light:
  - platform: monochromatic
    name: "A32 Pro-DAC-0"
    output: gp8403_output_1

  - platform: monochromatic
    name: "A32 Pro-DAC-1"
    output: gp8403_output_2

sensor:
  - platform: adc
    pin: 7
    name: "A32 Pro A1 Voltage"
    update_interval: 5s
    attenuation: 11db
    filters:
      - lambda:
          if (x >= 3.11) {
            return x * 1.60256;
          } else if (x <= 0.15) {
            return 0;
          } else {
            return x * 1.51;
          }
  - platform: adc
    pin: 6
    name: "A32 Pro A2 Voltage"
    update_interval: 5s
    attenuation: 11db
    filters:
      # - multiply: 1.51515
      - lambda:
          if (x >= 3.11) {
            return x * 1.60256;
          } else if (x <= 0.15) {
            return 0;
          } else {
            return x * 1.51;
          }
  - platform: adc
    pin: 5
    name: "A32 Pro A3 Current"
    update_interval: 5s
    unit_of_measurement: mA
    attenuation: 11db
    filters:
      - multiply: 6.66666666
  - platform: adc
    pin: 4
    name: "A32 Pro A4 Current"
    update_interval: 5s
    unit_of_measurement: mA
    attenuation: 11db
    filters:
      - multiply: 6.66666666

web_server:
  port: 80

font:
  - file: "gfonts://Roboto"
    id: roboto
    size: 20

display:
  - platform: ssd1306_i2c
    i2c_id: bus_a
    model: "SSD1306 128x64"
    address: 0x3C
    lambda: |-
      it.printf(0, 0, id(roboto), "A32 Pro");

   



Attached Files
.txt   A32_Pro-ESPHome_arduino_type.txt (Size: 21.88 KB / Downloads: 179)
Print this item

  Tuya IoT platform parameter for A32 Pro controller
Posted by: admin - 05-31-2024, 02:30 AM - Forum: KC868-A32/A32 Pro - No Replies

PID:fwy7fk4mzay3kern

switch01 DP ID:101
switch02 DP ID:102
switch03 DP ID:103
switch04 DP ID:104
switch05 DP ID:105
switch06 DP ID:106
switch07 DP ID:107
switch08 DP ID:108
switch09 DP ID:109
switch10 DP ID:110
switch11 DP ID:111
switch12 DP ID:112
switch13 DP ID:113
switch14 DP ID:114
switch15 DP ID:115
switch16 DP ID:116
switch17 DP ID:117
switch18 DP ID:118
switch19 DP ID:119
switch20 DP ID:120
switch21 DP ID:121
switch22 DP ID:122
switch23 DP ID:123
switch24 DP ID:124
switch25 DP ID:125
switch26 DP ID:126
switch27 DP ID:127
switch28 DP ID:128
switch29 DP ID:129
switch30 DP ID:130
switch31 DP ID:131
switch32 DP ID:132

digital input1 DP ID:133
digital input2 DP ID:134
digital input3 DP ID:135
digital input4 DP ID:136

DAC output1 DP ID:173
DAC output2 DP ID:174

Print this item

  Help With RS485
Posted by: phateks - 05-30-2024, 08:07 PM - Forum: KC868-A4S - Replies (1)

Hello, i  have an modbus  thermostat and i have those instructions to set up.
Can you help me with a code in esphome for that?
ThankYou!!



Attached Files Thumbnail(s)
       
Print this item

  RF signal learnt but when i press transmit there is no signal sent?
Posted by: stam - 05-30-2024, 03:35 PM - Forum: KC868-AG / AG Pro / AG8 - Replies (5)

I press transmit and got the trasmitted msg but it cant control the device, may i know the reasons?

Print this item

  Unable to access my KC868-AG through IP address
Posted by: stam - 05-29-2024, 03:51 PM - Forum: KC868-AG / AG Pro / AG8 - Replies (3)

Hi, i can see my KC-868-AG IP address in my router, but i tried typing the IP address into my browser but i cant connect to the device, may i know whats the issue? Thank you.

Print this item

  KC868-H32BS restart
Posted by: hentes - 05-29-2024, 10:19 AM - Forum: KC868-HxB series Smart Controller - Replies (5)

I have a KC868-H32BS and after restarting Home Assistant all entities from KC868-H32BS are unavailable. After power cycling the KC868-H32BS all entities are coming back. Is it possible to restart the KC868-H32BS with an MQTT command? 
Any other alternatives to resolve this situation?

Thank you

Print this item

  PWM Output on KC868-A8
Posted by: claudius - 05-29-2024, 07:41 AM - Forum: KC868-A8 - Replies (9)

I am using the KC868-A8.
I need at least ONE - preferably two PWM outputs from the KC868-A8.
Any idea except dismounting two(four) relays??

Print this item

  Arduino source code for A32 Pro - UDP with Ethernet chip W5500
Posted by: admin - 05-29-2024, 04:24 AM - Forum: KC868-A32/A32 Pro - No Replies

before run code, you need to install "AsyncUDP_ESP32_SC_Ethernet" arduino library.
   
   

Code:
/****************************************************************************************************************************
  Async_UdpClient.ino

  AsyncUDP_ESP32_SC_Ethernet is a Async UDP library for the ESP32_SC_Ethernet (ESP32S2/S3/C3 + LwIP W5500 / W6100 / ENC28J60)

  Based on and modified from ESPAsyncUDP Library (https://github.com/me-no-dev/ESPAsyncUDP)
  Built by Khoi Hoang https://github.com/khoih-prog/AsyncUDP_ESP32_SC_Ethernet
  Licensed under GPLv3 license
*****************************************************************************************************************************/

#if !( defined(ESP32) )
  #error This code is designed for (ESP32S2/S3/C3 + LwIP W5500, W6100 or ENC28J60) to run on ESP32 platform! Please check your Tools->Board setting.
#endif

#include <Arduino.h>

#define USING_W5500           true
#define USING_W6100           false
#define USING_ENC28J60        false

#if !USING_W5500 && !USING_W6100 && !USING_ENC28J60
  #undef USING_W5500
  #define USING_W5500           true
#endif

#define ASYNC_UDP_ESP32_SC_ETHERNET_DEBUG_PORT      Serial

// Use from 0 to 4. Higher number, more debugging messages and memory usage.
#define _ASYNC_UDP_ESP32_SC_ETHERNET_LOGLEVEL_      4

//////////////////////////////////////////////////////////

#if USING_W5500

  #define ESP32_Ethernet_onEvent            ESP32_W5500_onEvent
  #define ESP32_Ethernet_waitForConnect     ESP32_W5500_waitForConnect

  // For ESP32_S3
  // Optional values to override default settings
  // Don't change unless you know what you're doing
  //#define ETH_SPI_HOST        SPI3_HOST
  //#define SPI_CLOCK_MHZ       25
 
  // Must connect INT to GPIOxx or not working
  #define INT_GPIO            41
 
  #define MISO_GPIO           40
  #define MOSI_GPIO           44
  #define SCK_GPIO            42
  #define CS_GPIO             39

  // For ESP32_C3
  // Optional values to override default settings
  // Don't change unless you know what you're doing
  //#define ETH_SPI_HOST        SPI2_HOST
  //#define SPI_CLOCK_MHZ       25
 
  // Must connect INT to GPIOxx or not working
  //#define INT_GPIO            10
 
  //#define MISO_GPIO           5
  //#define MOSI_GPIO           6
  //#define SCK_GPIO            4
  //#define CS_GPIO             7

  //////////////////////////////////////////////////////////

#elif USING_W6100

  #define ESP32_Ethernet_onEvent            ESP32_W6100_onEvent
  #define ESP32_Ethernet_waitForConnect     ESP32_W6100_waitForConnect

  // For ESP32_S3
  // Optional values to override default settings
  // Don't change unless you know what you're doing
  //#define ETH_SPI_HOST        SPI3_HOST
  //#define SPI_CLOCK_MHZ       25
 
  // Must connect INT to GPIOxx or not working
  //#define INT_GPIO            4
 
  //#define MISO_GPIO           13
  //#define MOSI_GPIO           11
  //#define SCK_GPIO            12
  //#define CS_GPIO             10

  // For ESP32_C3
  // Optional values to override default settings
  // Don't change unless you know what you're doing
  //#define ETH_SPI_HOST        SPI2_HOST
  //#define SPI_CLOCK_MHZ       25
 
  // Must connect INT to GPIOxx or not working
  //#define INT_GPIO            10
 
  //#define MISO_GPIO           5
  //#define MOSI_GPIO           6
  //#define SCK_GPIO            4
  //#define CS_GPIO             7

  //////////////////////////////////////////////////////////
 
#else   // #if USING_W5500

  //////////////////////////////////////////////////////////

  // For ENC28J60

  #define ESP32_Ethernet_onEvent            ESP32_ENC_onEvent
  #define ESP32_Ethernet_waitForConnect     ESP32_ENC_waitForConnect

  // Optional values to override default settings
  // Don't change unless you know what you're doing
  //#define ETH_SPI_HOST        SPI2_HOST
  //#define SPI_CLOCK_MHZ       8
 
  // Must connect INT to GPIOxx or not working
  //#define INT_GPIO            4
 
  //#define MISO_GPIO           13
  //#define MOSI_GPIO           11
  //#define SCK_GPIO            12
  //#define CS_GPIO             10

  //////////////////////////////////////////////////////////

#endif    // #if USING_W5500

//////////////////////////////////////////////////////////

#include <AsyncUDP_ESP32_SC_Ethernet.h>

IPAddress remoteIPAddress = IPAddress(192, 168, 3, 101);

#define UDP_REMOTE_PORT         5698

/////////////////////////////////////////////

// Enter a MAC address and IP address for your controller below.
#define NUMBER_OF_MAC      20

byte mac[][NUMBER_OF_MAC] =
{
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x01 },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x02 },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x03 },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x04 },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x05 },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x06 },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x07 },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x08 },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x09 },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x0A },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x0B },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x0C },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x0D },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x0E },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x0F },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x10 },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x11 },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x12 },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x13 },
  { 0xDE, 0xAD, 0xBE, 0xEF, 0xBE, 0x14 },
};

// Select the IP address according to your local network
IPAddress myIP(192, 168, 3, 232);
IPAddress myGW(192, 168, 3, 1);
IPAddress mySN(255, 255, 255, 0);

// Google DNS Server IP
IPAddress myDNS(8, 8, 8, 8);

/////////////////////////////////////////////

AsyncUDP udp;

void parsePacket(AsyncUDPPacket packet)
{
  Serial.print("UDP Packet Type: ");
  Serial.print(packet.isBroadcast() ? "Broadcast" : packet.isMulticast() ? "Multicast" : "Unicast");
  Serial.print(", From: ");
  Serial.print(packet.remoteIP());
  Serial.print(":");
  Serial.print(packet.remotePort());
  Serial.print(", To: ");
  Serial.print(packet.localIP());
  Serial.print(":");
  Serial.print(packet.localPort());
  Serial.print(", Length: ");
  Serial.print(packet.length());
  Serial.print(", Data: ");
  Serial.write(packet.data(), packet.length());
  Serial.println();
  //reply to the client
  packet.printf("Got %u bytes of data", packet.length());
}

void initEthernet()
{
  UDP_LOGWARN(F("Default SPI pinout:"));
  UDP_LOGWARN1(F("SPI_HOST:"), ETH_SPI_HOST);
  UDP_LOGWARN1(F("MOSI:"), MOSI_GPIO);
  UDP_LOGWARN1(F("MISO:"), MISO_GPIO);
  UDP_LOGWARN1(F("SCK:"),  SCK_GPIO);
  UDP_LOGWARN1(F("CS:"),   CS_GPIO);
  UDP_LOGWARN1(F("INT:"),  INT_GPIO);
  UDP_LOGWARN1(F("SPI Clock (MHz):"), SPI_CLOCK_MHZ);
  UDP_LOGWARN(F("========================="));

  ///////////////////////////////////

  // To be called before ETH.begin()
  ESP32_Ethernet_onEvent();

  // start the ethernet connection and the server:
  // Use DHCP dynamic IP and random mac
  //bool begin(int MISO_GPIO, int MOSI_GPIO, int SCLK_GPIO, int CS_GPIO, int INT_GPIO, int SPI_CLOCK_MHZ,
  //           int SPI_HOST, uint8_t *W6100_Mac = W6100_Default_Mac);
  ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST );
  //ETH.begin( MISO_GPIO, MOSI_GPIO, SCK_GPIO, CS_GPIO, INT_GPIO, SPI_CLOCK_MHZ, ETH_SPI_HOST, mac[millis() % NUMBER_OF_MAC] );

  // Static IP, leave without this line to get IP via DHCP
  //bool config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1 = 0, IPAddress dns2 = 0);
  //ETH.config(myIP, myGW, mySN, myDNS);

  ESP32_Ethernet_waitForConnect();

  ///////////////////////////////////
}

////////////////////////////////////

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

  while (!Serial && (millis() < 5000));

  delay(500);

  Serial.print(F("\nStart Async_UDPClient on "));
  Serial.print(ARDUINO_BOARD);
  Serial.print(F(" with "));
  Serial.println(SHIELD_TYPE);

#if USING_W5500
  Serial.println(WEBSERVER_ESP32_SC_W5500_VERSION);
#elif USING_W6100
  Serial.println(WEBSERVER_ESP32_SC_W6100_VERSION); 
#else
  Serial.println(WEBSERVER_ESP32_SC_ENC_VERSION);
#endif
 
  Serial.println(ASYNC_UDP_ESP32_SC_ETHERNET_VERSION);

  Serial.setDebugOutput(true);

  ///////////////////////////////////

  initEthernet();

  ///////////////////////////////////

  // Client address
  Serial.print("Async_UDPClient started @ IP address: ");
  Serial.println(ETH.localIP());

  if (udp.connect(remoteIPAddress, UDP_REMOTE_PORT))
  {
    Serial.println("UDP connected");

    udp.onPacket([](AsyncUDPPacket packet)
    {
      parsePacket( packet);
    });

    //Send unicast
    udp.print("Hello Server!");
  }
}

void loop()
{
  delay(2000);
  //Send broadcast on port UDP_REMOTE_PORT = 1234
  udp.broadcastTo("Anyone here?", UDP_REMOTE_PORT);

}

Print this item

  KC868-A8 + KCS + iiC + PCF8574 + TUYA
Posted by: Vall2KAS - 05-28-2024, 11:50 AM - Forum: KC868-A series and Uair Smart Controller - Replies (3)

Dear ALL,
I plan to connect via iic PCF8574 - 4 input - 4 output.
Question: How (or) will the KCS firmware find the PCF8574 and connect these input-outputs to the TUYA? I will buy a TUYA license.

Print this item

  "KCS" v1.0.7 firmware for A32 Pro controller
Posted by: admin - 05-28-2024, 02:44 AM - Forum: "KCS" firmware system - No Replies

improvment:
1. changed process worm momory size.
2. added different delay time when turn ALL relay ON

there are some different files for v1.0.7. delay time: 1ms, 5ms, 10ms, 50ms    4 version.

just added different delay time when turn ON all 32 channel relay output, you can chose by yourself. added the delay time will protect your power system, because if you have connected 32 channel contactor work at the same time,it will cause instantaneous impact on the power grid.


.zip   A32PRO_V1.0.7_1ms.zip (Size: 777.64 KB / Downloads: 78)

.zip   A32PRO_V1.0.7_5ms.zip (Size: 777.7 KB / Downloads: 88)

.zip   A32PRO_V1.0.7_10ms.zip (Size: 777.7 KB / Downloads: 81)

.zip   A32PRO_V1.0.7_50ms.zip (Size: 777.63 KB / Downloads: 77)

Print this item