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
| Name | Direction | Unit | Meaning |
|---|---|---|---|
soc | input | fraction | Typed signal input; its quantity must match the connected output. |
connected | input | dimensionless | Typed signal input; its quantity must match the connected output. |
available | input | dimensionless | Typed signal input; its quantity must match the connected output. |
bmsPermit | input | dimensionless | Typed signal input; its quantity must match the connected output. |
temperature | input | K | Typed signal input; its quantity must match the connected output. |
loadPower | input | W | Typed signal input; its quantity must match the connected output. |
outage | input | dimensionless | Typed signal input; its quantity must match the connected output. |
command | output | W | Observed result from the solved component or sampled controller. |
state | output | code | Observed result from the solved component or sampled controller. |
reason | output | code | Observed result from the solved component or sampled controller. |
shortfallJ | output | J | Observed result from the solved component or sampled controller. |
departureShortfallJ | output | J | Observed result from the solved component or sampled controller. |
importPrice | output | currency/kWh | Observed result from the solved component or sampled controller. |
exportPrice | output | currency/kWh | Observed result from the solved component or sampled controller. |
Parameters
Defaults are initial model values. Select values for your own model and operating conditions.
| Parameter | Unit | Default | Meaning and limits |
|---|---|---|---|
Sample Time SsampleTimeS | s | 60 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0.001; Maximum 3600 |
Modemode | 0 schedule, 1 load-following, 2 outage support | 0 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 2 |
Power WpowerW | W grid import (+), export (-) | 0 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum -1000000000; Maximum 1000000000 |
Max Import WmaxImportW | W | 7000 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1000000000 |
Max Export WmaxExportW | W | 7000 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1000000000 |
Reserve SocreserveSoc | fraction | 0.2 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1 |
Target SoctargetSoc | fraction | 0.8 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1 |
Departure SdepartureS | s (0 disables departure) | 86400 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1000000000 |
Capacity AhcapacityAh | Ah | 100 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 1e-06; Maximum 1000000000 |
Nominal Voltage VnominalVoltageV | V | 350 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0.01; Maximum 1000000 |
Min Temperature KminTemperatureK | K | 273.15 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 1; Maximum 1000 |
Max Temperature KmaxTemperatureK | K | 318.15 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 1; Maximum 1000 |
Import PriceimportPrice | currency/kWh | 0.2 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1000000 |
Export PriceexportPrice | currency/kWh | 0.1 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1000000 |
Start SstartS | s | 0 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1000000000 |
End SendS | s | 86400 | Configured model parameter; the default is an initial editor value, not an operating recommendation. Minimum 0; Maximum 1000000000 |
Repeat Period SrepeatPeriodS | s (0 absolute) | 0 | Configured 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.
- Scheduled import / export and load policy: Requests signed power
- mode
- reserveSoc / targetSoc
- loadPower, outage → command
Model signed grid exchange
Explicit battery and converter exchange average power.
- Scheduled import / export and load policy: Requests signed power
- mode
- reserveSoc / targetSoc
- loadPower, outage → command
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.jsjs/charging-scenarios.jsdocs/CHARGING_BLOCKS_SPEC.mdjs/physical-network.jsrust-core/src/charging_control.rs
This implementation and its workflow uses (JSON) · Knowledge graph (JSON-LD)