ESP8266 with Clamp Sensor HSTS016L

Hi,

i have an ESP8266 and tried to get the current Amperes to calculate Watt with an Clamp Sensor.

This is the Sensor:

This is my ESPHome Code, but i dont get a successful value out there.

esphome:
  name: solarproduktion
  friendly_name: Solarproduktion

# d1 mini pro but only with 4MB -> d1_mini
esp8266:
  board: d1_mini 
  restore_from_flash: no

sensor:
  - platform: ct_clamp
    sensor: adc_sensor
    name: "Power Sensor Live Power"
    update_interval: 5s
    accuracy_decimals: 8
  - platform: adc
    pin: A0
    id: adc_sensor
    internal: true
    update_interval: 5s
    filters:
      - multiply: 3.3

switch:
  - platform: factory_reset
    name: Restart with Factory Default Settings

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Solarproduktion Fallback Hotspot"
    password: "xxxxxx"

captive_portal:

I got that results:

[09:41:14][D][ct_clamp:040]: 'Power Sensor Live Power' - Raw AC Value: 0.000A after 35 different samples (58 SPS)
[09:41:14][D][sensor:093]: 'Power Sensor Live Power': Sending state 0.00049 A with 8 decimals of accuracy
[09:41:18][D][sensor:093]: 'adc_sensor': Sending state 2.53301 V with 2 decimals of accuracy

Did anyone has an idea and can help me to setup the ESPHome Code to get it running?
I never do something with that things, thats my problem :confused:

I tested with Loading a 12V Battery with 4A.
But i will use it on a ~48V Solarsystem to track what i get out of the sun.

2 Likes