Skip to content

ENERGY_OPTIMIZATION

Optimise energy usage against a cost or consumption objective.

Mode string ENERGY_OPTIMIZATION (EMS_OP_ENERGY_OPTIMIZATION)
Dispatcher ems_main.py → dispatch stub (logs, does not actuate)
Config block functions.Energy_Optimization
Status Registered, awaiting specification

Current state

The mode is registered and therefore selectable — get_ems_operation_mode() accepts it and it no longer falls back to IDLE. It reaches an explicit dispatch branch which logs:

[EMS] cycle=<n> mode=ENERGY_OPTIMIZATION has no control strategy yet -> no action (see docs/modes/)

No power setpoint is written. The plant stays at its last setpoint, which is how unimplemented modes have always behaved.

Why it is a stub

"Energy optimisation" could mean several different control strategies, and guessing would put the wrong behaviour on a live BESS:

Possible objective What it would need
Cost minimisation Day-ahead prices + tariff structure (overlaps ARBITRAGE)
Self-consumption maximisation PV generation forecast + load forecast
Peak tariff avoidance Demand/peak charges and the billing period definition
Carbon/emissions minimisation Grid carbon-intensity signal
Multi-objective Weighting between the above

Configuration

functions.Energy_Optimization — scaffolding only; no key is read by any code yet.

Key Live value Meaning
enabled false Intended master switch.
spec_status awaiting_specification Marks the block as a placeholder.
priority_rule energy_optimization_over_arbitrage_valley Intended precedence.

What I need to implement it

  1. The objective function — what is being minimised or maximised, in one sentence.
  2. The inputs — forecast source(s), price source(s), horizon (next slot / next day), resolution.
  3. The decision variables — charge/discharge power limits, SOC band, whether grid export is allowed.
  4. Priority — how it interacts with ARBITRAGE, PEAK_SHAVING and VALLEY_FILLING when several are enabled.
  5. Failure behaviour — what to do when a forecast or price feed is unavailable.
  • ARBITRAGE — already implements price-threshold trading; energy optimisation may subsume or extend it.