PiotrMachowski / Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor

This custom integration provides a way to present a live view of a map for Xiaomi (Roborock/Viomi/Roidmi/Dreame) vacuums without a need for rooting.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for Dreame vacuums

PiotrMachowski opened this issue ยท comments

Vacuums confirmed to use this API:

  • dreame.vacuum.p2008 (Dreame F9)
  • dreame.vacuum.mc1808 (Xiaomi Mi Mop/Xiaomi Miija 1C)
  • Other ones mentioned in comments below

You can help in implementation of this feature by sending your map file and a screenshot from Xiaomi app at

piotr.machowski.dev [at] gmail [dot] com.

To get raw map file you have to use following config:

camera:
  - platform: xiaomi_cloud_map_extractor
    host: !secret xiaomi_vacuum_host
    token: !secret xiaomi_vacuum_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
    store_map_raw: true
    force_api: dreame

and then follow steps provided in documentation: Retrieving map.

Existing implementation of map decoder

@PiotrMachowski , have just retrieved the mapping data from a Dreame D9 and emailed it over. Hope it helps

Hello, can't add the "force_api" parameter, I get an error "invalid option" any idea ?

@xguitoux This option is currently available only on dev_new_api branch, which has to be installed manually

@xguitoux This option is currently available only on dev_new_api branch, which has to be installed manually

Do you absolutely need it for map generation ? I have a DreameF9 to share map

i already shared map for Dreame F9

@xguitoux right now I collect data that will help me in the future implementation, it's not absolutely needed, but every map makes tests more complete.

PS I don't own this vacuum, so for me it's totally not needed ๐Ÿ˜„

@xguitoux right now I collect data that will help me in the future implementation, it's not absolutely needed, but every map makes tests more complete.

PS I don't own this vacuum, so for me it's totally not needed ๐Ÿ˜„

Do you "need" the export in order to debug the generated map, I was using "need" in that way.
I'm very interested in the map for my dreame so I will try to send the export :)

Hi,
I have sent you my extracted map. Unfortunately i don't understand how todo anything with the current implementation.

Thanks for everything you have done! it is so cool!

Hey there, the map is also unsupported on
dreame.vacuum.mc1808 (Xiaomi mi Mop/Xiaomi miija 1c)

I have sent the map file via email.
I will add the "unsupported" to the readme

Hi, Iโ€™ve emailed you a map screenshot and raw file for my dreame.vacuum.p2009 (Dreame D9).

Is the Dev API branch broken?

@square-spade this comment is now outdated, you can just use the latest release (manually or using HACS)

Dreame is not supported Right?

@pergolafabio yup, still not supported. But it's possible to retrieve a raw map file for Dreame vacuums using v2.x.x release

Sent information for:
MOVA L600 Robot Vacuum and Mop Cleaner
MODEL: dreame.vacuum.p2157

Sent raw map + screen for Dreame L10 Pro (dreame.vacuum.p2029)

commented

Hey, I also have Dreame L10 Pro
I've sent you the raw map and screenshot of the app.

one small note, in the top post
shouldn't it be like this? (RAW at the end)

store_map_raw: true

@SM-26 yup, I have updated first comment. Thanks

I am using Dreame D9. How can I retrieve the map when using core installtion? I enabled tmp folder to be visible in the config but no map file appears inside. Is the map automatically created when starting Home Assistant?

@kjellxvx map should be created in /tmp directory (cd /tmp). By the way, I have a lot of maps now, so you don't have to send it ;)

@kjellxvx map should be created in /tmp directory (cd /tmp). By the way, I have a lot of maps now, so you don't have to send it ;)

thanks for your reply! however the map doesn't appear in /tmp. Should is happen automatically or do I have to initiate the map creation process somehow? When trying to add the entity to my dashboard it says it's not supported.

@kjellxvx it should happen automatically, if you have store_map_raw: true in your config. You can try to define your own path using store_map_path

@kjellxvx it should happen automatically, if you have store_map_raw: true in your config. You can try to define your own path using store_map_path

I think that worked! Thanks!

By the way, I have a lot of maps now, so you don't have to send it ;)

