Rustuya
Local-network control of Tuya-compatible devices, built in Rust with first-class Python bindings. Designed for fleets of hundreds to thousands of devices — a native Rust core handles the I/O while the Python facade releases the GIL on every blocking call, so threaded Python workers stay live.
Install
Rust
Python
Quick start
Rust
use Device;
let dev = new;
dev.set_value?; // turn on DP 1
println!; // read current DPS
for msg in dev.listener
Python
=
# turn on DP 1
# read current DPS
# real-time events
Features
- Local-only — talks directly to devices over LAN, no Tuya Cloud
- Rust core + Python bindings (PyO3) — same engine for both
- Built for fleet scale — per-device background tasks with automatic reconnection and exponential backoff
- Full protocol coverage — Tuya 3.1 / 3.2 / 3.3 / 3.4 / 3.5 + device22
See the Guide for the full API reference, design philosophy, and architecture notes.
Credits
The Tuya protocol layer in rustuya is derived from the specifications and error codes documented in tinytuya:
License
MIT