matter-controller
The high-level Matter controller API — the single crate a consumer depends on
to commission and control Matter devices from pure Rust. It wraps every other
matter-* crate behind a small, async (Tokio) surface.
Part of matter-rust.
Status: 0.3.0. The v1.0 controller (M8) plus Matter-1.4 completeness work (M9): BLE→Wi-Fi/Thread commissioning, full interaction model, groups, OTA provider, ICD client, multi-admin/ACL — extensively validated against real silicon (ESP32-C6 over Wi-Fi and Thread).
What it does
- Fabric & identity —
create_fabricmints and persists the controller's stable operational identity once per fabric, through a pluggableControllerStore(a defaultFileStoreships). Opt-in per-fabric ICAC for a 3-tier RCAC→ICAC→NOC chain. - Commissioning —
commission("MT:…" | "<manual-code>", label)brings a device onto the fabric over IP, verifying device attestation against anAttestationTrust(example_device_roots(), or production PAA/CD roots viafrom_dirs).commission_ble(featureble) commissions a fresh device over BLE onto Wi-Fi or Thread. Both return a typedNodeInfo. - Node lifecycle —
nodes() -> Vec<NodeInfo>enumerates commissioned devices (node id, fabric id, vendor/product id, label) with no snapshot deserialization;forget_node(node_id)drops all local state for a device without needing it to cooperate (reclaim an unreachable/reset node). - Interaction —
Node::read/write/invokeover rawmatter_codec::Value(plusinvoke_tlvfor pre-encodedmatter-clusterscommand TLV), wildcard + chunked reads, events, and timed interactions. - Subscriptions —
Node::subscribereturns aSubscriptionstream of attribute/event reports that transparently auto-resubscribes across session loss or a device reboot (validated on hardware). - Groups — provision group keys and
invoke_groupover IPv6 multicast. - OTA provider —
serve_otaannounces + serves a.otaimage over BDX to a commissioned requestor. - ICD client — register as a check-in client and receive a Long-Idle-Time device's periodic Check-In.
The operational CASE session is established, cached, and reused transparently — callers address a device by node id and never manage sessions.
Quickstart
use Arc;
use ;
let store = new;
let controller = builder
.attestation_trust
.build
.await?;
let _fabric = controller.create_fabric.await?;
let info = controller
.commission
.await?;
let node = controller.node;
// Read all OnOff attributes; subscribe to changes.
let report = node.read.await?;
let mut sub = node.subscribe.await?;
while let Some = sub.next.await
// Enumerate and manage commissioned nodes.
for n in controller.nodes.await?
See examples/ (controller_quickstart, list_nodes, e3_group_multicast,
serve_ota, …) for end-to-end runs, and
docs/matter-js-migration-guide.md
if you're coming from matter.js.
Known limitations
- BLE commissioning on macOS hangs in the BTP pump (CoreBluetooth). Drive
live BLE commissioning from Linux; IP commissioning and everything else is
unaffected on all platforms. Tracked with a diagnosis + instrumentation
(
MATTER_BLE_PUMP_TRACE=1). - Thread network commissioning and BLE transport require the
blefeature.
License
Apache-2.0.