Model of vacuum does matter? I have dreame.vacuum.mc1808 and can send it too, if still needed.

@tarasifua I already have a map from this model, so you don't have to :)

Would it help if you also send the data for dreame.vacuum.p2028 (Dreame Z10 Pro)

@Mikhail5555 I don't have data from this model, so you can send it if you want to

commented

Ahh just got the dreame.vacuum.mc1808 today and see that its not supported,
I will wait then,

thanks!

also hoping for this :)

Hi Guys,
Please I have an issue with my Dreame Vacuum D9 (dreame.vacuum.p2009) which is dead!! (No interaction, no light, no reaction, ...) before that I have switched my Mi Home account from Singapore to French ( because I wanted to link it with my Alexa :( )
It was fully charged and it have requested me to update the firmeware but after that I disovered that the robot is dead and I tried to reset it but no reaction. from that moment I can't do anything as it is fully Off and no signe of reactvitiy, is like the systeme has been erased or its Soft have been broken due to the firmeware update.
Can you please help me to resolve this issue?
For information, I installed the token extractor and I can see the Vaccum linked in my account Singapore and I can see also its token.
Many thanks for your help and support

Sented map and screen of dreame.vacuum.p2036 (Trouver LDS Cleaner). I haven't seen anyone send information on it.
I hope that support for Dream vacuum cleaners will appear as soon as possible, including Trouver.

@Mikhail5555 I don't have data from this model, so you can send it if you want to

I have just sent the data for the Dreame Z10 Pro

I have Z10 Pro too, hope it will work soon

What home assistant integration we should use to at least integrate the robot in HA?
used the one from this repo with this fix pooyashahidi/xiaomi_vacuum#12

i can help with a dreame.vacuum.p2041o (Xiaomi Robot Vacuum Mop 2 PRO+)

Sented map and screen of dreame.vacuum.p2036 (Trouver LDS Cleaner). I haven't seen anyone send information on it. I hope that support for Dream vacuum cleaners will appear as soon as possible, including Trouver.

Interested in this, too. Thank you both @PiotrMachowski and @disinvis !

I'm also interested in this! Hopefully, we can see support for dreame vacuums soon.

Is there hope or a support date?

@beliy1985 I don't plan to implement it anytime soon, but somebody wants to add this feature then I will be happy to help with implementation and verification.

Hi @PiotrMachowski i had send you my map.
Hope one day you can get this done. Appreciate your hardwork.
Model: Mijia Robot Vacuum-Mop 2C
Model Number dreame.vacuum.p2140
https://home.miot-spec.com/spec?type=urn%3Amiot-spec-v2%3Adevice%3Avacuum%3A0000A006%3Adreame-p2140%3A1

Cheers and have a nice day.

Is there any possibilities to support dreame.vacuum.p2149o ? I tried to force download the map but failed.
https://home.miot-spec.com/spec?type=urn%3Amiot-spec-v2%3Adevice%3Avacuum%3A0000A006%3Adreame-p2149o%3A1

i have vacuum.dreame_p2008_92ed_robot_cleaner i can't get map says the dreame p2008 not suppoted

I sent you the map of my Dreame D9. I hope you can manage to integrate it. thanks a lot

commented

@beliy1985 I don't plan to implement it anytime soon, but somebody wants to add this feature then I will be happy to help with implementation and verification.

Are you referring to Dreame support? If no I can also send you data for a Z10 Pro.

@jaegerschnitzel yeah, I was talking about adding Dreame support. You do not have to send it, I already have a map from this model.

Can anyone help me on how to integrate the z10 pro Please!

Thanks

Hi, it looks like Dreame models have recently been added to OpenHAB: openhab/openhab-addons@b6836b8

Is the information in that commit helpful in any way - if someone with enough HA knowledge (and python skills) takes a look (I guess @PiotrMachowski would do it if enough time, but currently not)?

Hi @odelma!

Support for controlling vacuums and support for retrieving their maps are two extremely different things, so in this case OpenHAB code doesn't help.

Having said that, in my first comment there is a link to map parser implemented in Valetudo - it "just" needs to be rewritten in python (actually HA knowledge is not needed at all).

Thanks @PiotrMachowski - misunderstanding from my side โ˜บ๏ธ

@jaq1988 and others using Dreame vacuums, take a look at https://github.com/pooyashahidi/xiaomi_vacuum if it proves to be uselful.

that doesnt work for F9
i use this one for F9 : https://github.com/microfrost1/xiaomi_vacuum

commented

hello

any news on the support for the L10 pro ?

Hi @PiotrMachowski,
I own a Z10 pro. I think is the same as L10.

I check valetudo code.
It needs "only" to convert that js file into python, right?
I could help with this, but how can i configure a developing environment and a testing area?
Is there somewhere documentation?

I never created implementation for HA, i don't know where start and what is needed for doing it, but i would help.
Thank you.

Hi @davideZavattero

Yes, that's the "only" thing that has to be done.

For development you can use get_map.py script.
You have to include your implementation here (create image_handler.py and map_data_parser.py like in other platforms), the rest code should be already prepared for working with Dreame.

You can DM on HA forum with any problems

Hi! I just got a new Xiaomi 1C, exactly the model mentioned on the first comment (dreame.vacuum.mc1808).
But when I set up the .yaml like you said I got this:
imagen
Do I something wrong?

When I try the retrieving map with this command:

Open terminal and use the following command to copy file:
docker exec homeassistant bash -c "mkdir -p /config/tmp/ && cp /tmp/map_* /config/tmp/"

I got:

cp: omitting directory '/tmp/map_*'

@facutopa as you see this vacuum model is currently not supported by map extractor, so you won't get map image.

If you want to receive raw map data to send it to me then you don't have to, I already have map from this model

@facutopa as you see this vacuum model is currently not supported by map extractor, so you won't get map image.

If you want to receive raw map data to send it to me then you don't have to, I already have map from this model

So If I understand, I can't use "Xiaomi Vacuum Map Card" right? Or sending to you the map is someway possible?
Sorry, my english is bad and I understanded that send you the map is for help you to solve this issue, right?

You can use it with map screenshot instead of live map, but it's much harder than using extractor.

I need maps to test implementation for Dreame vacuums in the future

Hi @davideZavattero

Yes, that's the "only" thing that has to be done.

For development you can use get_map.py script. You have to include your implementation here (create image_handler.py and map_data_parser.py like in other platforms), the rest code should be already prepared for working with Dreame.

You can DM on HA forum with any problems

Ok, thank you. i'll try during holydays.

@davideZavattero Do you have any progress? Can I help with anything? :)

