[HOWTO] Create a flow that vacuums the home only when you're gone (and stops when you arrive early)

My robot vacuum is only programmable on times. Especially with working from home that is not ideal. I do not want to be disturbed while I am working.

Situation
You want your robot vacuum to clean while you are not home, but just once a day. You never want to be bothered seeing the thing at work.

Prerequisites
You need a vacuum connected to Homey. And your geofencing needs to work (for all members of the house).

Good to know
Unfortunately I cannot add my new vacuum to the Xiaomi app due to an error. You’ll see empty or unavailable cards.

Let’s get started!

STEP 1
We need a few variables to make sure it does what we want.

  1. Variable Stofzuiger bezig? (or Vacuuming?), boolean, set it to false.
    This indicates that your house is actually being vacuumed right now.

  2. Variable Gestofzuigd vandaag? (or Vacuumed today?), boolean, set it to false.
    When the vacuum finishes the while task, this will mark it so.

STEP 2
We create a flow that will start the vacuum.

How does this flow work?

  • The flow starts when the last person leaves the house.
  • Optional: I’ve added a time slot where I do want to vacuum.
  • As I only want the vacuum to vacuum once per day, I check if it already made a complete cycle.
  • If both conditions pass I fire up the vacuum! I also set both variable to true.

STEP 3
We create a flow when somebody returns to the house.

How does this flow work?

  • The flow is started when someone enters the geofence.
  • If the vacuum is busy, the flow continues.
  • It stops the vacuum and commands it to return to the dock.
  • I set both variables to false (it didn’t run a full cycle).

STEP 4
If the vacuum finishes his cycle, we need to register that.

How does this flow work?

  • The trigger is where the vacuum status changes to charging. Because: if the vacuum returns after finishing, that is the status it’ll have.
  • We check if the variable is set to true. This eliminates the charging status we also have in step 3.
  • As a result we change the other variable to no.
  • We leave the Gestofzuigd vandaag? variable untouched. Because the vacuum made a full cycle, so even when you leave the house again, it will not do another cycle.

STEP 5
We need a daily reset! The Gestofzuigd vandaag? variable needs to be set to false at midnight.

How does this flow work?

  • At (one minute) for midnight this flow runs.
  • It sets the variable to false for another day of cleaning!
1 Like