Custom Component: Dreame Vacuum

I tried both way. This one is local.

I also tried reinstalling the repository: I tried to login through my Xiaomi account using my username and password but it said “unable to connect” (in local and using cloud) Then I tried to connect without map integration using as “host” the IP of the vacuum and the token that I extract using token extractor. Even with this, it said “unable to connect”.

I’m still unable to get my L10S Ultra to be found. I have downloaded the latest beta version and im using the Dreame Home login. The model number is R2228B.

hi @tasshack, it seems that newest FW for x40 ultra complete breaks compatibility with repo :frowning:

FW 4.3.9_1673

unable to create room config in vacuum card.

when selecting Clean Genius via node-red - settings aren’t changed (selected) for clean genius at all (deep clean mode)

can’t send vacuum to individual room for cleaning :confused:

tried to raise GH issue but seems that you have limited who can raise one.

thank you

It seems I can’t add my new Xiaomi X20+ to HASS with this integration, it doesn’t find any devices under my Xiaomi cloud account. I’m using the latest beta, and I tried with automatic and manual and with or without the “Prefer cloud connection” checkbox.

I managed to add it with the Xiaomi Miot Auto integration, but functionality is limited.

Does anyone have any pointers they could give me? I’d be very grateful. Thanks.

Logger: homeassistant
Source: custom_components/dreame_vacuum/dreame/device.py:7034
integration: Dreame Vacuum (documentation, issues)
First occurred: 9:19:18 PM (10 occurrences)
Last logged: 9:25:22 PM