Sigh... Dreame Bot L10 Pro
vacuum

@PiotrMachowski can you share some commands helpful for a faster debugging/developing?
something like:

put the file map_data_dreame.vacuum.p2041o.b64 in the dreame folder that execute python xiaomi_cloud_map_extractor/dreame/map_data_parser.py parse and you should find the generated .png in the same folder

@FrancYescO I think I can prepare something like this, I already have similar scripts

@PiotrMachowski

Do you need an extracted map for Z10 Pro? I can share if it would help

@Techfreak96 thanks, I already have a map from this model

@FrancYescO @davideZavattero I have prepared a nice and easy to use script that will download a map from cloud or parse an already downloaded one: map processor

I tried this with the dreame d9 max (dreame.vacuum.p2259). When i use the map processor script i get a ~5KB b64 file and the not supported image. When i use the store raw configuration i also get the the b64 file but the logging always says:

Retrieving map from Xiaomi cloud
Map data retrieved
Map is empty

The map extractor script:

Validating configuration file: camera.yaml
Configuration validation successful
Downloading map data...
Map data successfully saved to "camera" directory!

I have a map in the Mi Home app. Would the b64 file helpful to implement it?

@manujedi You can send me this file as well as screenshot from Mi Home app, I probably don't have a map from this model yet

is the b64 file the map? As the map extractor expects a *.gz file so i wasn't sure. Thanks

@manujedi yes, different models provide different file formats:
xiaomi -> gz
viomi -> zlib
roidmi -> gz
dreame -> b64

Perfect thanks, will send you the files

commented

