Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor: Failed to retrieve map from vacuum
Checklist
- I have updated the integration to the latest version available
- I have checked if the problem is already reported
The problem
First of all thanks for this great integration! I’ve been using it for more than a year now without any issues. However for the last couple of days I don’t receive any maps anymore. I only see “Failed to retrieve map from vacuum” for both my vacuums (S5 &S7). I’ve checked the logs but nothing’s showing. I only have the custom integration error about that it’s not tested by Home Assistant. But after that, nothing at all. Always difficult when something breaks when you didn’t change anything…
Any idea’s?
What version of an integration has described problem?
v2.2.0
What was the last working version of an integration?
v2.2.0
What vacuum model do you have problems with?
S5 and S7
What version of Home Assistant do you use?
2023.3.6
What type of installation are you running?
Home Assistant Core
Camera’s configuration
camera:
- platform: xiaomi_cloud_map_extractor
name: Roborock S5
host: 192.168.1.30
token: xxx
username: xxx
password: xxx
draw: ['all']
attributes:
- calibration_points
- room_numbers
- rooms
colors:
color_map_inside: [21, 21, 21]
color_map_outside: [28, 28, 28]
color_map_wall: [142, 142, 142]
color_map_wall_v2: [142, 142, 142]
color_grey_wall: [142, 142, 142]
color_ignored_obstacle: [0, 0, 0, 127]
color_ignored_obstacle_with_photo: [0, 0, 0, 127]
color_obstacle: [0, 0, 0, 127]
color_obstacle_with_photo: [0, 0, 0, 127]
color_path: [255, 255, 255]
color_goto_path: [0, 255, 0]
color_predicted_path: [255, 255, 0, 0]
color_cleaned_area: [127, 127, 127, 127]
color_zones: [0, 0, 0, 0]
color_zones_outline: [0xAD, 0xD8, 0xFF]
color_virtual_walls: [255, 0, 0]
color_new_discovered_area: [64, 64, 64]
color_no_go_zones: [255, 33, 55, 127]
color_no_go_zones_outline: [255, 0, 0]
color_no_mop_zones: [163, 130, 211, 127]
color_no_mop_zones_outline: [163, 130, 211]
color_charger: [0x66, 0xfe, 0xda, 0x7f]
color_robo: [75, 235, 149]
color_room_names: [0, 0, 0]
color_unknown: [0, 0, 0]
color_scan: [0xDF, 0xDF, 0xDF]
room_colors:
1: [21, 21, 21]
2: [21, 21, 21]
3: [21, 21, 21]
4: [21, 21, 21]
6: [21, 21, 21]
7: [21, 21, 21]
5: [21, 21, 21]
map_transformation:
rotate: 270
scale: 3
trim:
top: 0
bottom: 0
left: 0
right: 0
- platform: xiaomi_cloud_map_extractor
name: Roborock S7
host: 192.168.1.181
token: xxx
username: xxx
password: xxx
draw: ['all']
attributes:
- calibration_points
- room_numbers
- rooms
colors:
color_map_inside: [21, 21, 21]
color_map_outside: [28, 28, 28]
color_map_wall: [142, 142, 142]
color_map_wall_v2: [142, 142, 142]
color_grey_wall: [142, 142, 142]
color_ignored_obstacle: [0, 0, 0, 127]
color_ignored_obstacle_with_photo: [0, 0, 0, 127]
color_obstacle: [0, 0, 0, 127]
color_obstacle_with_photo: [0, 0, 0, 127]
color_path: [255, 255, 255]
color_goto_path: [0, 255, 0]
color_predicted_path: [255, 255, 0, 0]
color_cleaned_area: [127, 127, 127, 127]
color_zones: [0, 0, 0, 0]
color_zones_outline: [0xAD, 0xD8, 0xFF]
color_virtual_walls: [255, 0, 0]
color_new_discovered_area: [64, 64, 64]
color_no_go_zones: [255, 33, 55, 127]
color_no_go_zones_outline: [255, 0, 0]
color_no_mop_zones: [163, 130, 211, 127]
color_no_mop_zones_outline: [163, 130, 211]
color_charger: [0x66, 0xfe, 0xda, 0x7f]
color_robo: [75, 235, 149]
color_room_names: [0, 0, 0]
color_unknown: [0, 0, 0]
color_scan: [0xDF, 0xDF, 0xDF]
room_colors:
1: [21, 21, 21]
16: [21, 21, 21]
20: [21, 21, 21]
17: [21, 21, 21]
18: [21, 21, 21]
19: [21, 21, 21]
21: [21, 21, 21]
map_transformation:
rotate: 270
scale: 3
trim:
top: 0
bottom: 0
left: 0
right: 0
Errors shown in the HA logs (if applicable)
sadly, none :(
Additional information
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 3
- Comments: 386 (92 by maintainers)
I have created a new blueprint that should handle all possible cases. It is not mentioned in a documentation at this moment, I will add it there later.
You just have to copy and paste the link
Seems my automations I uploaded here were removed ?
So I will place them again as I think this is a better solution than the blueprint to disable the camera completely. One automation will enable or disable the second automation if the roborock is either docker or not. The second automation will update the camera service every 15 seconds.
You will need to set the scan_interval in the configuration.yaml to a high value like 14400 ( 4 hours )
No need to apologize @PiotrMachowski!! Actually it was a stroke of luck for me, since I discovered this entire thread only because you erroneously mentioned me instead of him, at some point!!! I would have never imagined that the HA integration could be responsible for the disappearance of the map, since it was happening also on the xiaomi app so I was convinced it was a problem on the app, I was about to deep reset the robot… LOL I find this so hilarious… sometimes mistakes help!! 🤣🤣
@MathijsG neat idea, I think I’ll add it to the blueprint as well
I have just added it to the update_map_extractor blueprint as well.
I finally got “unbanned” from the servers and I can see the map. I applied Piotr’s blueprint to never update when docked and update 10s when working. I also made a sensor for the status like this:
then I made a sepparate automation to do a final update after arriving at dock (until Piotr has time to update the BP), something like:
so now it refreshes the map one last time after arriving at the dock (5 secs delay after docking) in order to get the “docked” robot on map. Seems to work fine, let’s see how it works in time.
@cosmos1978 one suggestion regarding your automation: at this moment it refreshes the camera every minute, to make it work every 15s you have to use
seconds: "/15"
You have to use this config
Do not modify blueprint, just create an automation using it. https://www.home-assistant.io/docs/automation/using_blueprints/
And it’s back 😦
Since 2 days, the map doesn’t load on the xiaomi app. A restart saturday did the trick, but I lost it again sunday evening, and even a reboot doesn’t bring the map back on xiaomi’s app.
(I used an intermediate system with 2 automations from @PiotrMachowski :
Does anyone has the same issue on xiaomi side ?
Well, this is a quite essential functionality of blueprints 😄
@PiotrMachowski OK. I will do it but in the late evening.
Having the same issue. Now my official Xiaomi home app on my Android phone won’t even load the map anymore.
@MathijsG it must’ve been a coincidence. Map coloring is done completely on the integration side.
You have to hold the power button for a few seconds
Ok, I have rebooted my vacuum and it started to work. Maybe it will work with your vacuums as well.
Not only integration crashes, map won’t load anymore when using this Home Assistant extension on your vacuum.
Xiaomi app just shows “Map Loading” after using this extension, and you must unpair and change device to different region and back to restore map functionality.
Thanks for the tip, in the meantime I think I’ve found a workaround 😄
xiaomi_cloud_map_extractor
increase thescan_interval
inconfiguration.yaml
:scan_interval: 14400
Xiaomi Miio
to https://github.com/al-one/hass-xiaomi-miotand
That would be brilliant!
@Merwenus I have started working on rewriting this integration, but I’m not 100% certain it will work, Xiaomi seems to be quite restrictive
@witooski If you remove debug node and inject node you can condense it even further 😃
@Loeana thx a lot for the invitation and the node red automation! Yesterday, I experimented with it and developed my version, which I have uploaded to your GitHub project. Please have a look if you are interested 😃 In a nutshell, both our approaches are very similar, but yours is much more condensed, which, for me, is a plus.
@witooski Sure, I sent you an invitation to github project. BTW. it worked, after about 24h my ban was lifted and now I can see the map, finally!
@PiotrMachowski would you be so kind and double check if the ‘Turn off when docked’ option really turns of map refreshing? I’ve been using this option within the blueprint automation and every couple of days (can’t say exactly how many) I get the error 'Failed to retrive map from vacuum".
For example, I have set up the automation today again with that exact option selected. Map was working perfectly fine until now, when it became unavailable again 😦
My setup: Home Assistant 2023.7 running in docker container Xiaomi Cloud Map Extractor - v2.2.0 Xiaomi Vacuum Map card - v2.2.2 Update Map Extractor camera Blueprint - the latest available with 5 modes
Please let me know if you need any further information.
Well maybe little longer story than required.
I visited Xiaomi Store in Czechia, to replace protection glass on my phone for free and buy new side brush for my roborock.
I was told that roborock has separated from xiomi and support on official app and also their HomeAssistant integration is not guaranteed.
While i was trying to repair map not showing in xiaomi app, I tried to reset the whole vacuum multiple times (both just wifi reset and factory reset). After few tries it started working again flawlessly in the official xiaomi and also roborock app. But not on HA map. After some serearch in configs i figured out camera token also changed. So i was forced to update the token using python script included on github.
Now its working fine (little bit questionable with too much zoom but thats fine).
Thank you very much the Blueprint, I have configured it, and the map is working good, i don’t get “map error” message two days already. I have configured the blueprint with “Two intervals - automation controls camera updates both when vacuum is cleaning or docked. To use with auto_update: false in camera’s configuration.”
@MrBlank111 Ok, for some reason template trigger wasn’t working. I have rewritten the logic and updated the blueprint again. It should work this time.
@loadamasta try using the blueprint in browser mod mode
@AseKarlsson https://github.com/humbertogontijo/homeassistant-roborock
@eriklysoe in the comments above: https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/issues/422#issuecomment-1545351039
I tried several approaches, the only one that works is to deactivate home assistant integration. Then the map will not disappear in xiaomi home app.
I have s5 and have no other option to integrate it in home assistant, so I just use xiaomi app.
If you have newer versions, I would use the roborock integration, need to delete it then from xiaomi app before adding it to roborock.
Using blueprint with “turn off when docked”, some hours after show map, “failed to retrieve map …” again 😕
Okay… After overnight sleep, I see my map in mihome app. Polling xiaomi server was the issue I think.
Nope - it was pretty much stock from when I initially installed Cloud-Map-Extractor:
@Flightkick I understood what you meant. Think of the Blueprint adding additional features. I didn’t have to change any of my previous Map Extractor config.
You can achieve it using “two intervals” mode, but you have to add
auto_update: false
in camera’s config.Hello, so i did what you sugested, i can confirm this looks like it did it, no more issues.
All i had to do after i added automation from blueprint was to turn of the vacuum and turn on, no server change and it looks like it’s working ever since.
Thanks
Nope
@rospogrigio here’s a template for you (you can use it in a template binary sensor):
You have to enable “Auto-register” in settings of browser mod make it work automatically with all browsers.
Just a tip.
If anybody have problems getting the maps in phone or pad after disabeling in ha, a server switch could hjelp. Mine has been gone for over a week in apps, no reboot or anything helped. I changed the region from Norway to Singapore, and suddenly the maps came back.
@ravensergio you were first, but I was halfway through writing it, so I have posted it anyway 😉
You have to remove the blueprint and install it again (feature request to make blueprints upgradable).
The reason to update camera after the vacuum is docked is to make sure Map Extractor has downloaded the map with completed cleaning.
Doesn’t the Blueprint Piotr posted here do just that? You have 4 variations for refreshing the vacuum as I saw:
Ideally you want to have a last update after having docked, otherwise the map could give the image that the vacuum is still undocked. I might add something manually later.
Broken here as well
Unfortunatelly I haven’t time to make more investigation during the weekend (unexpected 😉 ) and I can see that some solutions are made 😃 Just to enlarge the knowledge I can say that basing on my logs I found out that in my case “reset” is made at 3:20 and block is coming at ca. 18:00 (17:56, 18:01, 18:02 - checked on three following days). I set up scan_interaval to 30s so it makes about 1700-1800 API questions for a day but as it was written here some of You have made bigger intervals and the problem appeared as well so maybe it is kind of more complicated algorithm. I will check new blueprint as well. BTW: similar problem seems to be with Xiaomi cameras. Somebody has found out the solution?
Did that, no luck. I guess I’ll have to be more patient.
@AseKarlsson @witooski you are correct, I have adjusted it (this is what you get when you code at 4AM…)
@oksakoor you have to disable camera’s automatic updates first with
auto_update: false
in its config. Also it might take some time to recover on Xiaomi Cloud.I think I would prefer to keep variable intervals as a blueprint to keep it easy to modify without changing the code.
About other changes, I’d try to merge all pull requests, fix some issues, improve stability, extract map parsing to a dedicated packages. Maybe someday I’ll make a config flow. That is my general plan, but nothing is guaranteed 😉
@AseKarlsson wait until next day.
@cosmos1978 solution seems to do the job. Thank you !
@cosmos1978 they were not removed, you just posted them in a completely different thread.
I will adjust the blueprint to support different scan intervals later today/tomorrow
Wait until the limit is reset (https://blog.axway.com/learning-center/apis/basics/api-rate-limits) it doesn’t have anything to do with the vacuum cleaner locally, everything is related to the Roborock API now enforcing rate limits on their cloud services.
@totow93 I’ve modified slightly the blueprint of @PiotrMachowski to make scan interval of 5s during work and 10m when docked (&others). It seems to work OK. The map is now always visible (earlier with camera_off the map was missing) and during the work the progress is visible as well in real time. No problems for last 30h. Earlier the problem was occurring just in 2-3h. (vacuum time in my device is about 1:40)
@totow93 refreshing only when vacuum is running is already possible (more info here), the harder thing is to update only when the card is visible
I think a reboot is not really useful, as it’s the cloud api connection that rejects us, not something wrong in the vacuum itself.
I moved to 30 with that setting. It seems to work for now, lets see how long it will continue to work.