Lemonergy · Studio block

Scheduled import / export and load policy

Sampled import and export requests for schedules, load following or outage support.

Implementation ID
energy-dispatch
Reviewed
2026-10-27

Behavior

The controller applies connection, availability, BMS and temperature permissions, reserve SOC, target SOC and import/export bounds. Its command is grid-side power: positive requests import and negative requests export. The separate bidirectional interface enforces the physical power path.

Interface

Scheduled import / export and load policy interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.Scheduled import / export and load policyStudio blocksocconnectedavailablebmsPermittemperatureloadPoweroutagecommandstatereasonshortfallJdepartureShortfallJimportPriceexportPrice
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
socinputfractionTyped signal input; its quantity must match the connected output.
connectedinputdimensionlessTyped signal input; its quantity must match the connected output.
availableinputdimensionlessTyped signal input; its quantity must match the connected output.
bmsPermitinputdimensionlessTyped signal input; its quantity must match the connected output.
temperatureinputKTyped signal input; its quantity must match the connected output.
loadPowerinputWTyped signal input; its quantity must match the connected output.
outageinputdimensionlessTyped signal input; its quantity must match the connected output.
commandoutputWObserved result from the solved component or sampled controller.
stateoutputcodeObserved result from the solved component or sampled controller.
reasonoutputcodeObserved result from the solved component or sampled controller.
shortfallJoutputJObserved result from the solved component or sampled controller.
departureShortfallJoutputJObserved result from the solved component or sampled controller.
importPriceoutputcurrency/kWhObserved result from the solved component or sampled controller.
exportPriceoutputcurrency/kWhObserved result from the solved component or sampled controller.

Parameters

Defaults are initial model values. Select values for your own model and operating conditions.

Configuration fields
ParameterUnitDefaultMeaning and limits
Sample Time S
sampleTimeS
s60Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0.001; Maximum 3600
Mode
mode
0 schedule, 1 load-following, 2 outage support0Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 2
Power W
powerW
W grid import (+), export (-)0Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum -1000000000; Maximum 1000000000
Max Import W
maxImportW
W7000Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1000000000
Max Export W
maxExportW
W7000Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1000000000
Reserve Soc
reserveSoc
fraction0.2Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1
Target Soc
targetSoc
fraction0.8Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1
Departure S
departureS
s (0 disables departure)86400Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1000000000
Capacity Ah
capacityAh
Ah100Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 1e-06; Maximum 1000000000
Nominal Voltage V
nominalVoltageV
V350Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0.01; Maximum 1000000
Min Temperature K
minTemperatureK
K273.15Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 1; Maximum 1000
Max Temperature K
maxTemperatureK
K318.15Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 1; Maximum 1000
Import Price
importPrice
currency/kWh0.2Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1000000
Export Price
exportPrice
currency/kWh0.1Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1000000
Start S
startS
s0Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1000000000
End S
endS
s86400Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1000000000
Repeat Period S
repeatPeriodS
s (0 absolute)0Configured model parameter; the default is an initial editor value, not an operating recommendation.
Minimum 0; Maximum 1000000000

Equations and rules

This step is defined by its sequence and stopping conditions, described above.

Worked example

Model signed grid exchange

−5 kW requests export; +5 kW requests import. 5 kW exported at 95% efficiency needs about 5.26 kW battery power.

Open the Studio example →

Use in a workflow

Supply an outage load

V2H illustrates outage-triggered dispatch and reserve.

  1. Scheduled import / export and load policy: Requests signed power
    • mode
    • reserveSoc / targetSoc
    • loadPower, outage → command
Open the Studio example

Model signed grid exchange

Explicit battery and converter exchange average power.

  1. Scheduled import / export and load policy: Requests signed power
    • mode
    • reserveSoc / targetSoc
    • loadPower, outage → command
Open the Studio example

Connected concepts

Limits and interpretation

  • This excludes AC waveforms, synchronization, communications and certification.
  • No islanding switches, smart-panel circuits or protection coordination are simulated.

Implementation sources

This reference follows Lemonergy implementation sources. Scientific articles support the linked concepts separately.

Repository: battery-design · Revision: ef9802329b75bc15bb96885f8ed5d49425106696

  • js/charging-control.js
  • js/charging-scenarios.js
  • docs/CHARGING_BLOCKS_SPEC.md
  • js/physical-network.js
  • rust-core/src/charging_control.rs

This implementation and its workflow uses (JSON) · Knowledge graph (JSON-LD)