Looking for best way to trigger on a sequence of events. A -> B -> C

So what I want is to trigger an automation when a sequence of events(in general, could be a state change) happen within certain configurable time. E.g., A-> (within 5 seconds) B → (within 15 seconds) C, where ABC could be any of the supported home assistant trigger like event, or state change.

My current non-elegant solution is to only trigger on C, but check if A and B were triggered earlier. Looking for any idea how to make it easier! Thanks


Another solution I found is to use wait_for_trigger in the actions section. Yet still the syntax is not straightforward enough.

Your automation would have A as the main trigger, then use Wait for Trigger or Wait Template.