# Open ADMS Lab

> A complete distribution control centre (SCADA + ADMS) in one program, running live on a simulated 33/11 kV network in Madrid: SCADA, FLISR, outage management, Volt/VAR, DERMS, load flow and state estimation, with operator training and an MCP endpoint for AI assistants. A learning and portfolio project: the network, customers and events are simulated; no real utility data.

Open ADMS Lab runs the systems a utility control room uses on one live network, so what one module does the others see. The parts talk real Modbus TCP, DNP3 and IEC 60870-5-104 to each other, as field devices and a control centre would. The network has 5 substations with their 11 kV feeders, tie switches, PV plants, batteries and EV charging hubs; its load and weather move in real time, around the clock.

## What it does

- SCADA: polling of every RTU over Modbus, DNP3 (class 0 and time-stamped events) or IEC 104 (interrogation and spontaneous events), a historian with trends, alarm management after ISA-18.2, controls over DNP3 or IEC 104 with select before operate, and ICCP (TASE.2) to the TSO: transformer and feeder values every 30 s and at each breaker change, and the TSO's requests for less load, answered with batteries and demand response; load shedding, rotational by the DMS and under-frequency relays in the field
- FLISR (self-healing): locates a faulted cable section, isolates it and restores the healthy part through a tie switch; manual approval or automatic
- OMS (outages): incidents from breaker trips, customer calls and smart-meter last-gasp messages; crews, restoration estimates, jumpers, cuts and earths placed by crews, callbacks to customers after restoration, SAIFI and SAIDI
- DMS (network analysis): load flow, WLS state estimation, Volt/VAR optimisation, fault location, relay checks, study mode and switching orders, a transformer thermal model (IEC 60076-7: hot spot, insulation ageing, the rating the air temperature allows now)
- DERMS: PV curtailment, battery dispatch, managed EV charging (also against the transformer's rating now), microgrids, hosting capacity, operating envelopes for aggregators
- Low voltage: one distribution transformer modelled down to its customers: smart-meter voltages per phase, a per-phase load flow with the neutral, rooftop PV and home EV chargers, overvoltage and unbalance alarms
- Planning: N-1 contingency, loss-minimising reconfiguration, day-ahead forecast (with the transformer's rating and hot spot hour by hour), demand response
- Weather and GIS: moving lightning storms and wildfires that trip feeders; feeders on real Madrid streets
- Network model: versions, validation, live switch-over, CIM (IEC 61970) and GeoJSON export
- Training: a control room and a grid per student, scenarios, a fault simulator, and built-in help (a ? on every console, tool and key term, in Simplified Technical English)

## Try it

- [Landing page](https://seat01.adms.vedranv.com/login): what it is, with screenshots, and the sign-in
- [Request training seats](https://forms.gle/PzRAWdY8Pfd1Q5AA7): for a course or a workshop, up to 25 students at a time

## Use it from an AI assistant

- MCP endpoint: `https://seat01.adms.vedranv.com/mcp` (streamable HTTP). It takes the same user name and password as the control room, as an `Authorization: Basic` header. The landing page has the commands for Claude Code and Codex.
- The read-only tools return what the control room shows: alarms, events, trends, FLISR plans, load flow, outages and crews, forecasts, transformer hot spot and rating, load shedding. No tool can operate equipment, acknowledge alarms or change settings.
- An engineer's assistant can also read network model versions and, where the server's owner allows it, write drafts. Only a person can activate a model version.

## Prepare a landbase for a custom model

Use a shell in the source checkout. An assistant connected only through MCP can give these instructions to the deployment operator. The importer runs locally and writes a portable directory.

1. Identify the target electrical model. Use its exported model JSON directly, or run `open-adms-lab model export VERSION > my-network.json` against the intended model database. Replace `VERSION` with its numeric ID. Omitting it selects the active version.
2. From the repository root, run `python3 tools/import_landbase.py --model my-network.json --out ~/landbases/my-network`. Choose a new output directory. The tool derives the extent and downloads OpenStreetMap features. To choose the extent yourself, replace `--model my-network.json` with `--bbox SOUTH WEST NORTH EAST` in degrees. For offline import use `--osm-json extract.json` with a saved Overpass response containing way geometry.
3. If surveyed geometry is available, add `--network-geojson assets.geojson` to the same command. Use a WGS84 FeatureCollection in longitude, latitude order. Load-node Points have properties `kind=load_node` and `id`. Cable LineStrings have `kind=cable` and `to` (downstream node ID). Tie LineStrings have `kind=tie` and `id`. Match IDs to the model. Without surveyed geometry the app uses schematic offsets and straight sections.
4. Copy the generated directory to the host running the lab. Set `LANDBASE_DIR` to its absolute path in that instance's service environment and restart the app. The electrical model has its own activation workflow. All model versions in an instance share the selected landbase.
5. Open the Geographic view and verify a known station and feeder against the streets. For the full walkthrough, see the repository README section “Landbase for your own network”.

## How it is built

- Rust, one binary: simulator, SCADA, DMS, OMS and the web interface in one process, with SQLite for history
- Standards it follows: Modbus TCP, DNP3, IEC 60870-5-104, ICCP / TASE.2 (Blocks 1, 2 and a Block 5 setpoint), IEC 61970 CIM, IEC 61968-9 meter events, IEC 61968-100 message envelopes (inbound), IEC 60076-7 transformer loading, IEC 62443 zones and roles, ISA-18.2 alarm management, IEEE 2030.5 DER controls (read-only subset)
- Data shapes: hourly demand from REE and Datadis, solar from PVGIS, maps from OpenStreetMap and Madrid's census
