Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to retrieve map from vacuum #422

Closed
2 tasks done
kimme1024 opened this issue Apr 7, 2023 · 386 comments
Closed
2 tasks done

Failed to retrieve map from vacuum #422

kimme1024 opened this issue Apr 7, 2023 · 386 comments
Assignees
Labels
bug Something isn't working

Comments

@kimme1024
Copy link

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

@kimme1024 kimme1024 added the bug Something isn't working label Apr 7, 2023
@PiotrMachowski
Copy link
Owner

Does the map work in Xiaomi Home?

@kimme1024
Copy link
Author

Does the map work in Xiaomi Home?

Hmm, indeed, no... Didn't check it as I assumed it would be HA-related... Any idea how that might happen? (and how to fix it)

@PiotrMachowski
Copy link
Owner

I have the same problem, I have no idea what happened. It might be a problem on the Xiaomi Cloud side - vacuum doesn't return map id because it can't upload it to the cloud. I hope it's not a ban...

Do your vacuums have the latest firmware versions? Has any new update become available in the last days?

@kimme1024
Copy link
Author

kimme1024 commented Apr 7, 2023

The S5 hasn't been updated in a while as it's the one upstairs that doesn't get used that much.
The S7 should be on the latest firmware but that update has been done about a month ago. For the S7 I can't even click the 3 dots for more info so I can't check for updates...

edit
The S5 is on the latest firmware

@PiotrMachowski
Copy link
Owner

Ok, I have rebooted my vacuum and it started to work. Maybe it will work with your vacuums as well.

@kimme1024
Copy link
Author

kimme1024 commented Apr 7, 2023

Ok, I have rebooted my vacuum and it started to work. Maybe it will work with your vacuums as well.

Thanks! I'll try it with the one downstairs, and tomorrow with the other one.

edit
any idea on how to reboot it without doing a factory reset?

@PiotrMachowski
Copy link
Owner

any idea on how to reboot it without doing a factory reset?

You have to hold the power button for a few seconds

@kimme1024
Copy link
Author

any idea on how to reboot it without doing a factory reset?

You have to hold the power button for a few seconds

Great! It worked for the S7. I'll try the S5 tomorrow. I assume it'll work as well...
Thanks for the support!

@MathijsG
Copy link

MathijsG commented Apr 9, 2023

I seem to have the same problem periodically as well. It seemed to start when i customized the whole image with different colors. Don't know if these modifications are done after the retrieval from Xiaomi, or before. When it's not working i don't see an image of my room in the Xiaomi app as well.

It will try to load the map indefinitely in the Xiaomi app.

After several days or something sometimes it is working all of a sudden again. Will investigate if this still breaks occasionally without all the custom color things.

@PiotrMachowski
Copy link
Owner

@MathijsG it must've been a coincidence. Map coloring is done completely on the integration side.

@MathijsG
Copy link

MathijsG commented Apr 9, 2023

By the way Roborock S50 / S5 Non-max edition

All the other cloud features still work, can even start it, etc, just without visuals.

@kimme1024
Copy link
Author

Weird over here. Restart fixed the s7 on Friday but when I checked again on Saturday, the s5 was available and the s7 wasn’t.
Today both are unavailable again.

@PiotrMachowski PiotrMachowski closed this as not planned Won't fix, can't repro, duplicate, stale Apr 9, 2023
@PiotrMachowski
Copy link
Owner

I have closed this issue because it doesn't seem to be connected to the code of the integration itself. You might try to increase scan_interval and check if it helps

@MechanicKitten
Copy link

Also noticed this over the last few days, rebooting the vacuum hasn't helped. I did notice that the map would randomly come back and then disappear into a broken state again. Both in Home Assistant and the Xiaomi Home app. Certainly seems like something on their side

@klu16
Copy link

klu16 commented Apr 10, 2023

Just here to report that I am experiencing issues since a few days too. But it looks like there could be something wrong on the Xiaomi (cloud) side. Yesterday I had "Failed to retrieve a map", on the other hand today I see "Failed to login" message on the lovelace. Also randomly I see it works fine.

@sergicm
Copy link