Error doing job: Exception in callback DreameVacuumDataUpdateCoordinator.async_set_updated_data() (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run
    self._context.run(self._callback, *self._args)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dreame_vacuum/coordinator.py", line 493, in async_set_updated_data
    super().async_set_updated_data(self._device)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 514, in async_set_updated_data
    self.async_update_listeners()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 177, in async_update_listeners
    update_callback()
    ~~~~~~~~~~~~~~~^^
  File "/config/custom_components/dreame_vacuum/entity.py", line 151, in _handle_coordinator_update
    self.async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in async_write_ha_state
    self._async_write_ha_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1148, in _async_write_ha_state
    self.__async_calculate_state()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1089, in __async_calculate_state
    if extra_state_attributes := self.extra_state_attributes:
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dreame_vacuum/entity.py", line 211, in extra_state_attributes
    attrs = self.entity_description.attrs_fn(self.device)
  File "/config/custom_components/dreame_vacuum/sensor.py", line 383, in <lambda>
    attrs_fn=lambda device: device.status.cleaning_history,
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dreame_vacuum/dreame/device.py", line 7034, in cleaning_history
    k: v.name.replace("_", " ").capitalize() for k, v in history.neglected_segments.items()
                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'items'
Logger: custom_components.dreame_vacuum.dreame.protocol
Source: custom_components/dreame_vacuum/dreame/protocol.py:567
integration: Dreame Vacuum (documentation, issues)
First occurred: 9:19:00 PM (1 occurrences)
Last logged: 9:19:00 PM

Error while executing request: Read timed out. (read timeout=3): {"did":"790245872","id":70,"data":{"did":"790245872","id":70,"method":"get_properties","params":[{"did":"0","siid":2,"piid":1},{"did":"1","siid":2,"piid":2},{"did":"2","siid":3,"piid":1},{"did":"3","siid":3,"piid":2},{"did":"4","siid":3,"piid":3},{"did":"5","siid":4,"piid":1},{"did":"6","siid":4,"piid":2},{"did":"7","siid":4,"piid":3},{"did":"8","siid":4,"piid":4},{"did":"9","siid":4,"piid":5},{"did":"10","siid":4,"piid":6},{"did":"11","siid":4,"piid":7},{"did":"15","siid":4,"piid":11},{"did":"16","siid":4,"piid":12},{"did":"18","siid":4,"piid":14}]}}

@tasshack - added some error I am getting with integration.

thank you for your work!

Same issue here, some sensor works, switches don’t.

Since today, after a update to

  • Core2025.1.0
  • Supervisor2024.12.3
  • Operating System14.1
  • Frontend20250103.0

i became two errors by starting HA:

Logger: homeassistant.loader
Quelle: loader.py:1075
Erstmals aufgetreten: 18:30:16 (8 Vorkommnisse)
Zuletzt protokolliert: 18:36:50

Unexpected exception importing component custom_components.dreame_vacuum
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1075, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/dreame_vacuum/__init__.py", line 11, in <module>
    from .coordinator import DreameVacuumDataUpdateCoordinator
  File "/config/custom_components/dreame_vacuum/coordinator.py", line 22, in <module>
    from .dreame import DreameVacuumDevice, DreameVacuumProperty
  File "/config/custom_components/dreame_vacuum/dreame/__init__.py", line 55, in <module>
    from .device import DreameVacuumDevice
  File "/config/custom_components/dreame_vacuum/dreame/device.py", line 216, in <module>
    from .map import DreameMapVacuumMapManager, DreameVacuumMapDecoder
  File "/config/custom_components/dreame_vacuum/dreame/map.py", line 16, in <module>
    from py_mini_racer import MiniRacer
  File "/usr/local/lib/python3.13/site-packages/py_mini_racer/__init__.py", line 1, in <module>
    from . import py_mini_racer
  File "/usr/local/lib/python3.13/site-packages/py_mini_racer/py_mini_racer.py", line 13, in <module>
    import pkg_resources
SyntaxError: source code string cannot contain null bytes

and

Logger: homeassistant.loader
Quelle: loader.py:1272
Erstmals aufgetreten: 18:31:18 (10 Vorkommnisse)
Zuletzt protokolliert: 18:36:49

Unexpected exception importing platform custom_components.dreame_vacuum.config_flow
Unexpected exception importing platform custom_components.dreame_vacuum.application_credentials
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1272, in _load_platform
    cache[full_name] = self._import_platform(platform_name)
                       ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1304, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/dreame_vacuum/__init__.py", line 11, in <module>
    from .coordinator import DreameVacuumDataUpdateCoordinator
  File "/config/custom_components/dreame_vacuum/coordinator.py", line 22, in <module>
    from .dreame import DreameVacuumDevice, DreameVacuumProperty
  File "/config/custom_components/dreame_vacuum/dreame/__init__.py", line 55, in <module>
    from .device import DreameVacuumDevice
  File "/config/custom_components/dreame_vacuum/dreame/device.py", line 216, in <module>
    from .map import DreameMapVacuumMapManager, DreameVacuumMapDecoder
  File "/config/custom_components/dreame_vacuum/dreame/map.py", line 16, in <module>
    from py_mini_racer import MiniRacer
  File "/usr/local/lib/python3.13/site-packages/py_mini_racer/__init__.py", line 1, in <module>
    from . import py_mini_racer
  File "/usr/local/lib/python3.13/site-packages/py_mini_racer/py_mini_racer.py", line 13, in <module>
    import pkg_resources
SyntaxError: source code string cannot contain null bytes

has anyone a idea how can i fix it? I have try delete the dreame folder, the pycache files… but nothin helps.

Thank you,

Hi There, the new Dreame X40 is also not supported by this integration, or?

Got x40 ultra complete and something broke recently… I suspect dreame fw update broke the addon…

  • Core2025.1.1 fixed my Problem.

Hi,

How did you manage to get past the MFA part? seems to error for me because it needs additional security features.

Also seems my x20+ isnt showing in my devices on the Xiaomi cloud account.

Any help would be greatly appreciated.

I have one issue with the camera entity generated by the integration.
For several times it is unavailable. Only if I open it as an entity or send the robot vacuum via the Mi app, it’s refreshed and set available. Can you think of why?

is the Dreame x50 ultra support?

hm, ok, so looks like you are the only one so far who got the x40 running…

It was running, now it’s in limp mode.

Hit and miss.

Hello, is the Polish server available? pl

Hello

I’m struggling a little bit with my first robot, L10s ultra gen2.
I did all the manip like the ultra-classic L10s. the mid-home app offers me to reset my robot from it searches.

The Dream Vacuum and the r2469 will find in my router.

If someone has ever been manticating this model, you can tell me the steps. Thank you.

Bonjour

Je galère un peu avec mon premier robot Dreame, L10s ultra gen2.
J’ai fait toute les manip comme pour le L10s ultra classique. l’application mi home me propose de réinitialiser mon robot depuis il cherche.

Le Dreame vacuum et le r2469a trouver sur mon routeur.

Si quelqu’un a déjà fait la manip pour ce modèle, Pouvez vous m’indiquer les étapes. merci.

Problem solved

After the deletion of the Deream account and recreate it identically

Problème résolu

Après la suppression du compte Dreame et de l’avoir recrée à l’identique

1 Like

First thanks for the integration!
I’m able to get my X40 Ultra to vacuum without any issues.
I’ve seen this posted a couple times in the thread without an answer, so I thought I’d try again.
I’m not able to get the vacuum to mop.
I’ve tried several different actions with varying data, but nothing seems to work.
Can someone share their settings or insights on how your able to get your vacuum to mop?
Not sure what else to try at this point other then ask for help.
Any information would be greatly appreciated.

My Home Assistant is crashing and hanging when I run the vacuum. It will keep doing this until the vacuum is back on the base station, which is when it will return to normal.

I have the v2.0.0b16 beta version installed
My vacuum model is Xiaomi X20+
With low resolution map enabled, HA doesn’t crash as much, but hangs on page load, especially the one with the Xiaomi map card on.
I have a Home Assistant Green.

With logger enabled I get the same warning sporadically.

2025-01-13 19:07:16.552 INFO (Thread-1071) [custom_components.dreame_vacuum.dreame.map] Decode P map 6 122
2025-01-13 19:07:18.242 INFO (MainThread) [custom_components.dreame_vacuum.dreame.map] Render frame: 6:120 took: 6.16
2025-01-13 19:07:19.179 INFO (Thread-1074) [custom_components.dreame_vacuum.dreame.map] Decode P map 6 123
2025-01-13 19:07:21.692 INFO (Thread-1078) [custom_components.dreame_vacuum.dreame.map] Decode P map 6 124
2025-01-13 19:07:24.817 INFO (MainThread) [custom_components.dreame_vacuum.dreame.map] Render frame: 6:122 took: 6.18
2025-01-13 19:07:25.554 INFO (Thread-1085) [custom_components.dreame_vacuum.dreame.map] Decode P map 6 125
2025-01-13 19:07:28.086 INFO (Thread-1088) [custom_components.dreame_vacuum.dreame.map] Decode P map 6 126
2025-01-13 19:07:31.256 INFO (MainThread) [custom_components.dreame_vacuum.dreame.map] Render frame: 6:124 took: 6.07
2025-01-13 19:07:32.111 INFO (Thread-1092) [custom_components.dreame_vacuum.dreame.map] Decode P map 6 127
2025-01-13 19:07:34.665 INFO (Thread-1095) [custom_components.dreame_vacuum.dreame.map] Decode P map 6 128
2025-01-13 19:07:37.284 INFO (Thread-1098) [custom_components.dreame_vacuum.dreame.map] Decode P map 6 129
2025-01-13 19:07:38.066 INFO (MainThread) [custom_components.dreame_vacuum.dreame.map] Render frame: 6:126 took: 6.38
2025-01-13 19:07:39.801 WARNING (Thread-1102) [py.warnings] /config/custom_components/dreame_vacuum/dreame/map.py:3826: RuntimeWarning: overflow encountered in scalar add
2025-01-13 19:07:39.802 INFO (Thread-1102) [custom_components.dreame_vacuum.dreame.map] Decode P map 6 130
2025-01-13 19:07:43.629 INFO (Thread-1109) [custom_components.dreame_vacuum.dreame.map] Decode P map 6 131
2025-01-13 19:07:44.609 INFO (MainThread) [custom_components.dreame_vacuum.dreame.map] Render frame: 6:129 took: 6.09
2025-01-13 19:07:46.270 INFO (Thread-1111) [custom_components.dreame_vacuum.dreame.map] Decode P map 6 132

Expanded warning:

/config/custom_components/dreame_vacuum/dreame/map.py:3826: RuntimeWarning: overflow encountered in scalar add data[new_index] = data[new_index] + map_data.data[current_index]

Thanks, Matt