From ea857537f2083ca957e40a93254b5e4613865b0a Mon Sep 17 00:00:00 2001 From: Michael Geers Date: Thu, 26 Feb 2026 12:01:58 +0100 Subject: [PATCH] Battery Forecast UI Improvements (#27630) --- .../Energyflow/Energyflow.stories.ts | 22 ++------- .../js/components/Energyflow/Energyflow.vue | 47 +++++-------------- assets/js/components/Energyflow/Entry.vue | 14 ++---- .../components/Energyflow/ForecastMessage.vue | 32 ++----------- assets/js/mixins/formatter.ts | 21 +-------- assets/js/types/evcc.ts | 1 - core/site.go | 5 -- core/site_optimizer.go | 11 ----- core/types/types.go | 41 ++++------------ i18n/de.json | 4 +- i18n/en.json | 4 +- server/mqtt_test.go | 14 +++--- tests/plan.spec.ts | 21 ++++++--- 13 files changed, 62 insertions(+), 175 deletions(-) diff --git a/assets/js/components/Energyflow/Energyflow.stories.ts b/assets/js/components/Energyflow/Energyflow.stories.ts index 0c373ad8f..34af80544 100644 --- a/assets/js/components/Energyflow/Energyflow.stories.ts +++ b/assets/js/components/Energyflow/Energyflow.stories.ts @@ -87,13 +87,12 @@ const bat = (power: number, soc: number, forecast: any, devices: any[] = []) => forecast, }); -const dev = (title: string, power: number, soc: number, forecast: any) => ({ +const dev = (title: string, power: number, soc: number) => ({ title, power, soc, capacity: 10, controllable: true, - forecast, }); export const BatteryForecastDischarging = Template.bind({}); @@ -120,26 +119,15 @@ BatteryForecastBoth.args = { battery: bat(-1700, 70, { full: hoursFromNow(2), empty: hoursFromNow(36) }), } as any; -export const BatteryForecastMultiDischarging = Template.bind({}); -BatteryForecastMultiDischarging.args = { - ...batteryBase, - gridPower: 500, - homePower: 2500, - battery: bat(2000, 55, { full: null, empty: hoursFromNow(48) }, [ - dev("Powerwall", 1200, 60, { full: null, empty: hoursFromNow(48) }), - dev("BYD", 800, 48, { full: null, empty: hoursFromNow(0.25) }), - ]), -} as any; - -export const BatteryForecastMultiCharging = Template.bind({}); -BatteryForecastMultiCharging.args = { +export const BatteryForecastMulti = Template.bind({}); +BatteryForecastMulti.args = { ...batteryBase, pvPower: 8000, gridPower: -1000, homePower: 1000, battery: bat(-6000, 40, { full: hoursFromNow(26), empty: null }, [ - dev("Powerwall", -3500, 35, { full: hoursFromNow(26), empty: null }), - dev("BYD", -2500, 47, { full: hoursFromNow(0.7), empty: null }), + dev("Powerwall", -3500, 35), + dev("BYD", -2500, 47), ]), } as any; diff --git a/assets/js/components/Energyflow/Energyflow.vue b/assets/js/components/Energyflow/Energyflow.vue index b89816a54..a6918d5cb 100644 --- a/assets/js/components/Energyflow/Energyflow.vue +++ b/assets/js/components/Energyflow/Energyflow.vue @@ -134,9 +134,7 @@ v-if="batteryForecastEmpty" class="d-flex align-items-center mb-2" > - {{ - batteryForecastEmpty - }} +
- {{ batteryForecastFull }} +
-
-
+
+
@@ -10,10 +10,7 @@
- {{ name - }}{{ - prediction - }} + {{ name }}