feature-requests icon indicating copy to clipboard operation
feature-requests copied to clipboard

Increase resolution of (energy) meter reporting whole (kWh) only and current (power in W), by summarizing (energy) up to the next whole (kWh)

Open makuser opened this issue 1 year ago • 1 comments

Describe the problem you have/What new integration you would like Energy meters often provide their measured energy consumption in integers, even many of those, that measure fractional values. E.g. if the measured consumption is at 1001,37 kWh, only 1001 will be sent out. This unfortunately decreases the consumption resolution quite a lot.

Recently I setup a Tibber Pulse IR, which due to the used protocol can also only read whole kWh integers, but since the current power is also read, they are intelligently interpolating the consumption, between whole kWhs.

What they are doing is constantly reading the current power, which is measured and reported in W, measuring the consumption as usual, by calculating how for long how many watts are used and then adding that to the last measurement of the whole kWh. This could result in 3 additional decimal places, due to the fact that the power is reported in W instead of kW.

They are probably also doing some checks, that using their summarizing logic, the decimal part would always remain <1, because due to the fact the meter will sample the power much more often than the IR reader would read the values, the inaccuracies on the external interpolation, especially during heavily changing power loads would be amplified.

Overall, this trade-off of intermittent small inaccuracies up to the next whole integer would still be worth it IMO, to acquire much more granular consumption data.

Let me show you the example from my energy meter. In my case, I had to unlock the ability to read the current power from my meter using a PIN, which then made me realize what the Tibber Pulse could achieve with this additional data. You can clearly see the time when it started to interpolate the consumption data between whole kWh. March 4th, no interpolation there March 5th, interpolation starting at some point during the day March 6th, interpolation the entire time

And just to make this clear, when I unlocked the current power value, I still do not get the energy consumption as float, but still only as an integer, so only whole kWhs are reported, the rest is really just interpolated using the whole kWh readings and the wattage.

Please describe your use case for this integration and alternatives you've tried: I have not yet tried or started to write some lambda for a template sensor that would do the calculations, I would like to get your input, if that is something you'd like to see as a component, for easier usage.

Have any of you already done something like this (not just in ESPhome, could be anywhere else) or would you feel this could be useful for you?

Additional context A component instead of individual lambdas could allow for an easy usage such as this:

Example of component for energy consumption

  - platform: interpolation
    name: "Energy kWh"
    id: energy_kwh
    type: energy
    unit_of_measurement: "kWh"
    totaled_sensor: energy_meter_total_energy
    totaled_type: "kWh"
    total_time: 1h
    instant_sensor: energy_meter_current_power
    instant_type: "W"
    instant_factor: 1000

Example of component for water consumption

  - platform: interpolation
    name: "Water Usage"
    id: water_m3
    type: volumetric
    unit_of_measurement: "m3"
    totaled_sensor: water_meter_total_m3
    totaled_type: "m3"
    total_time: 1h
    instant_sensor: water_meter_current_flow
    instant_type: "l/h"
    instant_factor: 1000
# or
  - platform: interpolation
    name: "Water Usage"
    id: water_m3
    type: volumetric
    unit_of_measurement: "m3"
    totaled_sensor: water_meter_total_m3
    totaled_type: "m3"
    total_time: 1h
    instant_sensor: water_meter_current_flow
    instant_type: "m3/h"
    instant_factor: 1

makuser avatar May 06 '24 11:05 makuser

I now implemented this for a couple of flats to see whether this would be feasible and useful with the default refresh rates and IMO, except for a few occurrences, where there were power spikes, it looks good to me.

Bildschirmfoto vom 2024-05-07 12-44-58 Bildschirmfoto vom 2024-05-07 12-45-17 Bildschirmfoto vom 2024-05-07 12-45-41 Bildschirmfoto vom 2024-05-07 12-46-10 Bildschirmfoto vom 2024-05-07 12-46-51 energy consumption graph with power profile below, explaining the imperfect match between the interpolated consumption reading and that of the actual energy meter. Bildschirmfoto vom 2024-05-07 12-47-23 Bildschirmfoto vom 2024-05-07 12-52-35

You can see right before the first time the kWh value from the energy meter jumped from one whole integer to the next, that the calculated consumption does not match for all of the flats. That is due to the fact I did not catch all of the energy usage before the implementation was activated, but afterwards it is generally perfectly synced up.

Now I'm waiting to see whether you think this would be useful for a general inclusion into esphome.

makuser avatar May 07 '24 11:05 makuser