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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 10,447
» Latest member: bhushan1301
» Forum threads: 4,326
» Forum posts: 21,312

Full Statistics

Online Users
There are currently 340 online users.
» 0 Member(s) | 313 Guest(s)
Amazonbot, AwarioBot, Baidu, Bing, Bytespider, Crawl, Google, HeadlessChrome, PetalBot, Semrush, bot

Latest Threads
kc868-a6 analog input
Forum: KC868-A6
Last Post: admin
Yesterday, 09:56 AM
» Replies: 3
» Views: 403
F24 ESPHome yaml for home...
Forum: F24
Last Post: admin
Yesterday, 07:25 AM
» Replies: 0
» Views: 12
[arduino code examples fo...
Forum: F24
Last Post: admin
Yesterday, 05:35 AM
» Replies: 0
» Views: 15
[arduino code examples fo...
Forum: F24
Last Post: admin
Yesterday, 05:33 AM
» Replies: 0
» Views: 15
[Arduino source code for ...
Forum: KC868-A2
Last Post: admin
Yesterday, 05:31 AM
» Replies: 6
» Views: 1,755
KC868-A4 – Relay 1 clicks...
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
11-03-2026, 11:58 PM
» Replies: 3
» Views: 59
⚡ 40 Buttons, 36 Lighting...
Forum: DIY Project
Last Post: lulu01
11-03-2026, 07:34 PM
» Replies: 24
» Views: 3,062
[arduino code examples fo...
Forum: CO16
Last Post: admin
11-03-2026, 03:04 AM
» Replies: 0
» Views: 26
[arduino code examples fo...
Forum: CO16
Last Post: admin
11-03-2026, 01:34 AM
» Replies: 0
» Views: 29
[arduino code examples fo...
Forum: CO16
Last Post: admin
11-03-2026, 12:15 AM
» Replies: 0
» Views: 30

  esphome yaml file with ADC analog input 0-5v and 4-20mA for KC868-A8S/A8Sv2
Posted by: admin - 11-05-2023, 03:00 AM - Forum: KC868-A8S - No Replies

Code:
esphome:
  name: a8sv2
  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

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

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

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

  - platform: gpio
    name: "a8s_light2"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 1
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a8s_light3"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 2
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a8s_light4"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 3
      mode: OUTPUT
      inverted: true
     
  - platform: gpio
    name: "a8s_light5"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 4
      mode: OUTPUT
      inverted: true
     
     
  - platform: gpio
    name: "a8s_light6"
    pin:
      pcf8574: pcf8574_hub_out_1
      number: 5
      mode: OUTPUT
      inverted: true
     

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

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

     
binary_sensor:
  - platform: gpio
    name: "a8s_input1"
    pin:
      pcf8574: pcf8574_hub_in_1
      number: 0
      mode: INPUT
      inverted: true

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

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

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

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

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

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

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

sensor:
  - platform: adc
    pin: 36
    name: "A8S 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: 34
    name: "A8S 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: 35
    name: "A8S A3 Current"
    update_interval: 5s
    unit_of_measurement: mA
    attenuation: 11db
    filters:
      - multiply: 6.66666666
  - platform: adc
    pin: 39
    name: "A8S A4 Current"
    update_interval: 5s
    unit_of_measurement: mA
    attenuation: 11db
    filters:
      - multiply: 6.66666666

# Enable logging
logger:

# Enable Home Assistant API
api:
yaml file download: 
.txt   KC868-A8S-ha-config-ADC_voltage_current.txt (Size: 3.98 KB / Downloads: 1078)

Print this item

  how to use gpio relay switch by esphome for home assistant
Posted by: admin - 11-05-2023, 02:09 AM - Forum: Getting Started with ESPHome and Home Assistant - No Replies

Print this item

  Future M16 ideas
Posted by: Schmick - 11-04-2023, 10:13 PM - Forum: KC868-M16 / M1 / MB / M30 - Replies (1)

Great work on the M16v2!  Heart

Some thoughts for a future version. Please don't take as criticism!

Could the device be split in two for installation in a surface mount distribution board? I'm thinking that the clamp inputs and voltage inputs could maybe be connected to a DIN module with same dimensions as standard 3 or 4 pole breaker, then using an interface cable, connect that to another smaller low voltage module housing the ESP32, networking and other components.

If the barrel jacks are removed from the clamps, could probably shrink the connections to 2x 16x2.54mm terminal blocks. By splitting the device in two, all the higher voltage wiring and clamp cables could then be neatly concealed and protected against accidental contact. Going even further, if the ADC was able to be done within that module, could maybe even just have the module expose an I2C interface on the front face allowing for lots of flexibility on the low voltage side in terms of how the data is exported.

Print this item

  Micropython
Posted by: ghazidrira - 11-03-2023, 09:04 AM - Forum: KC868-A6 - Replies (7)

Can I program the KC868-A6 PLC with micropython?

Print this item

  how to enable the USB ports on Raspberry Pi CM4
Posted by: admin - 11-01-2023, 04:42 AM - Forum: Getting Started with ESPHome and Home Assistant - No Replies

tomorrow upload.

Print this item

  KC868 firmware PC download tool
Posted by: admin - 11-01-2023, 02:06 AM - Forum: KC868-HA /HA v2 - Replies (4)

   
running on Windows OS computer.

.zip   KC868 Controller Bootloader.zip (Size: 8.56 KB / Downloads: 1140)

Print this item

  KC868-HA v2 firmware V200_231025
Posted by: admin - 11-01-2023, 02:05 AM - Forum: KC868-HA /HA v2 - Replies (8)

[Image: detail1_01.jpg]

.zip   HA485_KU_V200_231025.zip (Size: 6.66 KB / Downloads: 1011)

Print this item

  KC868-HA v1 firmware V108_SP231025
Posted by: admin - 11-01-2023, 02:04 AM - Forum: KC868-HA /HA v2 - No Replies

[Image: kc868-ha_define.jpg]

.zip   HA485_KU_V108_SP231025.zip (Size: 6.44 KB / Downloads: 964)

Print this item

  KC868-HA PC software V1.0.5.1011
Posted by: admin - 11-01-2023, 01:57 AM - Forum: KC868-HA /HA v2 - Replies (19)

make sure your computer have installed CH340 USB-RS232 driver.
   
   

.zip   HA485_Ctrl_V1.0.5.1011.zip (Size: 912.26 KB / Downloads: 1139)

Print this item

  how to install esphome on home assistant for beginner
Posted by: admin - 11-01-2023, 12:36 AM - Forum: Getting Started with ESPHome and Home Assistant - Replies (2)

Print this item