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 - when user has more than one home #536

Open
2 tasks done
osieckiAdam opened this issue Jun 20, 2024 · 1 comment
Open
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@osieckiAdam
Copy link

Checklist

  • I have updated the integration to the latest version available
  • I have checked if the problem is already reported

The problem

When there is more than one home assigned to user, map could not be retrieved.
Token extractor works fine for me, so I was sure that token and the IP are correct.

I debugged the code a little bit, and here's what I discovered:

xiaomi_cloud_connector is always checking only first home in each country when looking for devices (see line 140). If the device that we are looking for is not assigned to our first home then devices are empty, so eventually in camera.py method update we end up with else branch in line 279 (self._device is not None == false)

This part can be easily fixed by using the same code from Token Extractor (https://github.com/PiotrMachowski/Xiaomi-cloud-tokens-extractor/blob/master/token_extractor.py - starting from line 275) which fixes part of the problem - if token is correct, then we get our device, no matter to which home it is assigned to, however there is still some bug, because later, map name could not be retrieved - it is set to retry after 10 retries

What version of an integration has described problem?

v2.2.1

What was the last working version of an integration?

No response

What vacuum model do you have problems with?

roborock.vacuum.s5

What version of Home Assistant do you use?

core-2024.6.3

What type of installation are you running?

Home Assistant OS

Camera's configuration

camera:
  - platform: xiaomi_cloud_map_extractor
    country: de
    host: !secret host
    token: !secret token
    username: !secret username
    password: !secret pass
    draw: ["all"]
    attributes:
      - calibration_points

Errors shown in the HA logs (if applicable)

No response

Additional information

No response

@osieckiAdam osieckiAdam added the bug Something isn't working label Jun 20, 2024
@kineticscreen
Copy link

I've also got the S5, and have this problem sporadically, however I only have one home setup with my Xiaomi account...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants