No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-02 07:51:35 +00:00
crates Add Ble.Adv method 2026-10-02 07:51:23 +00:00
demos Show the Bluetooth state in the status demo 2026-10-02 07:50:12 +00:00
.gitignore Add workspace with protocol core crate 2026-10-01 20:14:19 +00:00
Cargo.lock Add demo that switches the operating mode 2026-10-02 07:01:40 +00:00
Cargo.toml Add discovery demo 2026-10-01 20:28:51 +00:00
clippy.toml Add workspace with protocol core crate 2026-10-01 20:14:19 +00:00
LICENSE-APACHE Add workspace with protocol core crate 2026-10-01 20:14:19 +00:00
LICENSE-MIT Add workspace with protocol core crate 2026-10-01 20:14:19 +00:00
README.md State that 30000 is the default Open API port 2026-10-02 07:51:35 +00:00

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

License

MIT or Apache-2.0, at your option.