Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor icon indicating copy to clipboard operation
Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor copied to clipboard

Support for Xiaomi Vacuum X20 Pro

Open Koceto opened this issue 11 months ago • 16 comments

Checklist

  • [X] I have updated the integration to the latest version available
  • [X] I have checked if the vacuum/platform is already requested
  • [ ] I have sent raw map file to piotr.machowski.dev [at] gmail.com (Retrieving map; please provide your GitHub username in the email)

What vacuum model do you want to be supported?

xiaomi.vacuum.d102gl

What is its name?

Xiaomi Vacuum X20 Pro

Available APIs

  • [ ] xiaomi
  • [ ] viomi
  • [ ] roidmi
  • [ ] dreame

Errors shown in the HA logs (if applicable)

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 960, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1320, in async_device_update await hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/xiaomi_cloud_map_extractor/camera.py", line 279, in update self._handle_device() ~~~~~~~~~~~~~~~~~~~^^ File "/config/custom_components/xiaomi_cloud_map_extractor/camera.py", line 315, in _handle_device country, user_id, device_id, model = self._connector.get_device_details(self._vacuum.token, self._country) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/xiaomi_cloud_map_extractor/common/xiaomi_cloud_connector.py", line 217, in get_device_details if match := next(matching_token, None): ~~~~^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/xiaomi_cloud_map_extractor/common/xiaomi_cloud_connector.py", line 208, in get_devices_iter for home in homes: ^^^^^ File "/config/custom_components/xiaomi_cloud_map_extractor/common/xiaomi_cloud_connector.py", line 169, in get_homes_iter if homelist := response["result"]["share_home_list"]: ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ KeyError: 'share_home_list'

Other info

No response

Koceto avatar Jan 03 '25 08:01 Koceto

Duplicate of #580

PiotrMachowski avatar Jan 03 '25 10:01 PiotrMachowski

@PiotrMachowski, I believe it's not a duplicate, as with the latest version 2.2.3, the map is not showing. I found the following message: Found an unsupported model 'xiaomi.vacuum.d102gl' for class 'RoborockVacuum'.

Koceto avatar Jan 03 '25 17:01 Koceto

The error you have attached was a duplicate of linked issue. Was it working before?

PiotrMachowski avatar Jan 03 '25 17:01 PiotrMachowski

No, it hasn't worked at any point. I'm sorry for misleading you with the error.

Koceto avatar Jan 03 '25 18:01 Koceto

Can you try checking if any option for force_api works?

PiotrMachowski avatar Jan 03 '25 18:01 PiotrMachowski

I did test that. And re-tested again, just now, with the latest version. With a restart in between.

Not sure if it's related, but I do see an error in the logs.

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 960, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1320, in async_device_update
    await hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/xiaomi_cloud_map_extractor/camera.py", line 291, in update
    self._handle_map_data(self._map_name)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_cloud_map_extractor/camera.py", line 362, in _handle_map_data
    map_data, map_stored = self._device.get_map(map_name, self._colors, self._drawables, self._texts,
                           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                self._sizes, self._image_config, store_map_path)
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/xiaomi_cloud_map_extractor/common/vacuum.py", line 27, in get_map
    response = self.get_raw_map_data(map_name)
  File "/config/custom_components/xiaomi_cloud_map_extractor/common/vacuum.py", line 45, in get_raw_map_data
    map_url = self.get_map_url(map_name)
  File "/config/custom_components/xiaomi_cloud_map_extractor/common/vacuum_v2.py", line 18, in get_map_url
    if api_response is None or "result" not in api_response or "url" not in api_response["result"]:
                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable

Koceto avatar Jan 03 '25 18:01 Koceto

I debugged the API and it got response "{'code': -6, 'message': 'invalid config for fds', 'result': None}".

icez avatar Jan 19 '25 16:01 icez

any news on xiaomi.vacuum.d102gl support?

anar4732 avatar Jul 11 '25 03:07 anar4732

Same issue, any news for support on xiaomi.vacuum.d102gl?

denispelo avatar Oct 23 '25 14:10 denispelo

All the info about progress would be here.

At this moment you can download the latest alpha version and send me diagnostic data from it

PiotrMachowski avatar Oct 23 '25 14:10 PiotrMachowski

Diagnostic with last alpha release: config_entry-xiaomi_cloud_map_extractor-01K88NCE0EJKCB6TD10TSDFE3N.json

Now creation of entities works, but don't get any usefull information.

denispelo avatar Oct 23 '25 15:10 denispelo

Now creation of entities works, but don't get any usefull information.

But I do, inside diagnostic data 😉

PiotrMachowski avatar Oct 23 '25 22:10 PiotrMachowski

Ok, but what I see are all sensors set to 0 and a cam with no supported map:

Image

Here for sensors:

Image

Thanks

denispelo avatar Oct 24 '25 07:10 denispelo

@denispelo yes, because map data was not decoded for your vacuum model - it needs to be reverse engineered and implemented. Diagnostic data contains raw map file downloaded from Xiaomi Cloud, so it can be analyzed and worked on.

PiotrMachowski avatar Oct 24 '25 09:10 PiotrMachowski

@denispelo yes, because map data was not decoded for your vacuum model - it needs to be reverse engineered and implemented. Diagnostic data contains raw map file downloaded from Xiaomi Cloud, so it can be analyzed and worked on.

Ok thanks, if you give me some info or guide or something similar, I try to make reverse engineering on it.

denispelo avatar Oct 24 '25 09:10 denispelo

The data that needs to be decoded is available in diagnostic data JSON under the following path: .data.device_data.map_data_raw (it is base64-encoded)

You can use this tool to start

PiotrMachowski avatar Oct 24 '25 09:10 PiotrMachowski