Pulse_counter ESPHOME vs. Tasmota

Tasmota version: Tasmota 12.1.1 by Theo Arends

Tasmota shows 93 watt. This value is correct.

Tasmota_power

ESPHome version: 2022.9.1 compiled on Sep 25 2022, 14:12:10

ESPHome shows sometimes 160W, 60W, 120W.

Do i make a mistake or can i fix this via the settings of the pulse_counter ?


globals:
  # eacWSZ-50A
  # Impulsauflösung: 1000imp/kWh
  # Impuls Anschluss:
  # Schaltspannung 5-27VDC, Strom≤27mA ≤100mW Impulsweite 90ms,
  # Impulsausgang an Klemme 20 und 21
  - id: pulse_rate
    type: int
    restore_value: yes
    initial_value: "1000"

sensor:

  - platform: pulse_counter
    pin: 12
    unit_of_measurement: 'W'
    id: EAC_S12
    name: ${friendly_name} S12
    icon: 'mdi:flash'
    state_class: measurement
    device_class: power
    accuracy_decimals: 2
    internal_filter: 10us
    filters:
      - lambda: return x * 60.0;

    total:
      unit_of_measurement: 'kWh'
      id: EAC_S12_TOTAL
      name: ${friendly_name} S12 Total
      state_class: total_increasing
      device_class: energy
      icon: "mdi:flash"
      accuracy_decimals: 3
      filters:
          - lambda: return x * (1.0 / id(pulse_rate));

I am also looking for help on how many S0 sensors I can connect on an ESP32 (az-delivery-devkit-v4).

Can I use these GIPOs ?

GPIO pin: 3, 12, 5, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 34

Sample Project see: GitHub - rbrunken/ImpulseMeter: Collect impulses from a S0 interface of a energy meter and published it to a MQTT broker. It is running on a ESP32 Module.

I don’t have this sensor so probably can’t help much. Since you trust the Tasmota numbers, why base the ESPHome calculations on a different project? Are they the same as Tasmota? I’d probably start by seeing what calculations/settings that Tasmota uses.

Yes, because i use a simple 100W lightbulb for testing.

why base the ESPHome calculations on a different project?

Because I have 34 S0 sensors (eacWSZ-50A) and only one can be connected to a Tasmota device (Sonoff POW). I only used this because I wanted to check the power measurement.

Hi, I have attached my ESPhome code below which definitely works as my usage matches my electricity supplier invoices. The main difference is that I used the pulse_meter platform whereas you seem to have used pulse_counter. I do not know what the difference is between the two.

  - platform: pulse_meter
    pin: GPIO4
    unit_of_measurement: 'kW'
    accuracy_decimals: 1
    name: 'Meter Power'
    filters:
      - multiply: 0.06
    total:
      name: "Meter Energy"
      unit_of_measurement: "kWh"
      accuracy_decimals: 1
      filters:
        - multiply: 0.001

See:

Pulse Counter is counting for some period of time and after that time, it shows you the number of counts per minute (multiplied by a factor => electric power in my case).