Skip to content

Forward a robot's Matter key request to Roborock's cloud (opt-in) - #252

Open
virtitnerd wants to merge 2 commits into
Python-roborock:mainfrom
virtitnerd:pr/matter-key-forwarding
Open

virtitnerd wants to merge 2 commits into
Python-roborock:mainfrom
virtitnerd:pr/matter-key-forwarding

Conversation

@virtitnerd

Copy link
Copy Markdown
Contributor

Why

A robot can only join a Matter controller once it has a Matter key, which Roborock's cloud issues. A robot paired to
the local server asks the local server for it, and nothing answers, so Matter setup fails.

What

When the robot is told to download its key, it calls GET /iot.roborock.com/fwapi/matter/key on the server it was
paired to, using the server name with the api- prefix removed (the same rule the camera follows). With
[matter] key_proxy = true (or ROBOROCK_SERVER_MATTER_KEY_PROXY=true, which wins) the server passes that request,
with the robot's own headers, to the regional cloud host and returns the answer unchanged. Off by default. The log
records header and query names, the answer's status and size, and never values or the key.

The stripped name also needs a DNS record and a certificate. Without the record the robot fails within seconds and no
request ever reaches the server; the new docs/matter.md explains it.

Testing

Tests cover the path match, the regional host, the setting and the environment override, and a forwarded request.
Full suite: 462 passed. On a Qrevo Curv 2 Flow the robot went from KeyNotExit through KeyDownloading to Ready
with a setup code, and a Matter controller (UniFi Network) added it.

Related

#68 (documentation on Matter versus this integration). #229 (the same stripped-hostname mechanism for the camera).

virtitnerd and others added 2 commits November 12, 2026 19:19
A robot paired to this server asks it for its Matter key, which only Roborock's
cloud issues. With [matter] key_proxy = true (or ROBOROCK_SERVER_MATTER_KEY_PROXY=true)
the request is passed on to the regional cloud host with the robot's own headers
and the answer is returned unchanged. Off by default.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant