Automation based on time

I’m a bit new to home assistant and have been tinkering with some ideas and have hit a snag. After browsing the forums, I realized that setting a duration for a trigger, condition, and action will cause the automation to wait for that time to pass before executing the action.

Is it possible to instead create a duration that will cause an action to occur if a condition is fulfilled within a certain time of the trigger?

For example,

Trigger: Device A turns on

Condition: Device B turns on within 2 minutes Device A turning on

Action: Device C plays music (or calls service, etc).

H, welcome to the forum!

That’s not a condition: that’s an action with a delay of 2 minutes.

That’s the issue I am trying to overcome. I don’t want to create a delay of “2 minutes” to cause an action.

I want to two devices to trigger a third one, only if the first two devices are activated within a time frame of each other.

Okay, for device B you have to use ‘wait for a trigger’ as an action

So it would look something like this:

Trigger: Device A turns on

Action: (wait for trigger: Device B turns on), Turn on Device C

That would be instant though… I would want to set it so that it could look for that action trigger for a specified amount of time.

EDIT: I see that I can have a time out, so that actually solve my problem. Thanks!

1 Like