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"]); }