Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-A128 configure for ESPhome
#17
this is analog input code for ESPHome:
Code:
sensor:
  - platform: adc
    pin: 39
    name: "A128 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: "A128 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: 36
    name: "A128 A3 Current"
    update_interval: 5s
    unit_of_measurement: mA
    attenuation: 11db
    filters:
      - multiply: 6.66666666
  - platform: adc
    pin: 35
    name: "A128 A4 Current"
    update_interval: 5s
    unit_of_measurement: mA
    attenuation: 11db
    filters:
      - multiply: 6.66666666
Reply


Messages In This Thread
KC868-A128 configure for ESPhome - by admin - 08-04-2022, 09:47 PM
RE: KC868-A128 configure for ESPhome - by mikolaj - 12-24-2022, 07:48 PM
RE: KC868-A128 configure for ESPhome - by mikolaj - 12-24-2022, 07:50 PM
RE: KC868-A128 configure for ESPhome - by mikolaj - 12-24-2022, 07:51 PM
RE: KC868-A128 configure for ESPhome - by admin - 12-25-2022, 12:21 AM
RE: KC868-A128 configure for ESPhome - by mikolaj - 12-26-2022, 12:16 PM
RE: KC868-A128 configure for ESPhome - by admin - 12-27-2022, 02:21 AM
RE: KC868-A128 configure for ESPhome - by mikolaj - 12-27-2022, 05:07 PM
RE: KC868-A128 configure for ESPhome - by admin - 12-28-2022, 01:19 AM
RE: KC868-A128 configure for ESPhome - by kbo - 02-11-2023, 09:34 AM
RE: KC868-A128 configure for ESPhome - by admin - 02-12-2023, 12:55 AM
RE: KC868-A128 configure for ESPhome - by soethu - 12-03-2023, 09:08 PM
RE: KC868-A128 configure for ESPhome - by admin - 12-04-2023, 02:25 AM
RE: KC868-A128 configure for ESPhome - by soethu - 12-04-2023, 04:57 AM
RE: KC868-A128 configure for ESPhome - by admin - 12-04-2023, 08:14 AM
RE: KC868-A128 configure for ESPhome - by admin - 05-27-2025, 06:39 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)