OpenADR 3.1 · Rust · Apache-2.0 OR MIT

OpenADR 3.1 in Rust — a VTN server, a VEN runtime and a typed client.

Run a VTN with SQLite or PostgreSQL, embed a VEN with your application’s TLS provider, or use the wire model on a microcontroller.

Get started Documentation

brew install hupe1980/tap/openadr && openadr dev

What OpenADR is for

A utility or grid operator needs flexible load to move: charge later, curtail now, follow this price curve. OpenADR is the standard it uses to say so. A VTN (Virtual Top Node) publishes programmes and events; a VEN (Virtual End Node) — a charge point, a battery, a heat pump, a building controller — reads them, acts, and reports back.

Version 3 replaced 2.0b's SOAP with REST and JSON. Version 3.1, released in 2025, added push over MQTT, object privacy, and plain string targets. This crate implements 3.1, and ships both ends of it. The protocol in fifteen minutes →

Working with OpenADR

Decimal payloads

Decimal prices, import caps and curve coordinates, sent exactly or refused, never rounded.

Numeric precision →

Object privacy

The same visibility rules govern REST reads, webhook delivery and per-VEN MQTT topics.

Access rules →

Notification delivery

The VTN records notifications in the same transaction as the event. Operators can inspect and retry undelivered messages.

Notification transports →

Conformance testing

Run 52 checks against a VTN. Use the exit status in CI or share the HTML report with a peer.

Run the suite →

Running in under a minute

$ brew install hupe1980/tap/openadr      # or: cargo install openadr --features vtn,client,internal-auth,conformance
$ openadr dev
  VTN        http://127.0.0.1:3000/openadr3/3.1.0   (in memory — gone when you stop it)
  Inspector  http://127.0.0.1:3000/_inspect#…
  Seeded     dynamic-price   24 h price curve, rolls forward every 15 minutes
             capacity-limit  an event in 2 minutes, and one for feeder-7 that ven-1 cannot see

$ source .openadr-dev.env
$ openadr watch events                   # prints only when something changes
$ openadr trigger event                  # a capacity limit, one minute out
$ openadr conformance --report report.html

Open the inspector to see the event timeline, the events visible to each VEN, and notification deliveries. For persistent storage, run openadr vtn with SQLite or PostgreSQL.

Walk through it →

And a VEN that acts on what it reads

let ven = VenRuntime::with_meter(client, config, HouseMeter);
ven.register().await?;                     // idempotent, and checks the VTN's clock

loop {
    ven.sync().await?;                     // conditional: a quiet cycle is a 304
    if let Some(segment) = ven.active_at(ven.now()) {
        act_on(&segment.payloads);         // priority already resolved
    }
    ven.submit_due_reports().await?;       // each window filed exactly once
    ven.wait_for_work().await;             // wakes early on an MQTT notification
}

The runtime resolves overlapping events by priority and schedules reports. Your application supplies the meter readings and decides how the load responds.

The VEN runtime →

Start here