{
  "node": {
    "id": "block:energy-dispatch",
    "type": "Block",
    "label": "Scheduled import / export and load policy",
    "properties": {
      "id": "energy-dispatch",
      "name": "Scheduled import / export and load policy",
      "kind": "studio",
      "summary": "Sampled import and export requests for schedules, load following or outage support.",
      "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.",
      "ports": [
        {
          "name": "soc",
          "direction": "input",
          "unit": "fraction",
          "description": "Typed signal input; its quantity must match the connected output."
        },
        {
          "name": "connected",
          "direction": "input",
          "unit": "dimensionless",
          "description": "Typed signal input; its quantity must match the connected output."
        },
        {
          "name": "available",
          "direction": "input",
          "unit": "dimensionless",
          "description": "Typed signal input; its quantity must match the connected output."
        },
        {
          "name": "bmsPermit",
          "direction": "input",
          "unit": "dimensionless",
          "description": "Typed signal input; its quantity must match the connected output."
        },
        {
          "name": "temperature",
          "direction": "input",
          "unit": "K",
          "description": "Typed signal input; its quantity must match the connected output."
        },
        {
          "name": "loadPower",
          "direction": "input",
          "unit": "W",
          "description": "Typed signal input; its quantity must match the connected output."
        },
        {
          "name": "outage",
          "direction": "input",
          "unit": "dimensionless",
          "description": "Typed signal input; its quantity must match the connected output."
        },
        {
          "name": "command",
          "direction": "output",
          "unit": "W",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "state",
          "direction": "output",
          "unit": "code",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "reason",
          "direction": "output",
          "unit": "code",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "shortfallJ",
          "direction": "output",
          "unit": "J",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "departureShortfallJ",
          "direction": "output",
          "unit": "J",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "importPrice",
          "direction": "output",
          "unit": "currency/kWh",
          "description": "Observed result from the solved component or sampled controller."
        },
        {
          "name": "exportPrice",
          "direction": "output",
          "unit": "currency/kWh",
          "description": "Observed result from the solved component or sampled controller."
        }
      ],
      "parameters": [
        {
          "key": "sampleTimeS",
          "label": "Sample Time S",
          "unit": "s",
          "default": 60,
          "min": 0.001,
          "max": 3600,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "mode",
          "label": "Mode",
          "unit": "0 schedule, 1 load-following, 2 outage support",
          "default": 0,
          "min": 0,
          "max": 2,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "powerW",
          "label": "Power W",
          "unit": "W grid import (+), export (-)",
          "default": 0,
          "min": -1000000000,
          "max": 1000000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "maxImportW",
          "label": "Max Import W",
          "unit": "W",
          "default": 7000,
          "min": 0,
          "max": 1000000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "maxExportW",
          "label": "Max Export W",
          "unit": "W",
          "default": 7000,
          "min": 0,
          "max": 1000000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "reserveSoc",
          "label": "Reserve Soc",
          "unit": "fraction",
          "default": 0.2,
          "min": 0,
          "max": 1,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "targetSoc",
          "label": "Target Soc",
          "unit": "fraction",
          "default": 0.8,
          "min": 0,
          "max": 1,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "departureS",
          "label": "Departure S",
          "unit": "s (0 disables departure)",
          "default": 86400,
          "min": 0,
          "max": 1000000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "capacityAh",
          "label": "Capacity Ah",
          "unit": "Ah",
          "default": 100,
          "min": 1e-06,
          "max": 1000000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "nominalVoltageV",
          "label": "Nominal Voltage V",
          "unit": "V",
          "default": 350,
          "min": 0.01,
          "max": 1000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "minTemperatureK",
          "label": "Min Temperature K",
          "unit": "K",
          "default": 273.15,
          "min": 1,
          "max": 1000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "maxTemperatureK",
          "label": "Max Temperature K",
          "unit": "K",
          "default": 318.15,
          "min": 1,
          "max": 1000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "importPrice",
          "label": "Import Price",
          "unit": "currency/kWh",
          "default": 0.2,
          "min": 0,
          "max": 1000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "exportPrice",
          "label": "Export Price",
          "unit": "currency/kWh",
          "default": 0.1,
          "min": 0,
          "max": 1000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "startS",
          "label": "Start S",
          "unit": "s",
          "default": 0,
          "min": 0,
          "max": 1000000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "endS",
          "label": "End S",
          "unit": "s",
          "default": 86400,
          "min": 0,
          "max": 1000000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        },
        {
          "key": "repeatPeriodS",
          "label": "Repeat Period S",
          "unit": "s (0 absolute)",
          "default": 0,
          "min": 0,
          "max": 1000000000,
          "description": "Configured model parameter; the default is an initial editor value, not an operating recommendation."
        }
      ],
      "equations": [],
      "example": {
        "title": "Model signed grid exchange",
        "text": "−5 kW requests export; +5 kW requests import. 5 kW exported at 95% efficiency needs about 5.26 kW battery power.",
        "url": "https://design.lemonergy.com/cosim.html?example=charging-v2g",
        "label": "Open the Studio example"
      },
      "limits": [
        "This excludes AC waveforms, synchronization, communications and certification.",
        "No islanding switches, smart-panel circuits or protection coordination are simulated."
      ],
      "evidence": [
        "js/charging-control.js",
        "js/charging-scenarios.js",
        "docs/CHARGING_BLOCKS_SPEC.md",
        "js/physical-network.js",
        "rust-core/src/charging_control.rs"
      ],
      "caseIds": [
        "v2g",
        "outage-support"
      ],
      "type": "energy-dispatch",
      "implementationId": "energy-dispatch",
      "url": "https://lemonergy.com/learn/glossary/blocks/energy-dispatch/",
      "documentationUrl": "https://lemonergy.com/learn/glossary/blocks/energy-dispatch/",
      "sourceFile": "block-library.json",
      "sourceRepository": "battery-design",
      "sourceRevision": "ef9802329b75bc15bb96885f8ed5d49425106696",
      "reviewed": "2026-10-27"
    }
  },
  "incoming": [
    {
      "id": "edge:usesBlock/outage-support/1",
      "type": "usesBlock",
      "source": "workflow:outage-support",
      "target": "block:energy-dispatch",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 1,
        "name": "Scheduled import / export and load policy",
        "type": "energy-dispatch",
        "role": "Requests signed power",
        "settings": [
          "mode",
          "reserveSoc / targetSoc",
          "loadPower, outage → command"
        ]
      }
    },
    {
      "id": "edge:usesBlock/v2g/0",
      "type": "usesBlock",
      "source": "workflow:v2g",
      "target": "block:energy-dispatch",
      "properties": {
        "sourceFile": "wiki-blocks.json",
        "position": 0,
        "name": "Scheduled import / export and load policy",
        "type": "energy-dispatch",
        "role": "Requests signed power",
        "settings": [
          "mode",
          "reserveSoc / targetSoc",
          "loadPower, outage → command"
        ]
      }
    }
  ],
  "neighbors": [
    {
      "id": "workflow:outage-support",
      "type": "Workflow",
      "label": "Supply an outage load",
      "properties": {
        "id": "outage-support",
        "title": "Supply an outage load",
        "kind": "studio",
        "summary": "V2H illustrates outage-triggered dispatch and reserve.",
        "steps": [
          "Set outage time, load and reserve.",
          "Compare reserve with departure target."
        ],
        "example": "An ideal 10 kWh usable budget supplies 3 kW for 3.33 h before losses and limits.",
        "observe": "Reserve can hold while departure target is unmet.",
        "limits": "No islanding switches, smart-panel circuits or protection coordination are simulated.",
        "url": "https://design.lemonergy.com/cosim.html?example=charging-v2h",
        "label": "Open the Studio example",
        "evidence": [
          "js/charging-control.js",
          "js/charging-scenarios.js",
          "docs/CHARGING_BLOCKS_SPEC.md"
        ]
      }
    },
    {
      "id": "workflow:v2g",
      "type": "Workflow",
      "label": "Model signed grid exchange",
      "properties": {
        "id": "v2g",
        "title": "Model signed grid exchange",
        "kind": "studio",
        "summary": "Explicit battery and converter exchange average power.",
        "steps": [
          "Set export window and SOC reserve.",
          "Inspect power and energy."
        ],
        "example": "−5 kW requests export; +5 kW requests import. 5 kW exported at 95% efficiency needs about 5.26 kW battery power.",
        "observe": "Reserve and converter limits can reduce export.",
        "limits": "This excludes AC waveforms, synchronization, communications and certification.",
        "url": "https://design.lemonergy.com/cosim.html?example=charging-v2g",
        "label": "Open the Studio example",
        "evidence": [
          "js/charging-control.js",
          "js/charging-scenarios.js",
          "docs/CHARGING_BLOCKS_SPEC.md"
        ]
      }
    }
  ]
}
