#energy #standard #s2 #protocols #api-bindings #energy-management

s2energy

Provides type definitions and utilities for the S2 energy flexibility standard

1 unstable release

new 0.1.0 Jan 21, 2025

#216 in WebSocket

Apache-2.0

46KB
479 lines

The S2 standard for Rust: s2energy

This crate provides type definitions and utilities for working with the S2 energy flexibility standard in Rust. S2 is a communication standard for energy flexibility and energy management in homes and buildings, designed to simplify the use of energy flexibility of smart devices. To learn more about the S2 standard:

Crate contents

This crate provides Rust types for all types specified by S2. It also includes provides utilities that help you manage an S2 connection over websockets with JSON as the format, including functions to easily set up a WebSocket server/client to send/receive S2 messages.

JSON over WebSockets is a common and recommended way to implement S2, but you're free to choose a different format and communication protocol. In that case, the types in this crate should still be useful but you may wish to disable the websockets-json feature.

Documentation

You can find the crate documentation at docs.rs. The crate documentation assumes that you are familiar with S2; if this is not the case, you may want to refer to the GitHub wiki for the S2 JSON schema. That documentation explains S2 concepts in more detail.

Dependencies

~5–15MB
~185K SLoC