[RELEASE] Roborock Robot Vacuum

Update 1.1.0 now in HPM and gitHub to support scenes (aka routines). :crossed_fingers:

This is first pass, so might have some bugs. I query for the scene data, and remove anything not associated with current device id. Then build a json map struture for the scene attribute, similar to rooms.
image

Use the scene key (scene id) to start the routine. You can pause, then use appRoomResume to continue.
image

It will update at some point, but you can press refresh after initial code to update immediately.

5 Likes

Like you, I couldn't find anyone that had a solution, so I had to resort to reverse engineering. The app knows about Routines, and I confirmed that it wasn't stored on the phone because I could see them on my wife's phone when sharing device access. So I grabbed a copy of the Android Roborock APK, opened it up, and went spelunking. Discovered the classes2.dex file has a lot of strings that look like URLs, so started experimenting with those.

These are a bunch of the URL strings I found in that file. There may be more.
(In retrospect, you might want to GET on "user/scene/device/{deviceId}" instead.)

user/account/delete
user/account/email/unbind
user/account/mobile/unbind
user/agreement/cancel
user/agreement/sign
user/app/info
user/config/messenger
user/devices/newadd
user/devices/{duid}
user/devices/{duid}/extra
user/devices/{duid}/jobs
user/devices/{duid}/jobs/{jobId}
user/devices/{duid}/lw
user/deviceshare/accept
user/deviceshare/cancel
user/deviceshare/query/receiveddevices
user/deviceshare/query/shareddevices
user/deviceshare/query/{duid}/rooms
user/deviceshare/query/{duid}/users
user/deviceshare/reject
user/deviceshare/remove
user/deviceshare/share
user/homes
user/homes/{homeId}/rooms
user/homes/{homeId}/rooms/order
user/inbox
user/inbox/delete
user/inbox/latest
user/inbox/latest/detail
user/password/change
user/password/check
user/rooms/{roomId}
user/rooms/{roomId}/device/all
user/rooms/{roomId}/name
user/scene
user/scene/device/{deviceId}
user/scene/home/{homeId}
user/scene/list
user/scene/order
user/scene/validity
user/scene/{id}
user/scene/{id}/execute
user/scene/{id}/name
user/scene/{id}/param
user/scene/{id}/triggers
user/scene/{sceneId}/enable
v2/user/homes/{homeId}
v2/user/scene

1 Like

Fantastic.

I have a S7 MaxV and it works fine.
I just don't have a use case for this yet.

1 Like

Thanks. I chose CN and then it showed the base URI as https://euiot.roborock.com

Unfortunately it doesn't log me in, even after choosing EU. I do have my Facebook attached, but not sure if that matters?

It probably does matter since you would need to use an OAuth authorization against FB. HE drivers do not support OAuth redirects and that would require building out a full HE application to support (if even possible). Sorry, but I can't support that type of authorization.

No problem. I did actually remove the Facebook connection, and waited, but it did not help.

Not sure next steps here. Do you have any special characters in your username or password?

No worries, not looking for any next steps per se. Just want to communicate my findings.

My username is my gmail email address, and the only special character is then the @ sign. My password does not contain any special characters either.

The error message is simply that login failed.

Do you think it is possible to get more granular error messages?

Hi,
First, Great work, i've been searching for something like this for a long time! :slight_smile:

If that helps, I am too using my gmail as my username and getting the same login failed error Kulfsson gets.
Wen't to Xiaomi web site and tried logging in with my gmail and password and it worked.

Good luck! :crossed_fingers:

@Lior Can you send me that website? I was only aware you could log in via the mobile applications.

@Kulfsson How did you establish your initial account?

@Bloodtick_Jones Sure! i logged in from here:
https://account.xiaomi.com/
Hope it's the same account and not two different accounts i made with the same password :sweat_smile:

@Lior sent you a private message, but it sounds like you can only link to Roborok or Xiaomi, but not both. This integration expects the device to be on the Roborock solution to authorize.

