Closed pacemaker82 closed 5 months ago
It seems this might be due to rounding. the attribute cost
is rounded up/down which when totalled up is missing some fractional costs. If I loop through the rate
* consumption
I do return the same total as the total_without_standing_charge
attribute.
Leaving this open in case you might consider having the cost field be more accurate.
This has been like this for quite a while and originates for when the field was originally a string with £/p denominations representations. Agreed this can probably afford to be a bit more accurate, but would be a breaking change in the integration (as people might be relying on this to be more "human readable", for instance if plotted on a graph).
As I try and group up breaking changes in batches (to make it less annoying for users), the fix will be delayed. But for now, I'll update the docs to make this clear that it's rounded.
I just came across this whilst plotting my half hourly costs - where the nigh time values were all suspiciously 1p exactly. I've now worked around it by calculating my own cost - but it might be good to consider exposing the real cost or including more significant figures.
This issue has become stale because it has been open for 30 days with no activity. If you still think it's an issue, please respond soon.
This issue has been closed because it has been inactive for 14 days since being marked as stale. This is done to help keep on top of active issues. If you still think it's an issue, please respond to this issue
Describe the bug
Expecting that the charges in the "charges" attribute add up to the same value as the total without standing charge. Given the code below, iterating through the charges I retrieve two values:
Where
Calculated Balance
is me looping through the charges and adding them up, andGiven Balance
is the total without standing charge attribute value.Reproduction steps
Pasting below my attributes:
Expected behaviour
Both outputs should match.
Tariff Code
E-1R-INTELLI-BB-VAR-23-03-01-J
Integration Version
10.1.2
Home Assistant Version
2024.2.2
Fresh Install?
Fresh install
Home Assistant Logs
n/a
Confirmation