diff --git a/src/power-flow-card-plus.ts b/src/power-flow-card-plus.ts index 4eaa73a2..82ac6339 100644 --- a/src/power-flow-card-plus.ts +++ b/src/power-flow-card-plus.ts @@ -463,7 +463,7 @@ export class PowerFlowCardPlus extends LitElement { // Compute durations const newDur: NewDur = { - batteryGrid: computeFlowRate(this._config, grid.state.toBattery ?? battery.state.toGrid ?? 0, totalLines), + batteryGrid: computeFlowRate(this._config, Math.max(grid.state.toBattery ?? 0, battery.state.toGrid ?? 0, 0), totalLines), batteryToHome: computeFlowRate(this._config, battery.state.toHome ?? 0, totalLines), gridToHome: computeFlowRate(this._config, grid.state.toHome, totalLines), solarToBattery: computeFlowRate(this._config, solar.state.toBattery ?? 0, totalLines),