Roborock S5 Max, using both with HA and the Roborock App?

I use roborock app, i was able to get the token via the “mi home app” according to the instructions here: https://www.home-assistant.io/integrations/vacuum.xiaomi_miio/#retrieving-the-access-token

It works fine in HA then. But if i do that it is offline in the roborock-app. And if i remove the robot and add it again, it is there in the app. But now it doesn’t work in HA. The roborock app is very useful, can it be combined with having the robot in HA? If so, am i doing something wrong?

4 Likes

Just got a Roborock. I’m interested to that too.

The token from “mi home app” and the one from “roborock app” is not the same.
When you add again the robot to “roborock app” the token changes and stop working with HA.

1 Like

Looks like we’d need a way to get the token from the roborock app if we want to use it concurrently w/ HA.

1 Like

I have the S5 max. And it appears to be working fine :slight_smile: The kids named him ‘Bob’.
I have the token working for both HA and Xiaomi Home app.
It took me an hour or two to get it working.

I used a custom apk on andriod. version 5.5.4vevs.
But roughly I thought it worked when I did.

Install official xiaomi home app, register and login. connect/pair roborock to wifi.
in this official app, the token is created, but not visibly presented to us.
THen I uninstalled official app, installed a custom vevs version. just login again, No need to pair it again. no need to operate the cleaner.
In the folder smarthome/logs/plug_devicemanager/ date.txt will be written. If you search this file, you will find a token. In the file you could best search for ‘token’. there might be more than one. It should look like this: (ofcourse I replaced some details with xxx yyy)

SmartHome 311:[DEBUG]-08-14 20:50:23.424 processResult in result={“code”:0,“message”:“ok”,“result”:{“list”:[{“did”:“322170xxxx”,“token”:“33694a4f4f5xxxxxxxx17a5xxx6b794e”,“longitude”:“0.00000000”,“latitude”:“0.00000000”,“name”:“Bob”,“pid”:“0”,“localip”:“192.168.xx.xx”,“mac”:“xx:xx:xx:xx:xx:xx”,“ssid”:“yadayadayada”,“bssid”:“yy:yy:yy:yy:yy:yy”,“parent_id”:“”,“parent_model”:“”,“show_mode”:1,“model":"roborock.vacuum.s5e”,“adminFlag”:1,“shareFlag”:0,“permitLevel”:16,“isOnline”:false,“desc”:"Apparaat offline ",“extra”:{“isSetPincode”:0,“fw_version”:“3.5.8_0876”,“needVerifyCode”:0,“isPasswordEncrypt”:0},“uid”:… /cut
`

Uninstalled the russion custom apk
install official xiaomi app again, login and continue using that, and I fed HA the token in configuration
Dont forget to change password after this final login. The custom apk goes through external (russian) server I read which might be unsafe if your data is retained there. I cant be sure, so I have changed it.

vacuum:
  - platform: xiaomi_miio
    host: 192.168.xx.xx
    token: 33694a4f4f5xxxxxxxx17a5xxx6b794e
    name: Bob

Keep in mind that every time you pair your device with the wifi, the token will be changed.
also I have read that the Roborox app creates a new token each time you install the app. I havent tested it if this is true. I use theXiaomi Home app. which works fine for me :slight_smile:

Hope this helps someone

1 Like

Yea we can get it to work with the xiaomi app or mihome app, but the whole point was for the roborock app. If you can get that to work, that would be awesome!

1 Like

Ok.
What is the difference? Is that app better? What is the benefit?
Thanks

From what I can tell the difference between the apps is the Roborock app just controls the vacuum/s, but the Mi Home app lets you control vacuums and other Xiaomi smart home products. The benefit is to Mi Home if you have more than a vacuum and to the Roborock app if you just have a vacuum, because, from my perspective, its cleaner and easier to control the vacuum itself.

1 Like

I can see in your data that you are using the lastest 3.5.8_0876 firmware version. I have read that this version was incompatible with ha but you say that everything works fine. Could you confirm that all works with this firmware?

Thanks a lot.

Yes, you are correct.
Version is what you wrote. I just now opened the two aps with my phone and took some screenshots to show


Working fine from HA.
Also in node red directly.

I wasnt aware some had issues. It just works here. Starting, stopping back to dock, all works. Sending to clean a specific zone, 16, 17 etc. All good.
What was not working then?

Oh, perfect!

No, I am not saying that something is wrong. Just that I read that the integration is wrong in the latest firmware version.

I have spent some hours getting this vacuum working fine (a little python script that allows to send to clean more than one room easily) and I was too scared to update the firmware without being sure that it works fine. :rofl: :rofl: :rofl: :sweat_smile:

I’ll update today. Thanks a lot

No problem. Hope it works for you too. :slight_smile:

Python script is not needed I think.
in scripts.yaml I just programmed this. Or is this language python? wasnt aware I did that :smiley:

vacuum_keuken:
  alias: "Stofzuigen - keuken"
  sequence:
    - service: vacuum.send_command
      data:
        entity_id: vacuum.bob
        command: app_segment_clean
        params: [16]

vacuum_keuken_en_eettafel:
  alias: "Stofzuigen - keuken en eettafel"
  sequence:
    - service: vacuum.send_command
      data:
        entity_id: vacuum.bob
        command: app_segment_clean
        params: [16,19]
        
vacuum_gang:
  alias: "Stofzuigen - gang"
  sequence:
    - service: vacuum.send_command
      data:
        entity_id: vacuum.bob
        command: app_segment_clean
        params: [18]

To find out what number corresponds with what room, you can just send it to one, and look where it goes :slight_smile: Change the name accordingly.
You can also give multiple rooms in one script.

PS.
I dont know if you will need to get a new token after firmware update. I got mine with this firmware just ~2 weeks ago.

The python script is for not writing a home assistant script for each room variation.

I can send, for example, living room and bathroom on the fly, but the next one, living room and kitchen, without having to declare so many scripts. With a single python script I can do all possible variations.

The bottom buttons represent each room, clicking these buttons concatenate the app_segment numbers and then start cleaning with the string generated

2 Likes

Thanks for the write-up. I have it added to HA as well now using the Mi-Home token.

Am I right that without custom firmware (not yet available) you are unable to get the map in HA? Trying to figure this out, zoned cleaning with map would be great!

Beside this with the Roborock app you can create an account at google home.
Mi Home account is not able to create an googlehome account for Roborock s5 max (yet)

I still like to know if it is possible to add the Roborock app to HA?
I do see in Roborock app an DID is that like a token?
Somebody succeeded allready?

You can get tokens from the roborock app, but there are lots of reports that the token often changes with that app, sometimes even at a 24 hr interval. So not really usable at all for the moment.

Mi home app only change token when you reset the wifi settings and sometimes with a firmware update.

More information in this topic: New Roborock S5 Max Vacuum Cleaner

Thanks for the answer.

How do you do that? I haven’t been able to get the token from the roborock app? Changes of the token or not.

As far as I know it’s exactly the same method as with the mi app. Didn’t try it myself as the token changes all the time.

@DendelX - Can you share the code you used to create this card? i.e.

  • Lovelace
  • Config
  • Scripts
  • etc.