[Custom Component] Roborock communication

What is the best way to get the code for iPhone / Windows user ? where can I find the detailed guide assuming there is one?

Does this HACS integration work on supervised home-assistant (formerly Hassio) ?

p.s.
Please share your feedback on Roborock in general and this custom integration in the following thread so that other people considering this device will benefit from the full picture:

Look in this thread, MaxV not supported

@Graig_Burton, @ghvader reported 13 days ago that he found the token info of a S60 MaxV in rr_rr_xxx file.
Am I missing something? Apart your note about the MaxV not being supported :slight_smile:

The key is elsewhere as it is not communicating with Tuya, thus, not supported by this component.

@Craig_Burton, thank you for the explanation

I found this recently and wanted to share incase it helps anyone with ideas on how to implement w/o API.

For anyone who read this thread and still had no idea what should be done to get the Roborock token when you use the Roborock app. This post is for you. This is what I did and it worked like a charm. I used windows 10.

  1. Download and install Bluestacks 4 https://www.bluestacks.com/
  2. Open Bluestacks and install the Roborock app from the play store
  3. Login to the Roborock app and make sure the vacuum is added. (I did this on my phone months ago)
  4. You now need to “root” Bluestacks to get access to the folder you need. This can be done with BSTweaker 5. You can download it from https://bstweaker.tk/
  5. Extract BSTweaker 5 to your PC. Open BlueStacksTweaker5.exe.
  6. In the “Main” tab click on “Force Kill BS”
  7. In the “Root” tab, click “Unlock”
  8. Go back to the “Main” tab and click “Start BS”
  9. Next on the same tab click “Install SuperSU” and then “Update SuperSU” when the first is done.
  10. Start Bluestacks again and check that it is successfully rooted. You can download something like “Root checker Basic” from the play store
  11. Go back to BSTweaker 5, goto tab “FM”. The right-hand side will be your Bluestacks system and the left hand your local windows system.
  12. On the right hand nagibate to /data/data/com.roborock.smart/files/rr_cache/
  13. Look for a file called starting with “rr_tuya_” and ending in a bunch of numbers. For example. “rr_tuya_145367”
  14. Select this file by clicking on it. Select a location on the left and click “Copy”, above the right hand window on the right top.
  15. Navigate to the location you copied the file and rename the “rr_tuya_???” to “rr_tuya_???.zip”
  16. Now unzip the file inside and open it.
  17. Inside this file look for “localKey”, this will be your token.
  18. Next look for “devId”, this will be your Device ID.
  19. Inside Home Assistant go to integrations and add Roborock.
  20. Enter the Name, IP, and the newly discovered Token and Device ID.

That is it you are done.

3 Likes

And this works with the native Xiaomi Vacuum component? Or does this require the custom component in this thread?

This is simply an alternative way of getting the localKey and devId. The custom component is still needed.

I understand. Thank you for clarifying.

To clarity even more; the custom component is not needed for e.g. the s5 max, because it does have tuya software, right?
I hope to confirm this using your steps later today, @JohanPotgieter
Thanks so far!

It uses the standard Tuya protocol. However, it is the standard Xiamoi Mi commands that are sent, they are just encrypted first and sent over.

This custom component bridges the gap and allows to use the latest Roborock app, alongside home assistant for the vacuum

2 Likes

Yes. I was perfectly able to retrieve the tokens, thank you. Next issue is the missing npm on my HA.
I’m running docker on an ubuntu server with hassio, any tips to get it working @bernhard ? I’m fairly new to this no hassio setup

For reference, I’ve installed the custom component by adding a custom repo and getting the Roborock integration from this repo in HACS

Hi,

you need to create a new docker image.
you take the official HA image as a base and add npm to it like in this post: [Custom Component] Roborock communication

create an empty directory somewhere on your server, add a file called “Dockerfile” and put the content in.

1 Like

Yeah thanks, that’s the info I needed.
For this route, I need to find out how and what services to expose. Which I fine, but I’m thinking about w workaround; issue container command pkg add on the running HA container.

Can confirm my HA now sees my s5 max vacuum, using latest firmware

You have to do that then on every container restart.

Yes I’m currently writing a script on host boot.
This is a workaround of course, I am hoping Roborock will get it’s own addon (I do use hassio)

For reference, the script for installing npm into hassio docker container is
docker exec -it $(docker ps -q --filter "name=homeassistant") apk add update nodejs npm

update:
So, the scripts need to be ran only once after HA has started. As a slightly better workaround, I’ve implemented the following Nodered flow based solution:

It uses docker-container-actions and the HomeAssistant nodes, and basically checks if nodejs is installed in the container and, if not, installs it (using Docker Container Execute APK commands) and restarts Home Assistant.
This can be my semi-stable workaround until easier and better support is made

2 Likes

Would it be possible for you to post the flow so that I can import it into my NodeRed? Not that familiar with it yet :smiley:

So, having grabbed the API key and device ID thanks to JohanPotgeiter’s guide, I’m now stuck with missing npm and nodejs. As I’m using HassOS, is there currently a way of installing those?

On the box, run: -

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt install nodejs