Help getting complex automations done in GUI

I am trying to automate the vacuums starting when I am not at home using the automations GUI. What I am trying to do is:

At 8am, if I’m not home, start both vacuums. If I am home, wait for up to 12 hours for me to leave home, then start. If I don’t leave, it will try again the next day.

Here is what I have so far. It basically waits until after 8am for me to leave the house, and then vacuums at 8pm if I don’t leave all day. If I am already gone at 8am it still waits for me to leave again.

How to I add another IF statement to this (If i am not home at 8 start right away, else wait 12 hrs for me to leave). And second, to not vacuum at 8pm (after waiting 12 hours) if I never leave home?

I would like to figure out how to do this with the GUI and not yaml (if possible?)


Thanks in advance!

Yes, this is a gripe I often have with the Wait for a trigger action as well, there is currently no option to tell it “if the condition is already fulfilled, continue immediately”. (Well, technically it should then be called “Wait for state” I guess.)

As your first action you have to add an If-then action that checks if you’re at home, only then it should do the Wait for a trigger action.

You also should disable the “Continue on timeout” toggle, otherwise it will vacuum if you’re at home.

1 Like

Shoot, been trying to figure this out for a week, then as soon as I post I figured it out! I was trying to add if statements into the “And If” section. What I needed to be doing is using “building blocks” (confusing name) and building all my statements under the “Then Do” section. Also figured out to uncheck the “continue on timeout” to prevent it vacuuming at the end of the day.

Here is my updated one for anyone else who had similar questions:

You can reduce repetition by moving the vacuum action out of the Choose and replacing it with an If-then.

This isn’t mentioned explicitly in the docs (I think), but when the Wait for a trigger timeout hits, it will abort the whole script (and not just the current block, as one might think), so the vacuuming will be skipped.

That is what the Wait Template action is for…

Using a Delay followed by a State condition may also be an option, depending on the use case.

That should only happen when continue_on_timeout is set to false. The default behavior is to continue executing any actions after the timeout completes.

Wait Timeout

If you want an interruptible delay…

- alias: Repeat the sequence UNTIL the door is closed
  repeat:
    sequence:
    - alias: This is the delay broke into 2 sec incr so it can be interupted.
      repeat:
        while: >
          {{ expand(door_ent)[0].state == 'on' and repeat.index <= cooldown/2 }}
        sequence:
          - delay: 00:00:02
    - alias: Send announcement message (potentially again)
      if: "{{ expand(door_ent)[0].state == 'on' }}"

#Do more stuff here...

    until: "{{ expand(door_ent)[0].state == 'off' }}"

Breaks a delay up into 2 second jumps so that when the the target action finishes, there is a very short wait to action.
See all the code here…

Community link for this blueprint