npm.io
0.1.3 • Published 15h ago

n8n-nodes-roborock

Licence
MIT
Version
0.1.3
Deps
1
Size
79 kB
Vulns
0
Weekly
0

n8n-nodes-roborock

n8n community node to control Roborock robot vacuums from your workflows: start and stop cleaning, clean specific rooms, send the robot to the dock, read status, battery and consumables, and run routines.

Roborock has no official public API. This node talks to the same unofficial cloud API the Roborock app uses (the protocol known from projects like python-roborock, ioBroker.roborock and homebridge-roborock-matter). It can break whenever Roborock changes their backend, and it requires your app credentials.

Supported devices

Vacuums using protocol version "1.0" (the vast majority): S4, S5, S5 Max, S6, S6 MaxV, S7, S7 MaxV, S8 family, Q5, Q7 Max, Q8, Q Revo family, Saros, and more. Newer A01 devices (Dyad, Zeo) and B01 devices (2025 Q7 M5/L5, Q10) are not supported yet; the node tells you if your device needs them.

Installation

Self-hosted n8n only (this node uses an MQTT client dependency, so it is not available on n8n Cloud):

Settings > Community Nodes > Install > n8n-nodes-roborock

Credentials

Email and password of your Roborock app account.

Accounts with two-step email verification (most accounts today) cannot log in with just a password. For those, run the one-time helper after installing the package locally:

node scripts/login-roborock.mjs request           # emails you a 6-digit code
node scripts/login-roborock.mjs complete 123456   # saves the session blob

Then paste the contents of ~/.roborock-userdata.json into the credential's "Session Data (JSON)" field. The session is long-lived; password can stay empty.

Logins are aggressively rate-limited by Roborock (about 20 per day). The node caches its session in memory to stay far below that limit, but avoid workflows that would recreate credentials constantly.

Operations

Device
  • Get Many: list all devices in the account (owned and shared)
  • Get Status: state, battery, errors, fan power, water mode
  • Start Cleaning / Pause / Stop Cleaning / Dock
  • Clean Rooms: segment clean of selected rooms, with repeat count. Rooms can be picked from the current map or resolved by name at runtime, which is what you want when the request comes from a webhook or an expression.
  • Get Rooms: room list of the current map with names
  • Set Fan Power / Set Water Flow / Set Mop Route
  • Get Consumables / Reset Consumable
  • Get Clean Summary: lifetime statistics
  • Find My Robot: the robot announces its location
  • Custom Command: send any raw protocol method (e.g. app_zoned_clean, set_led_status, get_network_info) with JSON parameters
Scene
  • Get Many: list the routines configured for a device in the Roborock app
  • Execute: run a routine
Cleaning rooms by name

Segment IDs are local to the map and change whenever the map is rebuilt, so hardcoding them in a workflow is fragile. Set Room Source to By Name and pass a comma-separated list of room names (or segment IDs) instead:

kitchen, Carlos's Office, 22

Names are resolved against the live map on every run. Matching ignores case, accents, apostrophes and separators, because the Roborock cloud stores room names exactly as they were typed in the app and routinely mixes Carlos’s Office (typographic apostrophe), Fernando's Bedroom (straight apostrophe) and Máster Bathroom (accent) in the same home. So carlos-office, Carlos's Office and Carlos’s Office all resolve to the same segment.

A name that matches nothing, or that matches more than one room (master, when the home has both a Máster Bathroom and a Master bedroom), fails the node with the list of available rooms rather than cleaning the wrong room.

How it works

Login against the regional Roborock cloud gets a long-lived session (token plus MQTT credentials). Commands travel over Roborock's cloud MQTT broker as AES-encrypted binary frames, the same way the app controls the robot remotely. Every response is matched to its request; commands time out after 10 seconds if the device is offline.

Development

npm install
npm run build        # tsc + icons
npm run lint
npm test             # room name resolution unit tests, no credentials needed
npm run smoke        # live smoke test, needs ROBOROCK_EMAIL / ROBOROCK_PASSWORD

Disclaimer

This project is not affiliated with or endorsed by Roborock. Use at your own risk.

Author

Built by Carlos Aragon. Need a custom n8n node, an integration with an API that "has no API", or automation consulting? Reach out through carlosaragon.online.

License

MIT

Keywords