Roborock S5, Mi App and automations

Hi
I recently picked up a used Roborock S5 on ebay and would like to integrate it into HA. I wasn’t able to get it working with the Roborock app on my phone but did manage it with Mi. I have been able to add it to HA but I can’t see how to select a particular room(s) for cleaning.
Can anyone help in a step-by-step manner or point me in the right direction please?

try to enter the number from 10 → and your vacuum should start (if you have a map with rooms in MI app)

data:
  command: app_segment_clean
  entity_id: vacuum.stovsugeren_i_vaerkstedet
  params:
    - 17
entity_id: vacuum.stovsugeren_i_vaerkstedet
service: vacuum.send_command

thank you for your reply.
I’m afraid I have no idea on where to start with this

You may want to take a look at:

Working very well here with 2 x Roborock S5 Max.

thank you - i’m in the process of watching youtube videos on both of these but currently stuck at Xiaomi-cloud-tokens-extractor as I can’t get it to run on HA.

You don’t need this to run on HA. If you use a Windows PC just download and run token_extractor.exe (as admin user). Keep your Xiaomi-credentials ready. After having filled in your credentials just copy/write down the Token and use it in HA.

Thank you!
For others who might be stuck at this step as well there is also another token retrieval resource that works for Mac & Windows: GitHub - Maxmudjon/Get_MiHome_devices_token: Get Mi Home devices token Windows/MacOS app.

Thank you again for this - I have both loaded and working though I need to tinker with the lovelace vacuum map card as only the live map works, and I haven’t got the room names sorted yet. Tips would be appreciated!