From c5678b08567585fa9294adad0d26c75042cbcbcd Mon Sep 17 00:00:00 2001 From: Yinyin Liu Date: Mon, 4 May 2026 18:11:54 +0200 Subject: [PATCH] fix default battery limitation for growatt --- .../SodistoreHomeConfigurationV2.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistoreHomeConfigurationV2.tsx b/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistoreHomeConfigurationV2.tsx index 7045c54eb..15034c339 100644 --- a/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistoreHomeConfigurationV2.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/SodiohomeInstallations/SodistoreHomeConfigurationV2.tsx @@ -225,10 +225,12 @@ function SodistoreHomeConfigurationV2(props: SodistoreHomeConfigurationProps) { const clKey = `Cluster${clIdx + 1}`; const filled = (tree[invIdx]?.[clIdx] ?? []).filter((s) => s !== '').length; const existingCl = existingInv?.Clusters?.[clKey]; - // Default current uses the cluster's ideal battery count (slotCount from the - // installation model preset), not the count of filled SNs — so an empty or - // partially-filled cluster still ships a sane non-zero limit. - const defaultCurrent = defaultClusterCurrent(slotCount); + // Default current = (effective battery count) × 95A. + // Partial fill: use the actual installed count (real safety limit). + // Empty cluster (no SNs yet): fall back to the cluster's ideal slot count + // so a freshly-created installation gets a sensible default. + const effectiveCount = filled > 0 ? filled : slotCount; + const defaultCurrent = defaultClusterCurrent(effectiveCount); cls[clKey] = { BatteryCount: filled, MaxChargingCurrent: existingCl?.MaxChargingCurrent ?? defaultCurrent,