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

Cant press Dreame app shortcuts when robot is Sleeping #749

Open MKlitgaard2 opened 1 month ago

MKlitgaard2 commented 1 month ago

Describe the bug I have 2 Dreame l10s ultra robots. I have created some shortcuts in the Dreame app and use them from HA. They show up in HA as controls and I just have to invoke the press command. I find this i easier than creating the whole automation in HA. But often when the machines go into Sleeping state I cant perform the command, why? It always works from the dreame app. But I cant figure what the apps does to "wake" the devices.

To Reproduce

  1. Create a shortcut in the dreame app
  2. Try the command from HA
  3. Let the robot go to Sleeping mode try the command again

Expected behavior That HA can start the shortcut every time.

Screenshots image

Additional Information (please complete the following information)

Tasshack commented 1 month ago

Probably related to this. https://github.com/Tasshack/dreame-vacuum/issues/721

MaKin211 commented 1 month ago

Same issue with me. Installed the integration two days ago and I start the shortcut with an automation at 00:31 and the first night it worked, the second it does not. What I noticed is the following:

Other entities also become unavailable, not sure whether it’s linked though.

IMG_1155

Tasshack commented 1 month ago

Same issue with me. Installed the integration two days ago and I start the shortcut with an automation at 00:31 and the first night it worked, the second it does not. What I noticed is the following:

  • After triggering the shortcut in home assistant it becomes unavailable
  • After reloading the integration it becomes available
  • After triggering the shortcut in home assistant it becomes unavailable

Other entities also become unavailable, not sure whether it’s linked though.

IMG_1155

Related to this https://github.com/Tasshack/dreame-vacuum/issues/721

MKlitgaard2 commented 1 month ago

Now I have had some time to test if this can be related to #721.

I can’t see how this can be related to network issues. But unfortunately, I can't find a pattern on when the issue occurs. Seems pretty random, apart from the robot needing to be docked for an hour or so before the issue occurs.

MaKin211 commented 1 month ago

I also run the latest build of the integration being v2.0.0b16 and my robot is on the latest firmware version. The robot is connected via the dreame cloud, not the xiaomi cloud. Unfortunately the local connection does not work at all. I was not able to connect locally (although I can ping it etc.) so I had to set the integration to "prefer cloud".

The following happened today after triggering the shortcut via HASS:

Before 02:47 it was unavailable At 02:47 I reloaded the integration At 02:56 I triggered the shortcut via HASS, the vacuum started cleaning and the shortcut became unavailable again At 07:45 I started emptying the dust collector (via the Dreame app) At 07:45 the shortcut switched from unavailable to unknown (becoming available again)

This does not only relate to the shortcuts but also other entities like Start Auto Empty, Self Clean etc.

Happy to provide logs if it helps. There are no network issues as no other devices (e.g. another robot that is connected to the Xiaomi cloud instead of the Dreame cloud) behave oddly.

vanislman commented 1 month ago

I have the same issue with shortcuts. My shortcuts worked fine in HA for many months (since I bought the vacuum). The non-working shortcuts started most likely after my last HA upgrade to 2024.10.1 or to 2024.10.2. dreame.vacuum.r2228o Firmware: 4.3.9_3204 Current HA version 2024.10.2

MaKin211 commented 1 month ago

Do you guys access it via the dreame cloud or xiaomi?

It appears that reloading the integration / device does not bring back the entities as I falsely claimed. The robot is sleeping and the shortcuts are gone. However, I can start cleaning from HA.

This applies to my L20s. I have another L10s and the issue does not yet occur there…

IMG_1163

vanislman commented 1 month ago

I have an L10S Ultra, and I believe I'm using the Dreame cloud integration (I use the Dreamehome app on my phone and everything - including shortcuts - works fine in the app. Regular controls like start/stop/home etc. work fine in HA too. My shortcuts in HA are ALWAYS disabled - not just when the robot is sleeping.

vanislman commented 1 month ago

... and just after I sent the message above I checked HA - and now the shortcuts are enabled and working again. This is the first time since about 1 1/2 weeks. I upgraded HA to the latest version 2024.10.3 today. Not sure if that fixed this issue? I'll post another message tomorrow if the shortcuts remain stable, or if they "come and go".

Tasshack commented 1 month ago

Can you try downgrading to the v2.0.0b15 because I have made some changes about how shortcuts are processed on the latest Beta?

MaKin211 commented 1 month ago

Hi @Tasshack , I just switched to v2.0.0b15 and will let you know. Thank you.

vanislman commented 1 month ago

I just downgraded to v2.0.0b15 as well. Shortcuts all show up and are operational.

MKlitgaard2 commented 4 weeks ago

Hi,

I downgraded to v2.0.0b15 3 days ago. I havent had any issues with shortcut since :)

MaKin211 commented 4 weeks ago

Me neither. :)

Tasshack commented 4 weeks ago

So I guess the last update broke it, I will review the changes and try to fix it, thanks for the feedback.

kbullet commented 4 weeks ago

@Tasshack FYI not sure if its related but I'm constantly getting the "Unable to discover the device over cloud" error each time i reload the integration or restart HA. Though apart from the shortcuts everything else loads up just fine. Doesn't seem to happen on v2.0.0b15

2024-10-24 18:27:55.812 WARNING (SyncWorker_43) [custom_components.dreame_vacuum.dreame.map] Send request map failed: Unable to discover the device over cloud
2024-10-24 18:27:55.819 ERROR (Thread-16005 (_api_task)) [root] Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/threading.py", line 1073, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.12/threading.py", line 1010, in run
    self._target(*self._args, **self._kwargs)
  File "/config/custom_components/dreame_vacuum/dreame/protocol.py", line 112, in _api_task
    item[0](self._api_call(item[1], item[2], item[3]))
  File "/config/custom_components/dreame_vacuum/dreame/protocol.py", line 388, in <lambda>
    lambda api_response: callback(
                         ^^^^^^^^^
  File "/config/custom_components/dreame_vacuum/dreame/protocol.py", line 1206, in cloud_callback
    raise DeviceException("Unable to discover the device over cloud") from None
custom_components.dreame_vacuum.dreame.exceptions.DeviceException: Unable to discover the device over cloud