From 615c1939a227c742ef04e1c37e5ec1ec538c3575 Mon Sep 17 00:00:00 2001 From: atef Date: Tue, 18 Nov 2025 02:37:37 +0100 Subject: [PATCH] update aggregator on sodistormax and salimax --- csharp/App/SaliMax/src/AggregationService/Aggregator.cs | 6 +++--- .../App/SodiStoreMax/src/AggregationService/Aggregator.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/csharp/App/SaliMax/src/AggregationService/Aggregator.cs b/csharp/App/SaliMax/src/AggregationService/Aggregator.cs index e430bb351..d73ad572f 100644 --- a/csharp/App/SaliMax/src/AggregationService/Aggregator.cs +++ b/csharp/App/SaliMax/src/AggregationService/Aggregator.cs @@ -142,9 +142,9 @@ public static class Aggregator { 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) { @@ -316,7 +316,7 @@ public static class Aggregator ChargingBatteryPower = batteryChargePower.Any() ? batteryChargePower.Average() : 0.0, GridExportPower = gridPowerExport.Any() ? gridPowerExport.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, }; diff --git a/csharp/App/SodiStoreMax/src/AggregationService/Aggregator.cs b/csharp/App/SodiStoreMax/src/AggregationService/Aggregator.cs index 0699adcb1..b857fb6ca 100644 --- a/csharp/App/SodiStoreMax/src/AggregationService/Aggregator.cs +++ b/csharp/App/SodiStoreMax/src/AggregationService/Aggregator.cs @@ -137,7 +137,7 @@ public static class Aggregator { 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"]); }