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
887 stars 110 forks source link

after homeassistant upgrade integration can't start #686

Closed 13werwolf13 closed 2 months ago

13werwolf13 commented 2 months ago

Describe the bug after homeassistant upgrade to version 2024.8.2 integration can't start

Screenshots Screenshot_2024 08 25 12 43 59 Screenshot_2024 08 25 12 44 19

Additional Information (please complete the following information)

Aug 25 12:42:05 gw.itrus.su pipenv[16631]: 2024-08-25 12:42:05.079 WARNING (MainThread) [custom_components.dreame_vacuum] Integration start failed: Traceback (most recent call last):
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:   File "/root/.homeassistant/custom_components/dreame_vacuum/coordinator.py", line 326, in _async_update_data
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:     await self.hass.async_add_executor_job(self.device.update)
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:   File "/root/.pyenv/versions/3.12.5/lib/python3.12/concurrent/futures/thread.py", line 58, in run
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:     result = self.fn(*self.args, **self.kwargs)
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:   File "/root/.homeassistant/custom_components/dreame_vacuum/dreame/device.py", line 996, in update
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:     self.connect_device()
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:   File "/root/.homeassistant/custom_components/dreame_vacuum/dreame/device.py", line 725, in connect_device
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:     self.info = DreameVacuumDeviceInfo(self._protocol.connect())
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:                                        ^^^^^^^^^^^^^^^^^^^^^^^^
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:   File "/root/.homeassistant/custom_components/dreame_vacuum/dreame/protocol.py", line 495, in connect
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:     response = self.send("miIO.info", retry_count=retry_count)
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:   File "/root/.homeassistant/custom_components/dreame_vacuum/dreame/protocol.py", line 536, in send
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:     return self.device.send(method, parameters=parameters, retry_count=retry_count)
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:   File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/miio/miioprotocol.py", line 161, in send
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:     self.send_handshake()
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:   File "/root/.local/share/virtualenvs/.homeassistant-aFU_N-07/lib/python3.12/site-packages/miio/miioprotocol.py", line 74, in send_handshake
Aug 25 12:42:05 gw.itrus.su pipenv[16631]:     raise DeviceException("Unable to discover the device %s" % self.ip)
Aug 25 12:42:05 gw.itrus.su pipenv[16631]: miio.exceptions.DeviceException: Unable to discover the device 192.168.196.246
Tasshack commented 2 months ago

Cannot reproduce the issue because it is not related to HA version.

seidler2547 commented 2 months ago

There's definitely some kind of problem. It failed with "Unable to discover the device over the cloud" with the 3 second timeout for the API call. I increase the timeout in the code and now it's stuck at

2024-08-31 11:21:31.783 WARNING (MainThread) [custom_components.dreame_vacuum] Integration start failed: Traceback (most recent call last):
  File "/config/custom_components/dreame_vacuum/coordinator.py", line 437, in _async_update_data
    await self.hass.async_add_executor_job(self._device.update)
  File "/usr/local/lib/python3.12/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 2812, in update
    self.connect_device()
  File "/config/custom_components/dreame_vacuum/dreame/device.py", line 2038, in connect_device
    self._request_properties()
  File "/config/custom_components/dreame_vacuum/dreame/device.py", line 695, in _request_properties
    result = self._protocol.get_properties(props[:15])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dreame_vacuum/dreame/protocol.py", line 1241, in get_properties
    return self.send("get_properties", parameters=parameters, retry_count=retry_count)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dreame_vacuum/dreame/protocol.py", line 1230, in send
    response = self.device_cloud.send(method, parameters=parameters, retry_count=retry_count)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dreame_vacuum/dreame/protocol.py", line 427, in send
    if api_response is None or "data" not in api_response or "result" not in api_response["data"]:
                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable

2024-08-31 11:21:31.783 INFO (MainThread) [custom_components.dreame_vacuum.dreame.device] Disconnect
2024-08-31 11:21:31.823 DEBUG (MainThread) [custom_components.dreame_vacuum] Finished fetching dreame_vacuum data in 8.543 seconds (success: False)
Tasshack commented 2 months ago

@seidler2547 even there is a problem that is isolated to your setup and logs does not indicate otherwise so i cannot do anything.