ESPHome total_daily_energy sensor rainfall

I am still trying to use total_daily_energy sensor to get the total rainfall in a day, and have this amount reset at midnight. However, it does not report as expected. While my pulse_meter total value shows the total number of pulses recorded (calibrated to inches of rain), the total_daily_energy sensor shows a slightly different value. Is this due to the Riemann sum method that the sensor uses? Why does it not simply sum together all the values it receives?

I am thinking about sticking with the pulse_meter total value and resetting that each day at midnight.

Edit: What are the differences between the left, right, and trapezoidal methods? I do not understand this.

See this post:

As water is not energy, you probably want this sensor instead:

Thank you for this information. I have moved away from the total_daily_energy sensor, and I am now just using one pulse_meter sensor for my rain gauge, with a total: which resets at midnight via:

on_...:
  then:
    - pulse_meter.set_total_pulses:
        id: pulse_meter_id
        value: 0

This way, I get rain per minute as well as total daily rainfall in just a few lines of code and one sensor.