Total Daily Energy Sensor convert m³ to kWh

Hello,

I am currently using a pulse meter sensor to monitor the reed switch of a gas meter. The setup is functioning quite well; however, I am encountering an issue with the Total Daily Energy Sensor component. It is returning a value that is significantly lower than expected. I suspect this is due to the fact that I am measuring in cubic meters (m³) rather than watts (W), so I am actually recording watt-hours (Wh) and not watts, which might be causing incorrect unit dimensions in the measurements. Could you provide any guidance on how to configure this correctly?

Additionally, I am experiencing a time discrepancy of over an hour between Home Assistant and ESPHome. Do you have any suggestions on how to resolve this issue?

sensor:
  - platform: pulse_meter
    name: 'Gaszaehler 1'
    id: sensor_pulse_meter # Optional ID, necessary if you want to calculate the total number of pulses.
    unit_of_measurement: 'm3'
    device_class: gas
    state_class: measurement
    internal_filter: 50ms # Assuming maximum load of 16 kW and 10000 impulses per kWh, any pulses faster than 22.5 ms would exceed load. -10% ~= 20 ms.
    accuracy_decimals: 0
    pin:
      number: GPIO13
      inverted: true
      mode:
        input: true
        pullup: true
    total:
      name: "Gaszähler 1 Total"
      unit_of_measurement: "kWh"
      device_class: energy
      state_class: total_increasing
      accuracy_decimals: 3
      filters:
        - multiply: 10.88  # (1/10000 pulses per kWh)
        # - throttle_average: 10s
        # - filter_out: NaN
  - platform: total_daily_energy
    name: 'Gaszähler Täglicher Verbrauch'
    id: sensor_total_daily_energy
    power_id: sensor_pulse_meter
    unit_of_measurement: 'kWh'
    state_class: total_increasing
    device_class: energy
    accuracy_decimals: 3
    filters:
      - multiply: 10.88

time:
  - platform: homeassistant
    id: homeassistant_time

What is your meters output (written on the meter)? 1pulse per 0.01m3 ?

Hi,
it’s one pulse per m³

I don’t see a way you could use total_daily_energy to measure anything else than power over time.

Did you try with integration sensor?

https://esphome.io/components/time/homeassistant.html

Hello, thank you for your message. I have already incorporated this into the ESPHome code, but I’m experiencing a one-hour offset, which might be due to daylight saving time adjustments.

HA and probably also ESPHome works with UTC times, which is without daylight saving, so CET (winter time in most of Europe will be one hour off) and CEST (sommer time in most of Europe will be 2 hours off).
HA and probably also ESPHome can be told to represent times in what timezone you want when you need to print it on a screen or likewise.

I’m always using sntp time

time:
  - platform: sntp
    id: sntp_time
    timezone: Europe/Rome