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

Sum: add Power and Energy distribution channels #2923

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

sfeilmeier
Copy link
Contributor

This PR adds a feature to closely analyze in real-time and for historic values, how the power and energy distributed between Grid, Production, Energy-Storage-System and Consumption, i.e. how much grid-buy energy was charged to the battery; how much grid-sell energy was discharged from a battery, etc.

This PR adds new Channels to the _sum component, that represent power and energy distribution:

  • PRODUCTION_TO_CONSUMPTION_POWER / PRODUCTION_TO_CONSUMPTION_ENERGY
  • PRODUCTION_TO_GRID_POWER / PRODUCTION_TO_GRID_ENERGY
  • PRODUCTION_TO_ESS_POWER / PRODUCTION_TO_ESS_ENERGY
  • GRID_TO_CONSUMPTION_POWER / GRID_TO_CONSUMPTION_ENERGY
  • ESS_TO_CONSUMPTION_POWER / ESS_TO_CONSUMPTION_ENERGY
  • GRID_TO_ESS_POWER / GRID_TO_ESS_ENERGY / ESS_TO_GRID_ENERGY

The unit test in PowerDistributionTest.java shows some example distributions:

  • Grid Sell -1000 W, Production 2000 W, ESS Discharge 500 W (Consumption is 1500 W in this case)
    • 1000 W Production-to-Consumption
    • 1000 W Production-to-Grid
    • 500 W ESS-to-Consumption

These values will be useful in a UI visualization in future. The feature has been successfully tested locally on my private system.

One downside of the approach with CalculateEnergyFromPower is, that the resulting energy values might be slightly different to e.g. CONSUMPTION_ACTIVE_ENERGY. It's difficult to overcome this - but in reality a few Wh difference might not make a difference.

Copy link

codecov bot commented Dec 15, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 18 lines in your changes missing coverage. Please review.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #2923      +/-   ##
=============================================
+ Coverage      56.62%   56.64%   +0.02%     
- Complexity      9504     9515      +11     
=============================================
  Files           2251     2252       +1     
  Lines          96049    96155     +106     
  Branches        7090     7097       +7     
=============================================
+ Hits           54382    54461      +79     
- Misses         39667    39689      +22     
- Partials        2000     2005       +5     

@sfeilmeier
Copy link
Contributor Author

We are discussing this feature in the Community: https://community.openems.io/t/proposal-add-power-and-energy-distribution-channels-to-sum/3283/9

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.

1 participant