Issue with recorder.import_statistics for Historical Energy Data #896
Unanswered
cloudbr34k84
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Background
I am trying to import historical solar energy production data into Home Assistant using
recorder.import_statistics
. My energy sensor (sensor.symo_10_0_3_m_1_total_energy
) already tracks a cumulative total energy value in Wh. I am trying to ensure that Home Assistant correctly processes this historical data without calculating incorrect deltas.What I Know About
state
andsum
state
should be the exact total energy reading at a given timestamp.sum
should be the total accumulated energy recorded by Home Assistant (it should not be a daily increment but should always be increasing).sum
does not represent the sum of all previousstate
values, but rather the cumulative energy tracked by Home Assistant.Data I Am Trying to Import
Approaches I Have Tried
1. Importing with
sum
matchingstate
Result:
sum
reflecting the total accumulated energy, it treatedsum
as a daily increment and subtracted previous values, leading to incorrect results (e.g.,sum
showing10902.27
instead of41992.89
).2. Importing with
sum
as a cumulative differenceResult:
state
value again, leading to an incorrectsum
value.sum
field is not behaving as expected when importing historical data.The Issue
sum
as a daily increase instead of an actual running total.sum
values are not matching the expected total energy values.sum
is handled.What I Need Help With
sum
be defined when importing historical data for a sensor that already tracks a cumulative total?sum
be left out, or should it matchstate
?Would appreciate any guidance on how to correctly import historical energy data for a sensor that already tracks a cumulative total. Thanks in advance! 🙏
Beta Was this translation helpful? Give feedback.
All reactions