sergicm commented Apr 10, 2023

The same thing has been happening to me for about a week, I don't know if this log has anything to do with it:

2023-04-10 02:44:35.912 DEBUG (SyncWorker_5) [custom_components.xiaomi_cloud_map_extractor.camera] Retrieving map name from device
2023-04-10 02:44:36.036 DEBUG (SyncWorker_5) [custom_components.xiaomi_cloud_map_extractor.camera] Map name retry
2023-04-10 02:44:36.036 DEBUG (SyncWorker_5) [custom_components.xiaomi_cloud_map_extractor.camera] Unable to retrieve map, reasons: Logged in - True, map name - retry, device retrieved - True

@MathijsG
Copy link

Just here to report that I am experiencing issues since a few days too. But it looks like there could be something wrong on the Xiaomi (cloud) side. Yesterday I had "Failed to retrieve a map", on the other hand today I see "Failed to login" message on the lovelace. Also randomly I see it works fine.

Having the same, also seeing Failed to login now, instead of the earlier error.

@klu16
Copy link

klu16 commented Apr 10, 2023

Having the same, also seeing Failed to login now, instead of the earlier error.

Now I also see "Two factor auth required (see logs)" message...

@MathijsG
Copy link

Yeah me too. I relogged in (in the logs you see the link you need to open), and now the map works again. Hope it will stay that way.

@bgoncal
Copy link

bgoncal commented Apr 10, 2023

Rebooting the robot worked but today it happened again

@MathijsG
Copy link

Same here. What I find interesting is that my neighbour with the exact same S50 has zero problems, and another friend with his S7 no problems as well. So somehow I think this still is related to having this integration. Maybe we flooded the API?

@PiotrMachowski
Copy link
Owner

@MathijsG yeah, that's something I'm afraid of. You can try to reduce polling intensity by adding following config:

scan_interval: 30

@sergicm
Copy link

sergicm commented Apr 11, 2023

Today for me it's working again normally...

@meepmeep
Copy link

moved to :
scan_interval: 60

