# Struggling with Power-Solver

**URL:** <https://community.openems.io/t/struggling-with-power-solver/2159>\
**Category:** English Forum\
**Created:** [November 29, 2023, 6:49am UTC](https://community.openems.io/t/struggling-with-power-solver/2159 "2023-11-29T06:49:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![klinki](https://community.openems.io/letter_avatar_proxy/v4/letter/k/858c86/32.png) [@klinki](https://community.openems.io/u/klinki)\
**Post date:** [November 29, 2023, 6:49am UTC](https://community.openems.io/t/struggling-with-power-solver/2159/1 "2023-11-29T06:49:16Z")

</div>

Hi Forum,

I have a problem with the power-solver. It tells the ESS how to charge or discharge. However, there are sporadic values that don’t match the others. For example, 30 times -100W and then twice 300W, then again -100W. I suspect a problem with reading the data from the inverter - but I can’t figure it out.

Since the seemingly incorrect values only occur sporadically, debugging is difficult. At which point should I expand the DebugLog to output the input values for the Solver class?

Regards,  
klinki

---

<div class="post-metadata">

**Author:** ![tsicking](https://community.openems.io/user_avatar/community.openems.io/tsicking/32/954_2.png) [@tsicking](https://community.openems.io/u/tsicking)\
**Post date:** [November 30, 2023, 8:09am UTC](https://community.openems.io/t/struggling-with-power-solver/2159/2 "2023-11-30T08:09:07Z")

</div>

Hi klinki,

You may have already done this, but you can enable the debug mode in the Ess.Power-component. You will get all active EQUALS-constraints as log output together with the component it comes from.  
If you want to see even more, you can remove the if-clause in line 145 here:

> <https://github.com/OpenEMS/openems/blob/edfe1f0ac47a70f25c7c6456289d58344b6c3ab7/io.openems.edge.ess.core/src/io/openems/edge/ess/core/power/Solver.java#L145>

Then you even see all constraints, could be quite many though.  
I hope that helps a bit.

Best regards,  
Thomas

---

<div class="post-metadata">

**Author:** ![klinki](https://community.openems.io/letter_avatar_proxy/v4/letter/k/858c86/32.png) [@klinki](https://community.openems.io/u/klinki)\
**Post date:** [December 1, 2023, 1:16pm UTC](https://community.openems.io/t/struggling-with-power-solver/2159/3 "2023-12-01T13:16:51Z")

</div>

Hi Thomas,

Thanks for the advice - but it’s not quite what I am looking for. The immediate issue is the problems that occur with my PV inverter/ESS. The solver works properly in simulation. However, there appears to be a problem in the actual implementation, described [here](https://community.openems.io/t/solaredge-hybridwechselrichter-mit-batterie-steuern/1436/41). I’ve implemented a workaround with a moving average, which works well, but nobody’s happy using workarounds…

I want to find out what the solver takes as input, e.g., Grid-Power. The strategy is “moving towards target”.

But it´s in fact interesting seeing all the constraints

Regards, Thomas (klinki)

EDIT: I think I have to look further into the component which controls the ESS 🫣  
EDIT: I´ve implemented a DebugLog in the BalancingController. So I can have a real-time look on what´s being passed to the Solver class
