REST API¶
The simulator exposes a programmatic REST + WebSocket interface alongside the web dashboard. The dashboard itself is just the UI on top of this API — anything you can do from the dashboard you can do from a script.
Where to find the full interface¶
The simulator ships interactive API browsers built from the live OpenAPI spec — they always match what the running build supports, no out-of-date PDF to chase:
| URL | Tool | Use it when |
|---|---|---|
http://<host>:8111/docs |
Swagger UI | You want to click into an endpoint, try it out, see request / response schemas |
http://<host>:8111/redoc |
ReDoc | You want a static, scrollable reference printout |
http://<host>:8111/openapi.json |
Raw OpenAPI 3.x JSON | You're generating a typed client (e.g. via openapi-generator) |
Replace <host> with whatever the simulator was bound to
(--website_ip / -wi, defaults to 127.0.0.1) and the port with
whatever --website_port / -wp was set to (defaults to 8111).
All simulator-control endpoints live under the /api/dersim prefix.
The two interactive doc URLs (/docs, /redoc) are at the root by
convention.
What you can drive from the API¶
The endpoint set is broken up by concern:
Simulator lifecycle¶
| Endpoint | Method | Purpose |
|---|---|---|
/api/dersim/server-info |
GET | DERSim version, build SHA, license metadata |
/api/dersim/overview |
GET | High-level snapshot: device list, comm-protocol status, alarm summary |
/api/dersim/devices |
GET | Per-device telemetry (one entry per simulated DER when -N > 1) |
/api/dersim/commands |
GET / POST | List + queue operator commands (start / stop / reset) |
/api/dersim/stop |
POST | Graceful shutdown |
Telemetry + history¶
| Endpoint | Method | Purpose |
|---|---|---|
/api/dersim/history |
GET | Time-series telemetry buffer (P / Q / V / I / SoC / Hz / pitch / etc.) |
/api/dersim/logs |
GET | Filterable log buffer (by module: AC / DC / CSIP / Modbus / OCPP / DNP3 / WS) |
WebSocket: /api/dersim/telemetry/ws |
WS | Live telemetry stream — what the dashboard subscribes to |
Inverter / DER controls¶
| Endpoint | Method | Purpose |
|---|---|---|
/api/dersim/controls |
GET | Current IEEE 1547 grid-support modes (Volt-Var, Volt-Watt, freq-droop, …) |
/api/dersim/controls/grid |
POST | Set grid conditions (voltage, frequency) |
/api/dersim/controls/time |
POST | Time-scale knob (wall-clock vs accelerated playback) |
/api/dersim/grid-support |
GET / POST | Read + write the grid-support curves directly |
/api/dersim/nameplate |
GET | Current SunSpec nameplate (W_max, VA_max, VAR_max, …) |
/api/dersim/nameplate/configured-settings |
GET | Operator overrides applied to the nameplate at startup |
/api/dersim/dc-iv |
GET | DC-side I-V curve (PV / battery) |
Device-specific endpoints¶
| Endpoint | Method | Purpose |
|---|---|---|
/api/dersim/battery |
GET | BESS state-of-charge, charge / discharge mode, per-string + per-module + per-cell detail |
/api/dersim/controls/battery |
POST | Force charge / discharge / idle, override SoC |
/api/dersim/wind |
GET | Wind turbine telemetry — hub-speed, rotor RPM, pitch, Cp, mechanical + electrical power, LVRT state |
/api/dersim/wind/override |
POST | Force a wind speed (bypass the bundled NDBC dataset) |
/api/dersim/fuelcell |
GET | Fuel cell stack voltage / current, H₂ flow, tank state, mode (FC / EL / idle), stack temperature |
/api/dersim/fuelcell/setpoint |
POST | Command a stack power setpoint (signed for reversible PEM/SOEC) |
/api/dersim/hybrid-dc |
GET | DC-coupled hybrid telemetry — PV + battery + inverter flows on the common DC bus |
/api/dersim/hybrid-dc/dispatch |
POST | Hot-swap the dispatch policy (self_consumption / pv_priority / manual) |
/api/dersim/hybrid-dc/manual |
POST | Manual-mode inverter-output target |
Communication-layer endpoints¶
| Endpoint | Method | Purpose |
|---|---|---|
/api/dersim/csip-client |
GET | CSIP client status, discovered EndDevice, active DERControls |
/api/dersim/csip/* |
GET / POST | Full CSIP client control — see IEEE 2030.5 Client |
/api/dersim/evse/* |
GET / POST | EVSE / OCPP charge-point control — session state, transaction lifecycle, DER controls — see OCPP Charge Point |
/api/dersim/sunspec-client/* |
GET / POST | Built-in SunSpec Modbus client for polling another DER (useful for round-trip + interop testing) |
Driving the simulator from a script¶
Every endpoint is documented in the live Swagger UI with request /
response schemas and a "Try it out" button that fills in the right
JSON shape. For a scripted run, hitting the JSON endpoints directly
with curl is enough:
# Snapshot the live state
curl http://localhost:8111/api/dersim/overview | jq .
# Override the wind speed to 12 m/s (Wind-T4-3Phase devices)
curl -X POST http://localhost:8111/api/dersim/wind/override \
-H 'Content-Type: application/json' \
-d '{"wind_speed_m_s": 12.0}'
# Switch a Hybrid-DC plant from self-consumption to PV priority
curl -X POST http://localhost:8111/api/dersim/hybrid-dc/dispatch \
-H 'Content-Type: application/json' \
-d '{"policy": "pv_priority"}'
# Tail the OCPP module logs
curl 'http://localhost:8111/api/dersim/logs?modules=OCPP&limit=200'
For long-running test harnesses, generate a typed client from the OpenAPI JSON — every endpoint is fully schema'd, so a generated client gets compile-time guarantees on request / response shapes.
Authentication¶
The dashboard API is unauthenticated by design — it's a lab tool,
not a production interface. Bind it to 127.0.0.1 (the default) when
you don't want an external listener. The
CSIP management UI on
--csip_website_port follows the same convention.
Versioning¶
The API version is exposed in the OpenAPI spec (info.version) and
on /api/dersim/server-info. Backwards-incompatible changes bump
the major; additive endpoints bump the minor.