esphome / esphome/feature-requests
Increase resolution of (energy) meter reporting whole (kWh) only and current (power in W), by summarizing (energy) up to the next whole (kWh)
- Dominant language
- No language data
- Stars
- 450
- Forks
- 29
- PR merge metrics
- No merged PRs in 30d
Description
**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.



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
```yaml
- 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
```yaml
- 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
```
Contributor guide
No contributing guide indexed for this repository
Research direction
No source file or test is named. Start by locating the ESPHome component and configuration patterns matching the proposed `interpolation` YAML, then determine how the totaled energy and instantaneous power inputs would be combined. Done means a supported component can expose the interpolated consumption while keeping the accumulated value consistent with whole-unit meter readings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- yaml
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100