Reboot worked yesterday, but map is once again unavaible this morning.
New reboot and still nothing :(

@MathijsG
Copy link

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.

@totow93
Copy link

totow93 commented Apr 12, 2023

ok i will test if scan_interval: 30 helps

@MathijsG
Copy link

Well, 60 of course would be better as it is even less often relying on the API.

@PiotrMachowski
Copy link
Owner

@Knellius

I use the Roborock app instead, is it important?

Yes. This integration doesn't work with Roborock app. Use https://github.com/humbertogontijo/homeassistant-roborock

@Bkk20
Copy link

Bkk20 commented Oct 27, 2023

Remove the integration, wait a few days until the map shows up in Xiaomi Home, add the integration again (with auto_update: false and a blueprint to update it).

I removed the integration. Hopefully, the map comes back in MiApp. What do you mean with "blueprint to update it"? And where can I set auto-update: false? In configurations.yaml? Where should I integrate it. Just at the end?
Thanks!

@Knellius
Copy link

@PiotrMachowski

This integration doesn't work with Roborock app.

Oh my. I should read documentation more thoroughly. Thank you!

@Bkk20
Copy link

Bkk20 commented Oct 28, 2023

I was able to install MapExtractor again and I add the code in configuration file

camera:
  - platform: xiaomi_cloud_map_extractor
    host: XXXXX
    token: XXXXX
    username: XXXXX
    password: XXXX
    draw: ["all"]
    attributes:
      - calibration_points

Then I integrated Blueprint and this is saved under: /config/blueprints/automation/PiotrMachowski/disable_vacuum_camera_update_when_docked.yaml

asd

Please can someone tell what I have to change here manually that scan interval auto update is correct that I not get the map error again? In the code I also get the error by
domain:
- vacuum String does not match the pattern of "DEPRECATED"

I am not an real expert. So maybe someone can help me.
Thanks!

@PiotrMachowski
Copy link
Owner

You have to use this config

camera:
  - platform: xiaomi_cloud_map_extractor
    host: XXXXX
    token: XXXXX
    username: XXXXX
    password: XXXX
    draw: ["all"]
    attributes:
      - calibration_points
    auto_update: false

Do not modify blueprint, just create an automation using it.
https://www.home-assistant.io/docs/automation/using_blueprints/

@dimed89
Copy link

dimed89 commented Oct 28, 2023

@PiotrMachowski same thing, I import the blueprint, I modify my configuration yaml for add auto update false and I have the " failed to retrieve device " message on my dashboard...

My map appear on mi home app

@Bkk20
Copy link

Bkk20 commented Oct 29, 2023

@PiotrMachowski same thing, I import the blueprint, I modify my configuration yaml for add auto update false and I have the " failed to retrieve device " message on my dashboard...

My map appear on mi home app

@PiotrMachowski Same for me. I did the same steps like you. The map info is "failed to retrieve device".
The control (start, pause etc.) is working.
Just for your info. The Vacuum Card ask for Vacuum platform. I set it to KrzysztofHajdamowicz/miio2.

@dimed89
Copy link

dimed89 commented Oct 30, 2023

Same, the control work but not the map

@Bkk20
Copy link

Bkk20 commented Oct 31, 2023

Are we the only one with this problem?

@Bkk20
Copy link

Bkk20 commented Nov 2, 2023

Same, the control work but not the map

Did you find any solution?

@Disincentivato
Copy link

Hi, I still have this issue, any solution?

@MonolithNZ
Copy link

MonolithNZ commented Nov 3, 2023

@Loeana Can you please invite me to your node-red project? Would love to check it out! Thanks

@Skylinar
Copy link

I'm having as well issues with the vacuum map on the xiaomi app and on HA. I've applied @PiotrMachowski's blueprint / automation suggestions and will report back if it gets working again.

@Bkk20
Copy link

Bkk20 commented Nov 14, 2023

Would be great when @PiotrMachowski has some time to check it.
Should we maybe activate auto_update? Maybe because auto_update: false it cant be retrieved?

2023-11-14 21:37:43.149 WARNING (SyncWorker_5) [custom_components.xiaomi_cloud_map_extractor.camera] Got exception while fetching the state: No response from the device
2023-11-14 21:38:03.299 ERROR (SyncWorker_5) [miio.miioprotocol] Got error when receiving: timed out
2023-11-14 21:38:23.447 ERROR (SyncWorker_5) [miio.miioprotocol] Got error when receiving: timed out
2023-11-14 21:38:43.592 ERROR (SyncWorker_5) [miio.miioprotocol] Got error when receiving: timed out
2023-11-14 21:39:03.734 ERROR (SyncWorker_5) [miio.miioprotocol] Got error when receiving: timed out
2023-11-14 21:39:23.880 ERROR (SyncWorker_5) [miio.miioprotocol] Got error when receiving: timed out
2023-11-14 21:39:44.030 ERROR (SyncWorker_5) [miio.miioprotocol] Got error when receiving: timed out
2023-11-14 21:40:06.267 ERROR (SyncWorker_5) [miio.miioprotocol] Got error when receiving: timed out
2023-11-14 21:40:26.408 ERROR (SyncWorker_5) [miio.miioprotocol] Got error when receiving: timed out
2023-11-14 21:40:46.550 ERROR (SyncWorker_5) [miio.miioprotocol] Got error when receiving: timed out

@foxm2k
Copy link

foxm2k commented Nov 23, 2023

Still being worked on?

@PiotrMachowski
Copy link
Owner

@BeardElk that's not related to this discussion. Your card configuration doesn't match your vacuum integration.

@BeardElk
Copy link

@BeardElk that's not related to this discussion. Your card configuration doesn't match your vacuum integration.

Sorry!

@Skylinar
Copy link

I'm having as well issues with the vacuum map on the xiaomi app and on HA. I've applied @PiotrMachowski's blueprint / automation suggestions and will report back if it gets working again.

So I added the suggestionst that @PiotrMachowski made, the map came back on the iOS app but in HA there is no map anymore.

@schmjop
Copy link

schmjop commented Nov 29, 2023

You have to use this config

camera:
  - platform: xiaomi_cloud_map_extractor
    host: XXXXX
    token: XXXXX
    username: XXXXX
    password: XXXX
    draw: ["all"]
    attributes:
      - calibration_points
    auto_update: false

Do not modify blueprint, just create an automation using it. https://www.home-assistant.io/docs/automation/using_blueprints/

This works great. Thanks a lot for the fix/workaround @PiotrMachowski

@Bkk20
Copy link

Bkk20 commented Dec 1, 2023

It works. I got another Token as before. Maybe it helps someone else.

@mariovw
Copy link

mariovw commented Jan 11, 2024

You have to use this config

camera:
  - platform: xiaomi_cloud_map_extractor
    host: XXXXX
    token: XXXXX
    username: XXXXX
    password: XXXX
    draw: ["all"]
    attributes:
      - calibration_points
    auto_update: false

Do not modify blueprint, just create an automation using it. https://www.home-assistant.io/docs/automation/using_blueprints/

Hi @PiotrMachowski,

this solution by the moment works fine. The only issue is that when the vacuum is cleaning it do not update the map. Just only when is docked.
I think it would be great in the automation to set the "auto_update" to true while cleaning and set back to false when the vacuum is docked again. Is it possible to change it?

Many thanks!

UPDATE: after first docking it fails again.... I tryed another option of the blueprint and it seems the same... after first docking doesn't work any more

@mariovw
Copy link

mariovw commented Jan 11, 2024

Hi @PiotrMachowski,

I was doing some tests with map update... The point is the following:

I delete the integration and set up again. In my camera configuration I set up " scan_interval: 900" in order to not overload the Xiaomi API. I do not set any blueprint.

When I load everything it seems everything works correctly. I turn on the vacuum and the map is updated correctly. BUT when the vacuum is docked it seems something start go wrong... Right now, when I load the card I figured it out that the first thing I can see is the following picture

image

This screenshot is presented during less than a second. Afterwords it loads the map again but the map it's not updated (I guess it's loaded from cached map). So, the map is not updated

