Tasshack / dreame-vacuum

Home Assistant integration for Dreame robot vacuums with map support
https://community.home-assistant.io/t/custom-component-dreame-vacuum
MIT License
775 stars 93 forks source link

Dreame x20 pro plus sometimes disconnects and spam errors #234

Closed zipkiev closed 11 months ago

zipkiev commented 11 months ago

Describe the bug My robot not in list, but maybe this bugs help to improve something. So I have Dreame x20 pro plus, and it sometimes it disconnects from HA and then reconnects. Also, there are some errors in HA log.

To Reproduce Don't know how((, just sometimes unavailable (but it ping and responds from windows "cmd").

Expected behavior No errors spam in log, no disconnects

Haw to recover When I get disconnects earlier I open Dreame app, and it will have available again after 15+- min

Screenshots image image

Additional Information (please complete the following information)

This error originated from a custom integration.

Logger: custom_components.dreame_vacuum.dreame.protocol Source: custom_components/dreame_vacuum/dreame/protocol.py:281 Integration: Dreame Vacuum (documentation, issues) First occurred: 20:57:15 (55 occurrences) Last logged: 22:14:05 Login Failed: Read timed out. (read timeout=3)

This error originated from a custom integration. Logger: custom_components.dreame_vacuum Source: custom_components/dreame_vacuum/coordinator.py:476 Integration: Dreame Vacuum (documentation, issues) First occurred: 20:57:15 (63 occurrences) Last logged: 22:14:05 Integration start failed: Traceback (most recent call last): File "/config/custom_components/dreame_vacuum/coordinator.py", line 471, in _async_update_data await self.hass.async_add_executor_job(self._device.update) File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, *self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/dreame_vacuum/dreame/device.py", line 1993, in update raise DeviceUpdateFailedException("Device cannot be reached") from None custom_components.dreame_vacuum.dreame.exceptions.DeviceUpdateFailedException: Device cannot be reached Integration start failed: Traceback (most recent call last): File "/config/custom_components/dreame_vacuum/coordinator.py", line 471, in _async_update_data await self.hass.async_add_executor_job(self._device.update) File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/dreame_vacuum/dreame/device.py", line 1990, in update self.connect_device() File "/config/custom_components/dreame_vacuum/dreame/device.py", line 1518, in connect_device self._request_properties() File "/config/custom_components/dreame_vacuum/dreame/device.py", line 459, in _request_properties result = self._protocol.get_properties(props[:15]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/dreame_vacuum/dreame/protocol.py", line 1265, in get_properties return self.send( ^^^^^^^^^^ File "/config/custom_components/dreame_vacuum/dreame/protocol.py", line 1253, in send raise DeviceException( custom_components.dreame_vacuum.dreame.exceptions.DeviceException: Unable to discover the device over cloud

Tasshack commented 11 months ago

That happens when you try to reach the China server over some European ISPs. I can reproduce the issue over my fiber WAN connection but never happens on 4G over LTE (Vodafone). That means there are some rate limiting or blocking in between my ISP and Dreame servers. This is certanly a thing that i cannot fix and happens on the Mi Home app too. You can try to solve this with using google public DNS, I heard from some people that using weird DNSes can cause this issue too.