diff --git a/assets/js/components/Optimize/OptimizeHeader.stories.ts b/assets/js/components/Optimize/OptimizeHeader.stories.ts index 9399d08c5cc..f443ac6a511 100644 --- a/assets/js/components/Optimize/OptimizeHeader.stories.ts +++ b/assets/js/components/Optimize/OptimizeHeader.stories.ts @@ -14,7 +14,13 @@ const base = { updated: new Date(Date.now() - 2 * 60 * 1000).toISOString(), horizonHours: 47, currency: CURRENCY.EUR, - chargingStrategies: ["charge_before_export", "attenuate_grid_peaks", "none"], + chargingStrategies: [ + "charge_before_export", + "attenuate_demand_peaks", + "attenuate_feedin_peaks", + "attenuate_grid_peaks", + "none", + ], selectedStrategy: "charge_before_export", pending: false, }; diff --git a/assets/js/components/Optimize/OptimizeHeader.vue b/assets/js/components/Optimize/OptimizeHeader.vue index 72be100a05d..a7cd81b65f7 100644 --- a/assets/js/components/Optimize/OptimizeHeader.vue +++ b/assets/js/components/Optimize/OptimizeHeader.vue @@ -123,6 +123,8 @@ import "@h2d2/shopicons/es/regular/info"; // themselves come from backend state to avoid drift if the enum changes const STRATEGY_LABELS: Record = { charge_before_export: "fill battery first", + attenuate_demand_peaks: "reduce grid import peaks", + attenuate_feedin_peaks: "reduce grid feed-in peaks", attenuate_grid_peaks: "reduce grid peaks", none: "no preference", }; diff --git a/core/optimizer.md b/core/optimizer.md index f802c7b096a..c792b84cc9b 100644 --- a/core/optimizer.md +++ b/core/optimizer.md @@ -6,7 +6,7 @@ Optimizer uses mixed integer linear programming (MILP) to minize a cost function - solar forecast - base load (aka home) energy demand - end of forecast commercial value -- strategy- either "charge before export" (charge loads as soon as possible) or "attenuate grid peaks" +- strategy- either "charge before export" (charge loads as soon as possible) or attenuating grid peaks on the demand side, the feed-in side or both - home battery or loadpoint/vehicle... - capacity, soc and charge goals - charge/discharge power limits and efficiency diff --git a/core/site_optimizer.go b/core/site_optimizer.go index ab1283a5116..a1e733aca18 100644 --- a/core/site_optimizer.go +++ b/core/site_optimizer.go @@ -42,6 +42,8 @@ var ( // entry is the default and preserves the previous hard-coded behavior. var optimizerChargingStrategies = []string{ string(optimizer.OptimizerStrategyChargingStrategyChargeBeforeExport), + string(optimizer.OptimizerStrategyChargingStrategyAttenuateDemandPeaks), + string(optimizer.OptimizerStrategyChargingStrategyAttenuateFeedinPeaks), string(optimizer.OptimizerStrategyChargingStrategyAttenuateGridPeaks), string(optimizer.OptimizerStrategyChargingStrategyNone), } diff --git a/go.mod b/go.mod index 18de0de7727..27b55b7054b 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/enbility/ship-go v0.6.1-0.20260720110450-0aa90f64ac76 github.com/enbility/spine-go v0.7.1-0.20260629113257-b3bcc643f323 github.com/evcc-io/openapi-mcp v0.6.1-0.20260701153510-26c442199ef4 - github.com/evcc-io/optimizer v0.0.0-20260719151136-b6c835a178a3 + github.com/evcc-io/optimizer v0.0.0-20260724075549-cce0c41d9489 github.com/evcc-io/rct v0.2.0 github.com/evcc-io/tesla-proxy-client v0.0.0-20260722070723-f3604323d820 github.com/fatih/structs v1.1.0 diff --git a/go.sum b/go.sum index 6526b6c001b..b086803df0f 100644 --- a/go.sum +++ b/go.sum @@ -152,8 +152,8 @@ github.com/evcc-io/ocpp-go v0.0.0-20251212212612-b7f92ee0443b h1:5vFr7wOwoi5ylyb github.com/evcc-io/ocpp-go v0.0.0-20251212212612-b7f92ee0443b/go.mod h1:2kcukDdhui4u730VfnYVWuwzDLgw+mBRGDir/QAyBhg= github.com/evcc-io/openapi-mcp v0.6.1-0.20260701153510-26c442199ef4 h1:aGM3NwDsKbnmiaO10ptbvEolRAUThWJEsObiAWFDU/c= github.com/evcc-io/openapi-mcp v0.6.1-0.20260701153510-26c442199ef4/go.mod h1:YyOx4zwr6xVUcchAETHERZ+75cZMIrdcjVIZFwBlE1Q= -github.com/evcc-io/optimizer v0.0.0-20260719151136-b6c835a178a3 h1:QXk6AKYrYWQ+PxXhJS/LcHnegKFCCClUQ/BlCuqbs9Y= -github.com/evcc-io/optimizer v0.0.0-20260719151136-b6c835a178a3/go.mod h1:cHMeq6GfoXQ8LxqY4LH1wn/hrgYEn+ka5RPI1CF37SY= +github.com/evcc-io/optimizer v0.0.0-20260724075549-cce0c41d9489 h1:iM7XzdAI07Ff9uJtu7MS8wg2q0hH/84JtrQNbgGn1oo= +github.com/evcc-io/optimizer v0.0.0-20260724075549-cce0c41d9489/go.mod h1:cHMeq6GfoXQ8LxqY4LH1wn/hrgYEn+ka5RPI1CF37SY= github.com/evcc-io/rct v0.2.0 h1:qjXKI7NKwW5YpEKEb27MwLMBaR4ne2Kd2cPV2PYTKn4= github.com/evcc-io/rct v0.2.0/go.mod h1:n6MTBU36QOadGlxxiADu86VaT5l0eYdbmFBHF14AD/s= github.com/evcc-io/tesla-proxy-client v0.0.0-20260722070723-f3604323d820 h1:qpLoOYEJ6dgD+UBEgwzsIiQ3WLPmi3Xb7EN4wFIypQY=