Add Map to Xiaomi vacuum cleaner

Hey @luc3as thanks for replying!!!

Yep. I got the token with the Packet Sender app option because at my experience level, I just couldn’t get the miio app to discover the tokens on my Hassbian Pi Zero W install.

I’m worried I might have the wrong token, or have entered it wrong as a vac shows up in HA but it says that it’s unavailable. Did you experience this?

Would you mind taking a look at my config? I tried it with quotes around the token and without, no luck. Do I put spaces between the sets of two characters in the token?

Thanks again for replying, I really appreciate it mate.

Edit: bonus round… could you paste your config? Thank you

vacuum:

  - platform: xiaomi_miio

    host: 10.0.0.20

    token:'01E1AIREMOVEDSOMEDEDD'

I have my Roborock working and have my token without quotes. I have a feeling your token is too short.

This is how it looks in my working configuration:

Thanks @Piggyback
Love the Stimpy pic. Is that an e20 or s50 vacuum? Not sure if it matters.

My actual key is 32 characters, got it from the Packet Sender method of joining the factory reset wifi of the device and extracting the last 32 characters. Great to see that it’s no spaces, thank you.

I’ve seen some xiaomi keys only 16 characters? Not sure if it’s variable.

How did you get your keys? I couldn’t find a way to install the Miio command line utility in Hassbian. Again, I’m hamstrung by inexperience, but npm doesn’t appear to work on Hassbian and I’m not sure if putting that entry for the vac into config actually installs the miio command line utility too.

I’ve come a long way over the last few months from struggling to get the os to install over my crappy internet to finally just tweaking config. Feels great and really appreciate the help.

You should take a look at Valetudo

1 Like

Hi @TraktorS2,
It took me some tricks to get the token. As I run on a RPI on Hassio, I don´t have much options to play around there. So what I did is I downloaded the full package of Xiaomi Miio on my desktop and followed the instructions to get the key through Visual Studio with Phyton and all components through a powershell terminal.

Thanks for your post😊
so, it looks “rooted” means pack ssh key with original image and upload to vacuum?

Having the same problem. The code should include some persistence between cleaning cycles. Which mihome app achieves. Other then that it is a good solution to see the last location of the robot.

Started noticing the same.
@asphalter, do you know if something has changed within the vacuum?
On a S50, can’t remember having this on the v1, but I can do some test runs.

This is still the best way to get the map onto HA by far, so hopefully it can be worked around.

Anyone knows if there is any way to do any of this on s6 (gen.3?). Valetudo doesn’t supports it yet…

We’re you ever able to root or get maps for the ‘E’ vacuums?

No, It’s very probably not possible as the CPU in these vacuums is ESP8266 like chip, while with first and second generation there is big ARM CPU like in raspberry pi. I don’t know if this small chip compute something anything with map, or if it just sends raw data to the cloud where it is processed. I was looking for some way of “hacking” the mi home app, or gain access to some cloud api, but without any luck.

Hi all there’s a guy who has a fork off Valetudo RE which claims he reversed engineerd the web api:


If we could use this to retrieve the map anyone can(even without root) could add the map(maybe it’s the same way Flolevac did it)

2 Likes

@asphalter I really like your approach. Especially the SSH control master connection with rsync is very cool. :+1:

Just curious: why are you running the script on the vacuum and not on the HASS host? I know the latter would require a persistent SSH connection even if the vacuum is not running, but then we could keep the vacuum unmodified (except from the SSH key).

get map without root via cloud api. This is fork project Squachen/ micloud
Need to write a converterr rrmap to jpg

Nice. I already rooted my roborock so don’t need it anymore but still interesting for the people who don’t wanna mess with their robot!

I have made an integration that retrieves a map from Xiaomi cloud, you can check it out here:

Dedicated thread:

@ekorsanov01 I didn’t know about micloud library (it wasn’t available when I have started my implementation), it would have made my work easier :slight_smile:

3 Likes

You are a genius! :beers:
Thank you!!!

This is COOL! Thanks Piotr! Are you planning to release it through HACS? For now it works as a custom component for me, but HACS would be easier.

Yes, I plan to do it.

Update: I have created a dedicated thread for this component

Hey,
Just want to be sure,
There is still no known way to save the latest Xiaomi vacuum gen 1 map - right?

I will ask otherwise, my problem is that the vacuum cleaner goes on the carpet and gets stuck and then they try to release and restart / restart the map is deleted
This is really disturbing because I have already built coordinates for each room and now they are irrelevant ):

Thanks

1 Like