Assuming that your measuring device outputs 1000 pulses per kWh your code should be correct.
However, looking at your results it looks like there is a reduction of approx. 20 %, and this difference is reasonable constant over these three months:
So how sure are you about the 1000 pulses / kWh?
What kind of power sensor is this? Is it a S0 pulse meter?
One solution could be to modify your filters such that the measured value comes closer to the real value, by multiplying the filter values by 1.23 like this:
sensor:
- platform: pulse_meter
pin: 12
unit_of_measurement: 'kW'
name: 'Electricity Usage'
# internal_filter: 100ms
accuracy_decimals: 3
filters:
- multiply: 0.0738
total:
name: "Electricity Total"
unit_of_measurement: "kWh"
accuracy_decimals: 3
filters:
- multiply: 0.00123
Another option to try is enabling the internal_filter
setting and set it to 50 or 100 ms, which is recommended for S0 pulse meters.
A third option could be to change the Pulse Meter Sensor into a Pulse Counter Sensor, but I don’t expect this will make a difference in this case. The difference between these two sensors is nicely explained here: ESPHome_Pulse_counter vs pulse_meter.