I don't know this for sure, but sounds like the case here.

Been watching this thread and finally got it installed. Can confirm this works with my Q8 Max+. Thank you for your efforts maintaining this community driver!

1 Like

Blockquote
@Kulfsson How did you establish your initial account?

I did it in the Mi home app, many years ago. I see in a comment by you futher down that you mention a difference between Xiaomi and Roborock. I downloaded the latest version of the driver with the debug and got a message there that might indicate something. I can share in our direct chat.

And in case you were looking for actual "local" control:

I came across this:

FYI Q5 working great here, thanks!

I've been using this driver for a few weeks now, and have been really impressed. Nice work @Bloodtick_Jones! Thank you.

After working for a week or so, everything stopped working last night. Neither my NR nodes nor commands directly from the device's Hubitat page would work.

The first thing I tried was to re-log in using that switch in preferences . Re-logging in had no effect on the problem.

In the log for the vacuum device I found a bunch of these entries, with this one being the last log entry from the vacuum device:

ERROR: org.eclipse.paho.client.mqttv3.MqttSecurityException: Not authorized to connect (method connect)

I did a search and found someone felt that the only way to fix that error was to remove the device, and then add it back again fresh. So I did that and I went through my NR flows and updated them so they had the new device ID for the device.

This restored functionality to the Hubitat device. However, communication with NR is still not working. The device nodes (they return data about the state of the device) seems to work perfectly. However the command nodes will not work. They result in this error in the debug panel.

[deviceId:329] http://hube.theerrors.com:80/apps/api/234/devices/329/startCleaning/24: {"error":true,"type":"java.lang.Exception","message":"An unexpected error occurred."}

I've verified that 329 and 234 are the correct device ID and Maker app IDs respectively and 24 is a room ID. I tried to run a command to the Maker IP by just entering the URL + params into my browser (http://hube.theerrors.com/apps/api/234/devices/325/startCleaning/18?access_token=*******) and got this;

"error":true,"type":"java.lang.Exception","message":"An unexpected error occurred."}

Finally, this is what the Maker API log shows:

Does anyone have any ideas about what is going on here?

Thanks!

It sounds like you did enable this to retry your login?

Did you try the basic device info using the actual hub IP from the Maker API description. Something like this?

(http://10.0.0.33/apps/api/437/devices/1042?access_token=3...8)

@Bloodtick_Jones thank you again for your support with this driver. We had a fiber internet outage on Thursday and it was out from 330 AM until Noon. I noticed my Roborock device never reflected that and the healthStatus remained online. Once things were back up it never recovered either and wasn't connected to the websocket. Clicking Initialize got things working again but I wanted you to be aware the hourly refresh doesn't seem to reflect internet outages.

Also just a little feedback cleanTime, cleanArea, and cleanPercent generate a lot of "noise" for the hub when the vacuum is running. I ended up commenting out that code within my copy of your driver since I have little use for those attributes. Not sure what other community members think but maybe make these optional events via preference?

1 Like

Can you send a few of the logs over this time. The watchdog should of put the device 'offline'. ?

I use these values for SharpTools to show current status much like the native app. When you mean noise, do you mean event traffic or log traffic? (you can always turn off the info log traffic in the driver with the settings)

@Bloodtick_Jones

I have a S7 maxV
When I give a command on device interface it is accepted and Roborock starts cleaning.
But then automatically it starts a "dock" command in just 5 seconds.
Here is the log:

dev:14342024-06-10 15:01:15.699infoRoborock state is returning dock (6)

dev:14342024-06-10 15:01:14.204infoRoborock switch is on

dev:14342024-06-10 15:01:14.177infoRoborock clean time is 0 minutes

dev:14342024-06-10 15:01:13.871infoRoborock executing execute(command:get_prop, param:[get_status])

dev:14342024-06-10 15:01:08.785infoRoborock state is room clean (18)

what might be the issue ?

edit: somehow it started a "new map" , any idea why ?