diff --git a/typescript/frontend-marios2/src/content/dashboards/Log/graph.util.tsx b/typescript/frontend-marios2/src/content/dashboards/Log/graph.util.tsx index 0f8124d56..57b2d2bbe 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Log/graph.util.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Log/graph.util.tsx @@ -1140,7 +1140,11 @@ export const getHighestConnectionValue = (values: JSONRecordData) => { 'InverterRecord.PvPower', 'InverterRecord.Battery1Power', 'InverterRecord.Battery2Power', - 'InverterRecord.ConsumptionPower' + 'InverterRecord.ConsumptionPower', + 'InverterRecord.TotalBatteryPower', + 'InverterRecord.TotalPhotovoltaicPower', + 'InverterRecord.TotalLoadPower', + 'InverterRecord.TotalGridPower' ]; // Helper function to safely get a value from a nested path diff --git a/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistoreHomeConfiguration.tsx b/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistoreHomeConfiguration.tsx index a6caf051b..aafbbd349 100644 --- a/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistoreHomeConfiguration.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistoreHomeConfiguration.tsx @@ -91,8 +91,8 @@ function SodistoreHomeConfiguration(props: SodistoreHomeConfigurationProps) { // Helper to build form values from S3 data const getS3Values = (): Partial => ({ minimumSoC: props.values.Config.MinSoc, - maximumDischargingCurrent: props.values.Config.MaximumChargingCurrent, - maximumChargingCurrent: props.values.Config.MaximumDischargingCurrent, + maximumDischargingCurrent: props.values.Config.MaximumDischargingCurrent, + maximumChargingCurrent: props.values.Config.MaximumChargingCurrent, operatingPriority: resolveOperatingPriorityIndex( props.values.Config.OperatingPriority ), diff --git a/typescript/frontend-marios2/src/content/dashboards/Topology/TopologySodistoreHome.tsx b/typescript/frontend-marios2/src/content/dashboards/Topology/TopologySodistoreHome.tsx index e1003ff3d..8cae6fedb 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Topology/TopologySodistoreHome.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Topology/TopologySodistoreHome.tsx @@ -42,21 +42,21 @@ function TopologySodistoreHome(props: TopologySodistoreHomeProps) { const inv = props.values?.InverterRecord; const hasDevices = !!inv?.Devices; + const growattActiveIndices: number[] = hasDevices + ? [] + : Array.from({ length: props.batteryClusterNumber }, (_, i) => i + 1) + .filter((i) => Number(inv?.[`Battery${i}Voltage`]) > 0); + const totalBatteryPower: number = hasDevices ? (inv?.TotalBatteryPower ?? 0) - : Number( - Array.from({ length: props.batteryClusterNumber }).reduce( - (sum: number, _, index) => sum + (Number(inv?.[`Battery${index + 1}Power`]) || 0), - 0 - ) + : growattActiveIndices.reduce( + (sum, i) => sum + (Number(inv?.[`Battery${i}Power`]) || 0), + 0 ); const pvPower: number = hasDevices ? (inv?.TotalPhotovoltaicPower ?? 0) - : (inv?.PvPower ?? - ['PvPower1', 'PvPower2', 'PvPower3', 'PvPower4'] - .map((key) => inv?.[key] ?? 0) - .reduce((sum, val) => sum + val, 0)); + : (inv?.PvPower ?? 0); const totalLoadPower: number = hasDevices ? (inv?.TotalLoadPower ?? 0) @@ -67,11 +67,12 @@ function TopologySodistoreHome(props: TopologySodistoreHomeProps) { const avgBatterySoc: number = hasDevices ? (inv?.AvgBatterySoc ?? 0) - : (() => { - const socs = Array.from({ length: props.batteryClusterNumber }) - .map((_, i) => Number(inv?.[`Battery${i + 1}Soc`]) || 0); - return socs.length ? socs.reduce((s, v) => s + v, 0) / socs.length : 0; - })(); + : (growattActiveIndices.length + ? growattActiveIndices.reduce( + (sum, i) => sum + (Number(inv?.[`Battery${i}Soc`]) || 0), + 0 + ) / growattActiveIndices.length + : 0); return (