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

Allow battery energy to reset to zero #122

Merged
merged 9 commits into from
Oct 24, 2022
Merged

Allow battery energy to reset to zero #122

merged 9 commits into from
Oct 24, 2022

Conversation

WillCodeForCats
Copy link
Owner

@WillCodeForCats WillCodeForCats commented Oct 6, 2022

It was assumed that battery energy for import/export were lifetime counters (per description in docs), but this may not be the case as reported in issue #118. Allow reset to zero, and log warning if they go backwards.

It was assumed that battery energy for import/export were lifetime counters (per description in docs), but this may not be the case as reported in issue #118. Allow display and reset to zero, and log error if they go backwards.
@WillCodeForCats WillCodeForCats linked an issue Oct 6, 2022 that may be closed by this pull request
@WillCodeForCats WillCodeForCats self-assigned this Oct 6, 2022
@WillCodeForCats WillCodeForCats added hardware Issue related to hardware help wanted Extra attention is needed labels Oct 6, 2022
@WillCodeForCats
Copy link
Owner Author

If anyone else with a battery has or has not observed the battery energy import/export counters resetting to zero, your feedback is needed.

@mpredfearn
Copy link
Contributor

mpredfearn commented Oct 13, 2022

The counters on my LG RESU7H battery reset to 0 quite regularly (with no discernable pattern). I did raise a ticket with Solaredge pointing out that this behaviour is in violation of their documented register specification - but unsurprisingly I got no response.
Here's the graphs of my battery's SoE, charged and discharged energy over the last 24 hours. As you can see, both charged and discharged have reset twice. Also charged != discharged, even when the battery charged from 10% and then discharged back to 10% over the course yesterday until 8pm.

You can also see that the "charged" value is totally wrong, as it reports almost 3kWh being charged to the battery during the period ~2am-4am, during which time the SoE of the battery is a constant 40%.

This behaviour is rather infuriating as these counters are therefore useless for the energy dashboard and I ended up using the "integration" integration to integrate the instantaneous battery power - but that has it's own issues.

Screenshot_2022-10-13_15-14-35

@WillCodeForCats
Copy link
Owner Author

What are the problems with the "integration" method?

@mpredfearn
Copy link
Contributor

mpredfearn commented Oct 13, 2022

What are the problems with the "integration" method?

Integrating the area under the curve of the power graph is quite lossy, you need to have a high sample rate of the power to get the "best" result, but short spikes will be missed completely, and the integral of the power will be quite wrong depending on what the power does between samples, so the sensors are never 100% accurate. That results in the charged / discharged results diverging over time. For example, my "charged" sensor integrated from the battery power currently has a value of 1945kWh, wheras "discharged" has 1440kWh. Clearly half a megawatt-hour did not vanish, this is simply because even sampling the registers at an interval of 10seconds, spikes are missed and the graphs diverge over time. It's a real-time problem that requires much faster sampling, or the BMS to actually report the correct numbers ;-)

Screenshot_2022-10-13_16-31-18

@WillCodeForCats
Copy link
Owner Author

So then it sounds like there's no real "fix" becasue even if by allowing it to reset to zero (even though the docs call it a "lifetime" counter) it could have reset between reads and there's no way to know that happened. If the integration kept its own running total it would still have the missing data from resetting to zero randomly problem.

@WillCodeForCats
Copy link
Owner Author

What I'll plan on doing then is make the changes to allow battery import and export energy to reset to zero which will also log a warning if it happens, and I've created a "known issues" wiki page that documents this.

@WillCodeForCats WillCodeForCats changed the title Allow battery energy to reset Allow battery energy to reset to zero Oct 24, 2022
@WillCodeForCats WillCodeForCats merged commit 8c5905c into main Oct 24, 2022
@WillCodeForCats
Copy link
Owner Author

Allowing battery energy to reset to zero has been added to Release v2.2.6-pre.2

A note about this issue has been added to the wiki: https://github.com/WillCodeForCats/solaredge-modbus-multi/wiki/Known-Issues#battery-energy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hardware Issue related to hardware help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Battery data - unknown
2 participants