hello,
Is the support going well? I really want to use this integration, is there any way to help? (because I'm a developer, maybe I can help)

Thanks

Hi @Nicooow,

Personally I don't do it, maybe @FrancYescO and @davideZavattero have done something. There is a link to a working implementation written in JavaScript in the first comment, it needs to be rewritten in Python

Hi @Nicooow,

Personally I don't do it, maybe @FrancYescO and @davideZavattero have done something. There is a link to a working implementation written in JavaScript in the first comment, it needs to be rewritten in Python

unfortunately i can only do small basics in python and co. has anyone already written something to fall back on?

commented

ok I'll look at next week to do this, there shouldn't be any problem

Nothing about Dreame D9? Dรฎs you receive my map, @PiotrMachowski ?

@kisjeth I think I did. I have a lot of maps for many different vacuums, I will test all of them before release.

@kisjeth I think I did. I have a lot of maps for many different vacuums, I will test all of them before release.

Ok tnks! Anyway great job!

commented

@PiotrMachowski could you just quickly explain to me what image_handler.py is for?

@Nicooow
map_data_parser.py - parses whole raw binary map file
image_handler.py - parses map image data

You can DM on HA forum with any problems

image
Just sent an email with a screenshot and raw map for MOVA L600 or Dreame F9/D9 (similar) (Dreame p2157).
Thank you so much. Can't wait to use it =)

Hi @PiotrMachowski you are doing really grate job! I am also seeing no support alert for one of my robots - dreame.vacuum.mb1808 . What exactly should I send to you right now?
image

@Pxvvxp you can send me map_data_dreame.vacuum.mb1808.b64 file + screenshot from Xiaomi Home.

camera:
  - platform: xiaomi_cloud_map_extractor
    host: !secret xiaomi_vacuum_host
    token: !secret xiaomi_vacuum_token
    username: !secret xiaomi_cloud_username
    password: !secret xiaomi_cloud_password
    store_map_raw: true
    force_api: dreame
    store_map_path: "/config"

Hello @PiotrMachowski, I just wanted to make sure you received my email with screenshot + file for mb1808 and if I did everything fine. Thanks in advance.

@Pxvvxp yup, everything is ok

Hello ๐Ÿ‘‹

I've got a dreame.vacuum.p2008 model and I'm currently working on transcribing Valetudo's javascript code for map parsing of Dreame models.

I'm quite comfortable with Javascript, but I'm just discovering Python so it's taking me a little while.
Here is the actual map I can generate with my model :
2022-01-27_15-44
You can see floor, walls, charger and vaccum position as well as no go areas.
I also implemented path parsing, but the dreame map contains several paths and the MapData can only contain one if I understand correctly. I tried to flatten the list but it causes unwanted interconnections between paths :
2022-01-27_16-59

I have a lot of work to do and I will submit a P.R if you're intesrested @PiotrMachowski

Nice ๐Ÿ‘
I think I can add support for multiple paths without any problems.
You can create a PR, I will check it out and adjust if needed ๐Ÿ˜‰

๐Ÿ˜
It's wonderful to see progress on this!

Is this intended to pull data from the cloud or directly from the robot? I've blocked internet access in the router and control it via xiaomi_vacuum.

@PulsarFX well, the name contains the word "cloud"... ๐Ÿ˜‰

nevermind ๐Ÿค“ ๐Ÿคฏ
This would be a valetudo only feature, then?

Yup, if you want to remain cloud-free

Did someone already start (or has ben successfull) to add support for the Dreame D9 Pro (dreame.vacuum.p2187) if not, does anyone plan to do that so we could join forces?

I probably go for a Dreame bot w10. Is there any chance this robot will be included in this feature in the future or is it impossible?

@RaJeronimo I think it will

I have send the raw map file and a screenshot to support dreame.vacuum.p2041o.
Tia!

Will the Dreame Z10 Pro (dreame.vacuum.p2028) also added?

@mirkin1993 I think so

A noob question - is the support for "Dreame" vacuums includes also the vacuum functionality like "goto" on the xiaomi-vacuum-map-card?

@aviadlevy this is a completely different thing. Map card has to support integration used to control vacuum.

Is there any update on this. I would love to have mc1808 supported