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

Feature/scaled remaining capacity #557

Merged

Conversation

amarofarinha
Copy link
Collaborator

What

Implemented a new calculation for the reported remaining capacity in watt-hours (reported_remaining_capacity_Wh), accounting for the minimum SOC percentage. The new logic subtracts the capacity reserved by the minimum SOC from the total remaining capacity.

Why

This change resolves an issue where the remaining capacity did not properly account for the minimum SOC margin, causing inaccurate reporting of available battery capacity. The fix addresses bug #479, ensuring that the battery emulator accurately reflects the usable capacity, excluding the portion that cannot be discharged due to the defined minimum SOC margin.

How

  • Added reported_remaining_capacity_Wh to datalayer and a calculation that removes the unused capacity based on the min_percentage setting (expressed in basis points).
  • Updated reported_remaining_capacity_Wh to reflect the adjusted remaining capacity after the minimum SOC margin is applied.
  • Changed inverter files to send the newly created datalayer.battery.status.reported_remaining_capacity_Wh instead of the previous remaining_capacity_Wh.

Copy link
Owner

@dalathegreat dalathegreat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change! Thanks for fixing this 👍

@amarofarinha amarofarinha merged commit 503f113 into dalathegreat:main Oct 23, 2024
30 checks passed
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

Successfully merging this pull request may close these issues.

2 participants