From c3bbfa795a58fd4d8a54c23ba358ab81a8156fe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Fri, 29 Oct 2021 18:01:57 +0200 Subject: [PATCH] Fix pv battery discharge calculation --- sunspec/integrationpluginsunspec.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sunspec/integrationpluginsunspec.cpp b/sunspec/integrationpluginsunspec.cpp index 05fef45..904fcf4 100644 --- a/sunspec/integrationpluginsunspec.cpp +++ b/sunspec/integrationpluginsunspec.cpp @@ -826,10 +826,10 @@ double IntegrationPluginSunSpec::calculateSolarEdgePvProduction(Thing *thing, do // Actual PV = inverter DC power + battery power pvPower = dcPower - battery->batteryData().instantaneousPower; qCDebug(dcSunSpec()) << "--> SolarEdge: calculate actual PV power: inverter DC power - battery power:" << dcPower << "-" << battery->batteryData().instantaneousPower << "=" << pvPower; -// if (pvPower < 0) { -// qCDebug(dcSunSpec()) << "--> SolarEdge: actual PV power: 0W | loss:" << pvPower << "W"; -// pvPower = 0; -// } + if (pvPower > 0) { + qCDebug(dcSunSpec()) << "--> SolarEdge: actual PV power: 0W | loss:" << pvPower << "W"; + pvPower = 0; + } break; } default: