Xiaomi vacuum docking process can't be interrupted locally

I tried to make automation for two cleaning sequences in a row (without intermediate docking), but vacuum seems to ignore any local commands whilst returning to a charger after the first run (although it answers “ok” in the miio debug-log). Same time “pause” command sent through cloud works just fine. Is it a platform issue/limitation?

it is because somebody programmed component like it. I will make PR today to ‘repair it’.
For now it is

if self.state == STATE_CLEANING:
            await self._try_command(
                "Unable to set start/pause: %s", self._vacuum.pause)

so you can only pause while cleaning

1 Like

I sent PR https://github.com/home-assistant/home-assistant/pull/20620
Now it is just waiting. Hopefully they will merge it soon, so it can be released with HA 0.88

1 Like

Thank you for this! Hope PR will be merged ASAP :slight_smile:
One more question about vacuum.start_pause service: how do you think, it’s inapplicable for xiaomi vacuums, or just not yet implemented? For now, executing causes this error:

2019-01-31 18:37:21 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/service.py", line 287, in _handle_service_platform_call
    await getattr(entity, func)(**data)
AttributeError: 'MiroboVacuum' object has no attribute 'async_start_pause'

According to this https://github.com/home-assistant/home-assistant/blob/786d178364cf38c9ba19b126201f87ba7d71a727/homeassistant/components/vacuum/init.py
there are two types of vacuum devices - with states and without states.
Those without states has method async_start_pause and such service as well.
Those with state has divided services as start, stop, pause, return_to_base etc.

So just don’t execute it I guess :slight_smile:

1 Like

You have fully confirmed my own conclusions, thank you for your spent time!