[Custom Component] Roborock communication

Great work on the plugin. Works quite well.

I dont know if its related but for some reason the maps won’t show anymore in the Android app after i added the vaccuum to HA. Could be coincidence ( they worked at first but now it is failing )

A tip for the people that run homeassistant in kubernetes;
add a lifecycle policy that adds NPM after pod starts.

lifecycle:
  postStart:
    exec:
      command: ["/bin/sh", "-c", "/sbin/apk add npm"]

edit; i think there are general issues with the roborock services that prevented the maps from showing up. they are now working and unrelated to this custom component.

I think there is actually an issue with the maps after adding the roborock to HA (s5 max here).
On Wifi/LAN the maps barely load in the roborock app. It timesout after a while but sometimes it works for a short period.
On 4G/mobile internet it works flawlessly!

Could it be that the integration in some way interferes with direct connectivity via roborock app in the same LAN?

Potentially that is the case. Might be some kind of interference due to calls from the same key.

Annoyingly soon after finishing this I have moved into temporary accommodation and the vacuum is in storage, so unable to do much with it.

Happy for anyone to contribute, and should be able to oversee. I will take a look @ any PRs etc. And can point people in the right direction how it works

I don’t have the same experience. My maps keep loading as “fast” as always in the app. Nothing changed since I added my Roborock to HA last week.

Another thing, when I was looking at Roborock android app source. The maps is all done via React Native. So would be very hard to reverse engineer / migrate. Unless someone has done that kind of thing before. I do know JS quite well, but React not so much

I have the S5 Max and my Home Assistant docker running with NPM with a dedicated dockerfile but when using bluestacks to get my needed tokens from the Roborock app version 2.3.26 i ran into problems i can’t seem to solve

When gzipping the folder then the rr_tyua_xxxx contains an empty list but I found another file rr_rr_xxxxx that contains:the fields below like @afawaz / @Loony1 / @moto2000 did someone found a solution for this?

localKey 
duid
id, key, productId ( same key )
roomId 

This is the available JSON String (changed some keys/information). One thing to notice is that tuyamigrated is false:

[{"activeTime":1609758228,"displayOrder":0,"duid":"6jtILnvV27chh9ane3SZab","extra":"{\"xxxx\": \"xxxx\"}","fv":"01.10.26","iconUrl":"","isShare":false,"localKey":"ZNNLKPc8DXTuse4E","localOnline":false,"name":"Roborock S5 Max","online":true,"productBean":{"attribute":0,"capability":0,"category":"s6","code":"s5e","id":"49qZXusGAhtBh4L3Sb4SOV","key":"49qZXusGAhtBh4L3Sb4SOV","model":"roborock.vacuum.s5e","name":"Roborock S5 Max","schema":[{"code":"rpc_request","id":"101","mode":"rw","name":"rpc_request","type":"RAW"},{"code":"rpc_response","id":"102","mode":"rw","name":"rpc_response","type":"RAW"}],"wifi":false},"productId":"49qZXusGAhtBh4L3Sb4SOV","pv":"1.0","share":false,"shareTime":0,"timeZoneId":"Europe/Amsterdam","tuyaMigrated":false,"tuyaUuid":"tsspjoc654kq5125c9255"}]

I’m running into the same problem, see: [Custom Component] Roborock communication

It has worked for me in the past, but it seems they changed things.

I made an update to @jd89’s component that no longer requires NodeJS.

You can try it here: https://github.com/redphx/hass-roborock
I also modded the Roborock app to display tokens inside Logcat: https://github.com/redphx/roborock-tuya-token

Tested on S5 Max and it worked.

Hopefully it will be merged into the original component soon. Thanks @jd89 for all the work.

5 Likes

Interesting, great work.

I tried the modified app to retrieve the token, but after loggin in the app does not show my device. Should it work with all firmware versions?

Hmm that’s weird. Which device are you using? Maybe Roborock v1.2 is too old and doesn’t support your device. I should make a modded version of the 2.x version. Please wait.

I also have a S5Max… on firmware 01.13.40.

The latest (or a recent) version of the original app was working for me on BlueStacks.

Does it work with Roborock s6 maxV?

Please try again with version 2.3.32: https://github.com/redphx/roborock-tuya-token/tree/main/android

Sorry I don’t know the answer. If this module supports it then the answer is likely yes: https://github.com/rytilahti/python-miio

This version displays my device indeed.

Unfortunately only the information below is printed in my command window. I also had problems before with the rr_tuya_ file method, after a while it did not contain the deviceId and token anymore…

output:
./adb logcat -s “ROBOROCK-name”, “ROBOROCK-devId”, “ROBOROCK-localKey”
--------- beginning of system
--------- beginning of main

Where is your account located? Mine is US.

I’ve updated the app. Please download the 2.3 version and try again: https://github.com/redphx/roborock-tuya-token/tree/main/android
Hopefully it will work this time.

Mine is EU (The Netherlands). Same result with the last version…

As I mentioned before, a couple of months ago I was able to get the code from a file. It looks likes they have changed things. Some other Roborock owners noticed the same behavior (for example the post of jan 10). Thanks anyway, appreciate your work.

Sorry I couldn’t help. My guess is that your account is not migrated to Tuya yet (but I don’t know how to activate the migration process manually).

Hi Jack,
I really like what you prepare to integrate a Roborock, and keep the Roborock App still active. But am stuck to get you code deployed. Using Raspberry Pi and Hass.io implemented and also was able to get key and token. But starting with connecting to the repository does not work in my environment.
Anyone with suggestions, looks like I miss a part.