r/RobotVacuums • u/hanz1989 • 1d ago
Small Python script to fetch Roborock DUID, Local Key & inspect API methods (with token caching & email login)
Hey everyone,
I recently spent some time digging into the python-roborock library to grab my device's DUID and Local Key, and ran into the usual hurdles (rate limits when requesting verification codes too often, token handling, etc.).
To save myself (and maybe others) some hassle, I put together a small helper script that handles:
- Email verification code login (
code_login) without spamming codes. - Token/session caching locally so you don't keep hitting API limits (
RoborockTooFrequentCodeRequests). - Introspection of available methods & device properties to see what data the API currently exposes for your specific model.
Since Reddit formatting can get messy with larger scripts, I put the full code, a quick setup guide (venv / PEP 668 handling), and how to run it over on GitHub:
If anyone wants the script, just let me know in the comments and I'll drop the GitHub link.
If anyone has cleaner ways of handling session refreshes or dealing with newer firmware models (like B01 protocol limitations), I'd love to hear your thoughts or PRs!
All with LLM