update aggregator on sodistormax and salimax

This commit is contained in:
atef 2025-11-18 02:37:37 +01:00
parent c1674f352c
commit 615c1939a2
2 changed files with 4 additions and 4 deletions

View File

@ -142,9 +142,9 @@ public static class Aggregator
{ {
batterySoc.Add((double)jsonObject["Battery"]["Soc"]); batterySoc.Add((double)jsonObject["Battery"]["Soc"]);
} }
if (jsonObject["PvOnDc"] != null && jsonObject["PvOnDc"]["DcWh"] != null) if (jsonObject["PvOnDc"] != null && jsonObject["PvOnDc"]["1"]["DcWh"] != null) // todo update to all pv
{ {
pvPowerSum.Add((double)jsonObject["PvOnDc"]["DcWh"]); pvPowerSum.Add((double)jsonObject["PvOnDc"]["1"]["DcWh"]);
} }
if (jsonObject["Battery"] != null && jsonObject["Battery"]["Dc"]["Power"] != null) if (jsonObject["Battery"] != null && jsonObject["Battery"]["Dc"]["Power"] != null)
{ {
@ -316,7 +316,7 @@ public static class Aggregator
ChargingBatteryPower = batteryChargePower.Any() ? batteryChargePower.Average() : 0.0, ChargingBatteryPower = batteryChargePower.Any() ? batteryChargePower.Average() : 0.0,
GridExportPower = gridPowerExport.Any() ? gridPowerExport.Sum() : 0.0, GridExportPower = gridPowerExport.Any() ? gridPowerExport.Sum() : 0.0,
GridImportPower = gridPowerImport.Any() ? gridPowerImport.Sum() : 0.0, GridImportPower = gridPowerImport.Any() ? gridPowerImport.Sum() : 0.0,
PvPower = pvPower.Any() ? pvPower.Last() : 0.0, PvPower = pvPower.Any() ? pvPower.Max() : 0.0,
HeatingPower = heatingPowerAvg.Any() ? heatingPowerAvg.Average() : 0.0, HeatingPower = heatingPowerAvg.Any() ? heatingPowerAvg.Average() : 0.0,
}; };

View File

@ -137,7 +137,7 @@ public static class Aggregator
{ {
batterySoc.Add((double)jsonObject["Battery"]["Soc"]); batterySoc.Add((double)jsonObject["Battery"]["Soc"]);
} }
if (jsonObject["PvOnDc"] != null && jsonObject["PvOnDc"]["1"]["DcWh"] != null) if (jsonObject["PvOnDc"] != null && jsonObject["PvOnDc"]["1"]["DcWh"] != null) // todo update to all pv
{ {
pvPowerSum.Add((double)jsonObject["PvOnDc"]["1"]["DcWh"]); pvPowerSum.Add((double)jsonObject["PvOnDc"]["1"]["DcWh"]);
} }