Skip to main content

Crate redispatch_xml

Crate redispatch_xml 

Source
Expand description

redispatch-xml — Redispatch 2.0 XML/XSD format parsing and validation for the German electricity grid (§§ 13, 13a, 14 EnWG).

§Domain background

Redispatch 2.0 entered into force on 1 October 2021 via the Netzausbaubeschleunigungsgesetz (NABEG) and requires all German grid operators to coordinate congestion management across transmission and distribution networks. It covers:

  • All renewable-energy (EE) and combined heat-and-power (KWK) plants with ≥ 100 kW installed capacity
  • All installations permanently remote-controllable by a grid operator (e.g. via Smart-Meter-Gateway)

§Format family

Redispatch 2.0 uses CIM/IEC 62325-based XML documents for the primary data exchange between TSOs, DSOs, and balance responsible parties. Documents are validated against BDEW-published XSD schemas (topicGroupId 25 in the BDEW MaKo document API).

Document typeXSD versionValid from
ActivationDocument1.1f2025-10-01
PlannedResourceScheduleDocument1.0f2025-10-01
AcknowledgementDocument1.0f2025-10-01
Stammdaten1.4b2025-10-01
StatusRequest_MarketDocument1.12025-10-01
Unavailability_MarketDocument1.1b2025-10-01
Kaskade1.02025-10-01
NetworkConstraintDocument1.1b2025-10-01
Kostenblatt1.0d2025-10-01

These are not EDIFACT. IFTSTA status messages for the Redispatch 2.0 workflow are handled separately by the edi-energy crate.

§Market roles

RoleAbbrev.Description
ÜbertragungsnetzbetreiberÜNBTransmission system operator
VerteilnetzbetreiberVNBDistribution system operator
AnlagenbetreiberANBGeneration asset operator
DirektvermarkterDVDirect marketer of renewable energy
BilanzkreisverantwortlicherBKVBalance responsible party

§Quick start

use redispatch_xml::{parse, Document};

let xml: &[u8] = b"<ActivationDocument xmlns=\"urn:entsoe.eu:wgedi:errp:activationdocument:5:0\">...</ActivationDocument>";
match parse(xml) {
    Ok(Document::Activation(doc)) => println!("Got ACO/ACR/AAR: {:?}", doc.document_type),
    Ok(other) => println!("Other document type: {:?}", other.document_type()),
    Err(e) => eprintln!("Parse error: {e}"),
}

§Regulatory references

  • §§ 13, 13a, 14 EnWG — statutory basis for grid congestion management
  • NABEG 2019 — introduced Redispatch 2.0, effective 1 October 2021
  • BNetzA BK6-20-059/060/061 — three BNetzA rulings governing billing balance, grid operator coordination, and information provision
  • BDEW XML-Datenformate Redispatch 2.0 — XSD schemas and application guidelines published on bdew-mako.de

Re-exports§

pub use documents::AcknowledgementDocument;
pub use documents::ActivationDocument;
pub use documents::DocumentType;
pub use documents::Kaskade;
pub use documents::Kostenblatt;
pub use documents::NetworkConstraintDocument;
pub use documents::PlannedResourceScheduleDocument;
pub use documents::Stammdaten;
pub use documents::StatusRequestMarketDocument;
pub use documents::UnavailabilityMarketDocument;
pub use error::RedispatchXmlError;
pub use validation::ValidationResult;
pub use validation::ValidationWarning;
pub use validation::validate;

Modules§

documents
error
types
validation
Structural and semantic validation for Redispatch 2.0 documents.

Enums§

Document
A parsed Redispatch 2.0 document (any of the nine supported types).

Functions§

detect
Detect the document type of a Redispatch 2.0 XML message without fully deserializing it.
parse
Deserialise a Redispatch 2.0 XML document into the appropriate Document variant.
parse_and_validate
Parse a Redispatch 2.0 XML document and run structural + semantic validation in one step.
parse_as
Deserialise a Redispatch 2.0 XML document into a specific type T.
serialize
Serialise a Document to an XML byte vector.
serialize_as
Serialise a specific document type T to an XML byte vector.