Feature: use VE.Direct "network total DC power"

1. makes the DPL use the power generated by all connected charge
   controllers for calculations based on solar passthrough.
2. makes the network total DC power appear as "MPPT Total Power" in the
   live view at the top.
3. shows the network total DC power in the VE.Direct live data card.
This commit is contained in:
Bernhard Kirchen 2024-04-01 20:46:00 +02:00 committed by Bernhard Kirchen
parent 6b8c93d2e6
commit 21cdc69625
5 changed files with 28 additions and 0 deletions

View File

@ -140,6 +140,17 @@ int32_t VictronMpptClass::getPowerOutputWatts() const
for (const auto& upController : _controllers) { for (const auto& upController : _controllers) {
if (!upController->isDataValid()) { continue; } if (!upController->isDataValid()) { continue; }
// if any charge controller is part of a VE.Smart network, and if the
// charge controller is connected in a way that allows to send
// requests, we should have the "network total DC input power"
// available. if so, to estimate the output power, we multiply by
// the calculated efficiency of the connected charge controller.
auto networkPower = upController->getData().NetworkTotalDcInputPowerMilliWatts;
if (networkPower.first > 0) {
return static_cast<int32_t>(networkPower.second / 1000.0 * upController->getData().E / 100);
}
sum += upController->getData().P; sum += upController->getData().P;
} }
@ -152,6 +163,15 @@ int32_t VictronMpptClass::getPanelPowerWatts() const
for (const auto& upController : _controllers) { for (const auto& upController : _controllers) {
if (!upController->isDataValid()) { continue; } if (!upController->isDataValid()) { continue; }
// if any charge controller is part of a VE.Smart network, and if the
// charge controller is connected in a way that allows to send
// requests, we should have the "network total DC input power" available.
auto networkPower = upController->getData().NetworkTotalDcInputPowerMilliWatts;
if (networkPower.first > 0) {
return static_cast<int32_t>(networkPower.second / 1000.0);
}
sum += upController->getData().PPV; sum += upController->getData().PPV;
} }

View File

@ -180,6 +180,11 @@ void WebApiWsVedirectLiveClass::populateJson(const JsonObject &root, const VeDir
output["E"]["d"] = 1; output["E"]["d"] = 1;
const JsonObject &input = values.createNestedObject("input"); const JsonObject &input = values.createNestedObject("input");
if (mpptData.NetworkTotalDcInputPowerMilliWatts.first > 0) {
input["NetworkPower"]["v"] = mpptData.NetworkTotalDcInputPowerMilliWatts.second / 1000.0;
input["NetworkPower"]["u"] = "W";
input["NetworkPower"]["d"] = "0";
}
input["PPV"]["v"] = mpptData.PPV; input["PPV"]["v"] = mpptData.PPV;
input["PPV"]["u"] = "W"; input["PPV"]["u"] = "W";
input["PPV"]["d"] = 0; input["PPV"]["d"] = 0;

View File

@ -175,6 +175,7 @@
}, },
"section_input": "Eingang (Solarpanele)", "section_input": "Eingang (Solarpanele)",
"input": { "input": {
"NetworkPower": "VE.Smart Netzwerk Gesamtleistung",
"PPV": "Leistung", "PPV": "Leistung",
"VPV": "Spannung", "VPV": "Spannung",
"IPV": "Strom (berechnet)", "IPV": "Strom (berechnet)",

View File

@ -175,6 +175,7 @@
}, },
"section_input": "Input (Solar Panels)", "section_input": "Input (Solar Panels)",
"input": { "input": {
"NetworkPower": "VE.Smart network total power",
"PPV": "Power", "PPV": "Power",
"VPV": "Voltage", "VPV": "Voltage",
"IPV": "Current (calculated)", "IPV": "Current (calculated)",

View File

@ -175,6 +175,7 @@
}, },
"section_input": "Input (Solar Panels)", "section_input": "Input (Solar Panels)",
"input": { "input": {
"NetworkPower": "VE.Smart network total power",
"PPV": "Power", "PPV": "Power",
"VPV": "Voltage", "VPV": "Voltage",
"IPV": "Current (calculated)", "IPV": "Current (calculated)",