Pulse Counter Configuration ESP8266 and energy-meter with S0 interface

Hello!

I am new here in the community and als a newbie acc. ESP.

I started a new project, counting my power-pulses with an energy-meter and S0 interface.
My energy-meter is this model: ORNO OR-WE-520 with 800 imp/kWh
I am using an AZDelivery D1 Mini NodeMcu ESP8266

I collected some infomation by checking some community-platforms, web-sites, youtube-videos and so on.

After some discussions in some communities, I made a wiring acc. this sheme in the screenshot. (s. attached file)

After that, I started the integration in Home Assistant with this YAML-code.
(FYI - I have no idea in YAML-Coding and i just copied some collected codes to one script together! :wink: - Trying to configurate some parameters to my requirements).

esphome:
  name: esphome-web-106a47
  friendly_name: ESP-Counter-Test
  comment: Stromzaehler-Test-01

esp8266:
  board: esp01_1m

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "XXX"
    password: "XXX"
 
captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "XXX"

ota:

sensor:
  - platform: pulse_counter
    pin: GPIO13
    id: t1
    unit_of_measurement: 'W'
    accuracy_decimals: 2
    name: 'ESP-Stromzähler-Test'
    update_interval: 20s
    filters:
      - multiply: 75    
    # - multiply: 0.75 gives kW
    total:  
      unit_of_measurement: 'kWh'
      accuracy_decimals: 1
      name: 'ESP Stromzähler Test Total'
      id: t1_total
      filters:
        - multiply: 0.001

First, i thought the ESP works fine.
But. After some hours, i checked the graph in Home Assistant and it looks like the following screenshots. (s. attached file)

As you can see, there are some “Peaks” in the graphs.
One peak has a maximum of 66kW! This can`t be. (s. attached file)

Soome measured points beginning at 0W till approximately 200W
Some points beginning at 200W till 400W
Some points beginning at 400W till 600W
This is very confusing. (s. attached file)

(FYI - As a new user in this community, I am not allowed uploading more than one attachment - So I have to combine all pictures and screenshot in one file - sorry for that)

Now I have some questions.

  • Do you have an idea, why there are som peaks?
  • Is the YAML-Code correct?
  • Is the wiring correct?
  • Do you have some tips for a Home Assistant and ESP newbie?

In sum, I have 6 energy-meters which I am going to count with ESP8266.
And one project, for counting an water-meter.

But first, I’ll try it with this ESP-Test-Counter. And if this works, I can go one step further. :wink: -

And after that, I am sure, I’ll come back to this community!

In advance, thanks for your answers and tips!
Sigi-77

Has anyone an idea?

Any idea? I have still peaks!

hello,

try pullup or pulldown the gpio (D1) you use, like this : this is my config for a pulse sensor with hall effect on a water valve :

  - platform: pulse_counter
    pin:
      number: GPIO25
      mode:
        input: true
        pullup: true
    unit_of_measurement: 'L/min'
    accuracy_decimals: 2
    id: main_water_flow_meter
    name: "Débit d'eau instantané général"
    update_interval: 5s
    filters:
      - lambda: return (x / 396); # 396 = 6,6 * 60

seems D1 is not pullup or pulldown by default

or try another pin?