Protocols
How flexibility maps UFTP, EEBUS, S2, OpenADR 3, CSIP-AUS, IEC 104 and CLS.EEDI into limits and settlements: lossless or refusing.
Every protocol in the grid speaks about the same few things — a cap, a range, a plan, a measurement — in its own units, sign and time model. A converter translates one protocol into this crate's shapes and back. Each is a Cargo feature, off by default, built on its protocol crate, and none of them does I/O: the protocol crate parses and sends; the converter maps values.
flexibility = { version = "0.4", features = ["s2", "openadr"] }Which converter for which job#
| Feature | Protocol | Who sends it | Becomes | Page |
|---|---|---|---|---|
uftp | UFTP 3.1 (Shapeshifter) | a DSO and an aggregator trading flexibility | deviation envelopes, ordered deviations, settlement items | UFTP |
eebus | EEBUS LPC / LPP | a control box or energy manager to a device | consumption and feed-in caps, both ways | EEBUS and metering |
metering | German metering rules | the meter operator's data | the § 14a minimum as a guarantee; Lastgang energy as power | EEBUS and metering |
s2 | S2 (EN 50491-12-2) | an energy manager and a device | PEBC envelopes both ways; PPBC sequences as schedules | S2 and OpenADR |
openadr | OpenADR 3 | a VTN (utility) to a VEN (site) | capacity caps over their own intervals, both ways; usage as power | S2 and OpenADR |
csip | CSIP-AUS (IEEE 2030.5) | a utility server to a connection point | an envelope per quarter hour, by CSIP's own rules | IEC 104, CLS and CSIP-AUS |
iec104 | IEC 60870-5-104 | a control centre to a plant or site | active-power caps, both ways | IEC 104, CLS and CSIP-AUS |
cls | CLS.EEDI | a grid backend, through a smart meter gateway | control-box caps and failsafes, both ways | IEC 104, CLS and CSIP-AUS |
A site energy manager typically combines several: the operator's caps over OpenADR or CSIP-AUS, the § 14a minimum from metering, a heat pump's limit over EEBUS, a PV inverter over S2. All of them become limits in one envelope, and the envelope says which one set every bound.
The rules every converter keeps#
- Lossless or refusing. What both sides can express round-trips — a property test holds it where a converter goes both ways. What the target cannot express is an
Error::Unrepresentablenaming the protocol, the field and the value, never a silent drop. - The sign changes at the boundary and nowhere else. Protocols that send magnitudes (an EEBUS LPP limit, an OpenADR export limit, a CLS production limit) become feed-in caps of the right sign; each converter has a test with a known consumption and one with a known feed-in.
- Exact numbers. Decimals stay decimals. A binary float on the wire (an S2 number, an IEC 104 short float) is read once, through its shortest decimal: the value the sender wrote. A fraction of a watt is refused unless you name a rounding.
- Time is the protocol's, translated once. A limit keeps its own window; applied to an envelope, a window that covers part of a quarter hour constrains the whole quarter hour, so a plan inside the envelope keeps every limit.
- Units are never guessed. Where a protocol makes the unit a separate field (OpenADR), it is required. Where the meaning lives outside the message (an IEC 104 point list, an S2 commodity quantity), you pass it.
- No clock. A duration that starts "on receipt" (EEBUS, CLS) takes the receipt instant as an argument, so the same message gives the same limit in a test and in a replay.