- Rust 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| crates | ||
| demos | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| clippy.toml | ||
| LICENSE-APACHE | ||
| LICENSE-MIT | ||
| README.md | ||
marstek-rs
Rust library to talk to Marstek energy storage devices on the local network, without the Marstek cloud.
| Crate | Content |
|---|---|
marstek-proto |
Sans-IO protocol core: encodes requests, decodes replies. No I/O, no async runtime. |
marstek |
tokio transport on top of marstek-proto. Re-exports it as marstek::proto. |
Protocols
Open API (marstek::open_api): JSON-RPC over UDP, default port 30000. Enable
the Open API in the Marstek app first. Supported methods:
Marstek.GetDevice, Bat.GetStatus, ES.GetStatus, ES.GetMode,
ES.SetMode, EM.GetStatus, BLE.GetStatus, Ble.Adv, and discovery
by broadcast.
Devices drop many requests. The client sends a request again every 1 s until the reply arrives, and keeps 1 s between two requests to the same device. Faster requests stop the device from refreshing its CT values.
Modbus TCP (marstek::modbus): reads holding registers, port 502.
The register map in marstek_proto::modbus::venus_e3 covers the
Venus E 3.0.
The units of the Open API values follow the official documentation (Rev 3.1).
Demos
cargo run -p marstek-discover # find devices
cargo run -p marstek-status -- 192.168.1.107 # Open API status
cargo run -p marstek-set-mode -- 192.168.1.107 auto # switch mode
cargo run -p marstek-modbus-read -- 192.168.1.107 [1] # Modbus values
Sources
- Open API: the official client aiomarstek and ha-marstek-local-api.
- Modbus registers: marstek_venus_modbus.
License
MIT or Apache-2.0, at your option.