Vacuum "send_commands", what are they? Also resume cleanup funtionality?

Trying to better automate my xiaomi vacuum and having a hard time figuring out how to get it to pause the cleanup, return to base, and resume that cleanup. Upon returning it to base it seems all commands will start a new clean up process. Has anyone used the send_command service? Can you possibly emulate a low battery command?

Right now if the xiaomi vacuum gets low on battery it will pause cleanup and return home, at which point if you choose to manually “start_pause” it WILL resume the last cleanup where it left off, this is currently the only way I have been able to resume a previous cleanup after the vacuum has docked. Unless I have missed something, I’ll do some more testing when I get home, it seems xiaomi has a pause/return_to_base command it uses when the vacuum battery gets too low. Is anyone aware of how to emulate that? Or has anyone gotten resume cleaning functionality to work?

The Xiaomi cleaner has these commands:

  • return_to_home
  • start_pause

Have you tried them?
also if the vaccum returns itself to base when on low battery, have you tried to let it do that by itself (rather than “force” it to) and then simply send the start_pause command to see if it resumes?

I have used every command in many combinations aside from “toggle” and “send_command”.

Not sure I understand what you’re asking I the second part… It returns to the base by its self when on low battery. Then at some point it decides its gotten enough battery and resumes on its own. This is normal operation. BUT. After losing battery and going back to base and before it automatically resumes, sending the “start_pause” command will cause it to prematurely “resume” the previous cleaning routine.

The issue is, that is the only way to resume cleaning. If you manually send it back to the dock there is no way to have it resume cleaning that I have discovered.

Edit: But as I said, it’s possible I missed something? I just recall trying everything and no matter what it would restart from the beginning, until I tried manually resuming after the vacuum sent Itself back to the dock. It’s as if being sent to the dock via low battery alert causes the “start_pause” command to issue a resume command rather than a start command.

Quick question, did you try to send it back to the dock by pressing the button on the vacuum itself to see whether if would then resume or start a new cleaning?

Maybe it’s by design that if you manually send it back to dock it will stop the cleaning and any future request will initiate a new cleaning?

Stupid question #1: if it already has the function to return to base and charge when the battery goes, low, why would you try to override it?

Stupid question #2: if it already automatically resumes the cleaning when it decides it has enough charge, why would you resume the cleaning prematurely?

Hmmmm no i have not tried manually sending it back to dock but I will when I get home!

So I want this functionality because I would like vacuuming to start when I leave. But when I come home I’d like it to pause and return to the dock, BUT if I leave again that day it should then resume cleaning where it left off for the day.

Currently I have it simply pause wherever it is when I come home and i then have the option to send it back to the dock if I know I’ll stay home or leave it there if I’m leaving again so it can resume cleaning.

It’s just not as graceful as I’d like it. And it’s a shame because it seems the functionality is in there somewhere.

That makes more sense now :slight_smile:
Guess once you try by physically pushing the button the vacuum you’ll know if it’s a “controllable” feature or not.
if it’s not I guess you’ll just have to start again a new cleaning and hope that you’re away long enough that it finishes.
else if you have an idea on when you’re likely to be out, you can restrict the start time to specific windows, this is my config:

- alias: Start Vacuuming
  trigger:
    - platform: time
      minutes: '/15'
      seconds: 0
  condition:
    - condition: time
      after: '09:00'
      before: '15:00'
      weekday:
        - tue
        - thu
        - sat
        - sun
    - condition: template
      value_template: '{{ (as_timestamp(now()) - as_timestamp(states.automation.start_vacuuming.attributes.last_triggered) | int > 36000)}}'
    - condition: state
      entity_id: 'input_boolean.normal'
      state: "on"
    - condition: template
      value_template: "{{ states.device_tracker.zevsmpjl_div_iphone.state != 'home'}}"
    - condition: template
      value_template: "{{ states.device_tracker.zevsmpjl_lolo_iphone.state != 'home'}}"
  action:
    - service: vacuum.turn_on
      data:
        entity_id: vacuum.mi_robot_vacuum

Yeah I was hoping one of the vacuum component debs would see this and maybe have an idea of how we can maybe spoof a low battery signal or something haha

Only thing I have left to solve is preventing the vacuum from resuming late at night. As it stands of it docks after running low say at like 7pm it will resume late at night on its own to finish. Maybe the do not disturb function changes this?