Finaly, if I reboot HA, the map update doesn't work anymore. In the same way before, it appears the "disconnected" screenshot before for less than 1sec and afterwords the following image (I understand the cached map is not available anymore)

image

So, I said before in my last comment, it seems that when the vacuum is docked the first time the integration crashes somewhere and stop working

Hope this helps!
Mario

@mirkokg
Copy link

mirkokg commented Jan 14, 2024

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.

@vajnorcan
Copy link

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.

is this now seriously an only option?

  • Did anyone try contacting the Xiaomi support (I did just a while ago)
  • Did anyone try to turn the map feature off / on and let the robot re-learn it?

Thanks

@PiotrMachowski
Copy link
Owner

My current suggestion is to use this blueprint in "two intervals mode" and auto_update: false in config. Interval used when docked should be quite big (a few hours)

My suggestion is still the same, but it is buried deep in this thread. In the meantime I am working on a rewritten version of the integration, but I don't have as much free time as I used to.

Did anyone try contacting the Xiaomi support (I did just a while ago)

They will just tell you to remove vacuum from HA

@mirkokg
Copy link

mirkokg commented Mar 6, 2024

My current suggestion is to use this blueprint in "two intervals mode" and auto_update: false in config. Interval used when docked should be quite big (a few hours)

My suggestion is still the same, but it is buried deep in this thread. In the meantime I am working on a rewritten version of the integration, but I don't have as much free time as I used to.

Did anyone try contacting the Xiaomi support (I did just a while ago)

They will just tell you to remove vacuum from HA

Unfortunately I think that I got blocked even while using the blueprint. And that happened quickly even while not docked. 👎

@PiotrMachowski
Copy link
Owner

You have to add auto_update: false to your config and restart HA.

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
    draw: ['all']
    attributes:
      - calibration_points

Then you can use the blueprint in "two intervals mode" with "docked" interval set to a few hours. It should be fixed after 2-3 days after this change. You can also reboot the vacuum to help it recover.

I will now lock this conversation to prevent my comment from disappearing again.

Repository owner locked as too heated and limited conversation to collaborators Mar 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests