Problem with Xiaomi Robot Vacuum Platform

Hey everyone I think this is the right place to post this but if not let me know. Anyway I have setup the Xiaomi Robot Vacuum Platform and the normal stuff is working great. When I try to use the remote (XIAOMI_REMOTE_CONTROL_MOVE) it has a duration attribute where I can specify in seconds how long for the robot to move in a direction. It says this is in seconds but if I put 9999 it only goes for about 3 seconds (it depends on the velocity I set). The real issue though is that once I use a duration, that duration seems to stick for the whole session. I can’t increase or decrease the duration. Does anyone else have any experience with this?

Thanks for any help!

@codymhorton hi! I would really appreciate if you could share a script where you are using XIAOMI_REMOTE_CONTROL_MOVE.
I can get my vacuum start/stop cleaning and also start/stop remote controls but I can’t seem to actually get it to move, it ignores that part of my scripts.

@Obia sorry for the delay I’ve been busy. So I had more time to work on this tonight. Below is my script to make the vacuum go clean my kitchen.

vacuum_kitchen:
  sequence:
  - service: vacuum.xiaomi_remote_control_start
  - delay: '00:00:08'
  - service: vacuum.xiaomi_remote_control_move
    data:
      velocity: "0.29"
      rotation: "0"
      duration: "5000"
  - delay: '00:00:07'
  - service: vacuum.xiaomi_remote_control_move
    data:
      velocity: "0.29"
      rotation: "0"
      duration: "5000"
  - delay: '00:00:07'
  - service: vacuum.xiaomi_remote_control_move
    data:
      velocity: "0.29"
      rotation: "0"
      duration: "5000"
  - delay: '00:00:07'
  - service: vacuum.xiaomi_remote_control_move
    data:
      velocity: "0"
      rotation: "-18"
      duration: "5000"
  - delay: '00:00:07'
  - service: vacuum.xiaomi_remote_control_move
    data:
      velocity: "0.29"
      rotation: "0"
      duration: "5000"
  - delay: '00:00:07'
  - service: vacuum.xiaomi_remote_control_move
    data:
      velocity: "0"
      rotation: "18"
      duration: "5000"
  - delay: '00:00:07'
  - service: vacuum.xiaomi_remote_control_move
    data:
      velocity: "0.29"
      rotation: "0"
      duration: "5000"
  - delay: '00:00:07'
  - service: vacuum.xiaomi_remote_control_move
    data:
      velocity: "0"
      rotation: "18"
      duration: "5000"
  - delay: '00:00:07'
  - service: vacuum.xiaomi_remote_control_move
    data:
      velocity: "0.29"
      rotation: "0"
      duration: "5000"
  - delay: '00:00:07'
  - service: vacuum.clean_spot

Also it seem there is a bug in the code. I noticed once I tell the vacuum to move for a duration say 5000 (5 seconds) then it moves this duration for the length of time that the remote is on. Also I think the documentation is wrong about the duration ie 5000 is 5 seconds not 5000 seconds.

1 Like

Thanks for the code! This would actually have helped me but after a lot of tinkering I finally got it working myself.

You can submit fixes to the documentation directly if you want to help others struggling with it. I have never myself worked with the manual control seriously, but I have just heard that the duration part gets “stuck” and you cannot shorten the duration for separate calls.

Thanks this also helped me. It does seem that “duration” does not work as expected but I can’t figure out what the pattern is.

IIRC the duration stays the same as what was used for the initial call.