diff --git a/io.openems.edge.core/src/io/openems/edge/core/sum/SumImpl.java b/io.openems.edge.core/src/io/openems/edge/core/sum/SumImpl.java index 0c2ab3c0ac0..6d0e19c349b 100644 --- a/io.openems.edge.core/src/io/openems/edge/core/sum/SumImpl.java +++ b/io.openems.edge.core/src/io/openems/edge/core/sum/SumImpl.java @@ -135,7 +135,8 @@ private void calculateChannelValues() { final var essDcChargeEnergy = new CalculateLongSum(); final var essDcDischargeEnergy = new CalculateLongSum(); final var essCapacity = new CalculateIntegerSum(); - + final var essDcDischargePower = new CalculateIntegerSum(); + // Grid final var gridActivePower = new CalculateIntegerSum(); final var gridActivePowerL1 = new CalculateIntegerSum(); @@ -156,6 +157,7 @@ private void calculateChannelValues() { final var productionMaxDcActualPower = new CalculateIntegerSum(); final var productionAcActiveEnergy = new CalculateLongSum(); final var productionDcActiveEnergy = new CalculateLongSum(); + // handling the corner-case of wrongly measured negative production, due to // cabling errors, etc. final var productionAcActiveEnergyNegative = new CalculateLongSum(); @@ -195,6 +197,7 @@ private void calculateChannelValues() { var e = (HybridEss) ess; essDcChargeEnergy.addValue(e.getDcChargeEnergyChannel()); essDcDischargeEnergy.addValue(e.getDcDischargeEnergyChannel()); + essDcDischargePower.addValue(e.getDcDischargePowerChannel()); } else { essDcChargeEnergy.addValue(ess.getActiveChargeEnergyChannel()); essDcDischargeEnergy.addValue(ess.getActiveDischargeEnergyChannel()); @@ -387,8 +390,9 @@ private void calculateChannelValues() { Optional.ofNullable(enterTheSystem).orElse(0L) - Optional.ofNullable(leaveTheSystem).orElse(0L)); // Further calculated Channels + var essDischargePowerSum = essDcDischargePower.calculate(); this.getEssDischargePowerChannel() - .setNextValue(TypeUtils.subtract(essActivePowerSum, productionDcActualPowerSum)); + .setNextValue(essDischargePowerSum); } /**