Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
makuser opened this issue May 6, 2024 · 1 comment

Comments

@makuser
Copy link

makuser commented May 6, 2024

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 makuser changed the title Increase resolution of energy meter reporting whole kWh only and current power in W, by summarizing energy up to the next whole kWh Increase resolution of (energy) meter reporting whole (kWh) only and current (power in W), by summarizing (energy) up to the next whole (kWh) May 6, 2024
@makuser
Copy link
Author

makuser commented May 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant