Docs / Background
Grid, metering and flexibility
Smart-meter gateways, §14a control, substation protocols and flexibility markets: the background behind imsys, ems, fms and flexpool.
The low-voltage grid wakes up
Germany’s distribution grids were built for predictable household load. A street with twenty houses once peaked at perhaps 40 kW in the evening. Add ten 11 kW wallboxes and ten heat pumps, and the same cable can see well over 100 kW if they all run at once, or a reverse flow at noon from rooftop PV. Rebuilding every cable would take decades and be very expensive. The faster answer is to observe and steer: measure what happens in the low-voltage grid and, when a cable is close to its limit, briefly reduce the power of flexible devices.
That is what the regulation, the metering infrastructure and the stack’s energy platforms are for.
Smart-meter gateways (imsys)
Germany chose an unusually secure architecture for smart metering, specified by the BSI (Federal Office for Information Security):
┌───────────────── home ─────────────────┐ ┌──────────── outside ───────────┐ │ │ │ │ │ meters ──LMN──┐ │ WAN │ Gateway administrator (GWA) │ ← imsys │ (DLMS, SML, │ ┌───────────────┐ │ ═════════► │ external market participants │ │ wM-Bus) └──►│ Smart-Meter- │ │ TLS, │ (MSB, NB, LF, ESA) │ │ │ Gateway (SMGW)│ │ BSI PKI │ │ │ CLS devices ─HAN─►│ TR-03109-1 │ │ │ CLS backend (e.g. DSO) │ ← cls-eedi │ (control box, └───────────────┘ │ │ │ │ HEMS, wallbox) │ │ │ └────────────────────────────────────────┘ └────────────────────────────────┘
- The gateway (SMGW) collects meter data on the local metrological network (LMN), sends it encrypted to authorised participants over the WAN, and provides a secure channel to controllable local systems (CLS) on the home area network (HAN).
- The gateway administrator (GWA) configures gateways, manages certificates and tariff profiles and monitors operation. imsys implements the GWA side of BSI TR-03109-1 v2.0, with gateway and meter simulators.
- Meters speak DLMS/COSEM (IEC 62056), SML or wireless M-Bus to the gateway.
dlms-cosem-kitcovers DLMS; SML and wM-Bus are on the roadmap. - Through the CLS channel a grid operator can reach a control box or a HEMS. The
CLS.EEDI protocol (
cls-eedi) and EEBUS (eebus) carry power limits and states across it.
The Metering Point Operation Act (MsbG) sets rollout duties and price caps for metering point operators.
§14a EnWG: controllable consumers
Since 1 January 2024, under BNetzA decision BK6-22-300, new heat pumps, wallboxes, night storage heaters, air conditioning and batteries above 4.2 kW are controllable consumption devices. In return for reduced grid charges, the grid operator may reduce their grid draw to a guaranteed minimum (4.2 kW per device, scaled for several devices) when the grid is about to be overloaded. Connections cannot be refused because of grid capacity.
| Module | What the customer gets |
|---|---|
| Module 1 | A flat-rate reduction of grid charges |
| Module 2 | A percentage reduction of the grid-charge energy price (requires a separate meter) |
| Module 3 | Time-variable grid charges (from 2025, in combination with module 1) |
The control path is long, and the stack covers each link:
- fms estimates the loading of a low-voltage feeder from the grid model (CIM/CGMES
via
cim-kit), measurements and known devices, and decides a limit. It records why. - The limit goes to the device through the smart-meter gateway’s CLS channel (imsys, cls-eedi), or via OpenADR or IEC 60870-5-104 where the grid operator’s systems use them.
- In the building, ems (hemsd/bemsd) receives the limit, for example over EEBUS
use case LPC (limitation of power consumption), and distributes it across the
heat pump, the wallbox (OCPP via
ocpp-kit) and the battery, keeping comfort and the customer’s tariff in mind. - The meter shows what actually happened, and the evidence is kept.
Substations and telecontrol
Above the low-voltage grid, grid operators run substations and control centres with their own protocols:
| Protocol | Where | Member |
|---|---|---|
| IEC 61850 | Substation automation: GOOSE messages for fast protection signals, Sampled Values for digitised current and voltage, MMS for client/server access, SCL for configuration | iec61850-kit |
| IEC 60870-5-101/104 | Telecontrol between control centres and stations; the dominant SCADA protocol in Europe | iec60870 |
| IEC 61968/61970 CIM, CGMES | The grid model: topology, equipment and parameters, exchanged between operators | cim-kit |
| IEC 62351 | Security for all of the above | on the roadmap as a shared crate |
Flexibility and markets
When many small devices can shift their consumption or generation, they become worth money:
- Wholesale markets: day-ahead and intraday trading at the power exchange, now in quarter-hour products.
- Balancing (Regelenergie): the TSOs buy automatic and manual frequency restoration reserve (aFRR, mFRR) to keep 50 Hz. Assets must be prequalified.
- Redispatch 2.0: grid operators order plants up or down to relieve congestion and compensate them.
- Dynamic tariffs: since 2025 suppliers must offer tariffs that follow the exchange price, so a home battery or a car can charge when power is cheap.
flexpool is the aggregator, or virtual power plant, that pools sites run by ems and
larger plants (via IEC 104 and SunSpec/Modbus), forecasts prices, and bids into these
markets, starting in a replay sandbox. OpenADR 3 (openadr) and S2
(s2-kit, EN 50491-12-2) are the open protocols for sending price and flexibility
signals to devices without vendor lock-in.
Building automation
Large buildings and industrial sites already run building automation, and an energy
manager must speak it. ems’s bemsd uses KNX (knx), BACnet (bacnet-kit) and
OPC UA (opcua-kit) for that, and Matter (matter-kit) for the growing number
of smart-home devices.