# How to setup a flow when you want two events to be true (at NOT the exact same time)

**URL:** <https://community.homey.app/t/how-to-setup-a-flow-when-you-want-two-events-to-be-true-at-not-the-exact-same-time/118354>\
**Category:** Questions & Help\
**Tags:** advancedflow\
**Created:** [October 17, 2024, 3:57am UTC](https://community.homey.app/t/how-to-setup-a-flow-when-you-want-two-events-to-be-true-at-not-the-exact-same-time/118354 "2024-10-17T03:57:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![EE\_PE\_Savage](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ee_pe_savage/32/94365_2.png) [@EE\_PE\_Savage](https://community.homey.app/u/EE_PE_Savage)\
**Post date:** [October 17, 2024, 3:57am UTC](https://community.homey.app/t/how-to-setup-a-flow-when-you-want-two-events-to-be-true-at-not-the-exact-same-time/118354/1 "2024-10-17T03:57:30Z")

</div>

I am using an advanced flow to detect when my Aqara FP2 sensors no longer detect presence in the bedroom and the office, then turn off the bedroom lights. This works fine when I use the bedroom sensor alone, but if I add an “all” statement and add the office sensor too, it does not turn off the lights even with the sensors both show “absence” because they have to happen at the same time. What is a good way to structure this action happening when both sensors don’t show presence? I cannot figure out the most efficient way to perform this. Appreciate your insights!

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/1/7/176ef0b7eed607fa59ba2d66befd014f843b0732.png)

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [October 17, 2024, 5:03am UTC](https://community.homey.app/t/how-to-setup-a-flow-when-you-want-two-events-to-be-true-at-not-the-exact-same-time/118354/2 "2024-10-17T05:03:25Z")

</div>

> How to setup a flow when you want two events to be true (at NOT the exact same time)

Events happen (in a split second), and never become true… within what time dow tou think that should work two events before an ALL operator, 1 second? 1 minute? one month?

> [@\[FAQ\]\[Advanced Flow\] Infinite canvas. Infinite creativity](https://community.homey.app/t/faq-advanced-flow-infinite-canvas-infinite-creativity/65145/1):
>
> **Two triggers to start an ALL**  
> Also applies to all other different **triggers** b̶e̶h̶i̶n̶d̶ before an ALL like “Someone came Home” AND “the door is opened” =\> That is NOT going to trigger NEVER!
> 
> ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/7/07b8f61c91489578e20195bfa91712a476494fa6.png)
> 
> ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/c/5ce7fe8ecf7cbaa4b6e5f3c4a233fd2cb7aed23a.png)
> 
> That only works with an ANY function!
> 
> ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/2/420567c7468661153418eba849205bc8fcac2410.png)
> 
> **Multiple _triggers_ (\< ANY \>) for a Condition/Action in One Trigger**  
> By design within one Trigger, all cards can start (Maximum) one time,

Always use one (1) Trigger with a CONDITION (And.. Card)other state of the other,

Trigger: “Zone 0 became free”  
AND “motion Alarm IS OFF”  
THEN …

Trigger: “Motion Turned Off”  
AND “Zone 0 IS Free”  
THEN …

or combine them:

Trigger: “Zone 0 became free”  
Trigger: “Motion Turned Off”  
=\> ANY  
AND “motion Alarm IS OFF”  
AND “Zone 0 IS Free”  
THEN …

---

<div class="post-metadata">

**Author:** ![DirkH](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dirkh/32/78952_2.png) [@DirkH](https://community.homey.app/u/DirkH)\
**Post date:** [October 17, 2024, 12:44pm UTC](https://community.homey.app/t/how-to-setup-a-flow-when-you-want-two-events-to-be-true-at-not-the-exact-same-time/118354/3 "2024-10-17T12:44:56Z")

</div>

Hi @EE_PE_Savage ,  
Here is a general Testflow how it is created when you have several conditions and want to get the flow run, when all conditions are met.

 ![MultiCondition Test](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/b/7/b77e33cfcc8b5d231cc50a28658fc979a9610ed3.png)  
You have to get used to it, but that is how you handle incident driven flows as efficient as possible.

---

<div class="post-metadata">

**Author:** ![EE\_PE\_Savage](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ee_pe_savage/32/94365_2.png) [@EE\_PE\_Savage](https://community.homey.app/u/EE_PE_Savage)\
**Post date:** [October 17, 2024, 1:25pm UTC](https://community.homey.app/t/how-to-setup-a-flow-when-you-want-two-events-to-be-true-at-not-the-exact-same-time/118354/4 "2024-10-17T13:25:27Z")

</div>

Thanks for the help and recommendations everyone! That makes sense and I will set them up like that.

---

<div class="post-metadata">

**Author:** ![Wim\_Post](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/wim_post/32/56793_2.png) [@Wim\_Post](https://community.homey.app/u/Wim_Post)\
**Post date:** [October 17, 2024, 5:37pm UTC](https://community.homey.app/t/how-to-setup-a-flow-when-you-want-two-events-to-be-true-at-not-the-exact-same-time/118354/5 "2024-10-17T17:37:45Z")

</div>

This is IMHO the most simple solution:

 ![Scherm­afbeelding 2024-10-17 om 19.30.17](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/7/7/774e58e47579f964466389a508d8e7fa5a45d000.jpeg)

---

<div class="post-metadata">

**Author:** ![EE\_PE\_Savage](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ee_pe_savage/32/94365_2.png) [@EE\_PE\_Savage](https://community.homey.app/u/EE_PE_Savage)\
**Post date:** [October 23, 2024, 1:44am UTC](https://community.homey.app/t/how-to-setup-a-flow-when-you-want-two-events-to-be-true-at-not-the-exact-same-time/118354/6 "2024-10-23T01:44:20Z")

</div>

I was able to use the guidance to figure out how to get it to work. However, it brought up another related question. Why are the zone cards that show up under “AND” only an option for when a zone is active and not also when a zone is inactive?

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/8/284eb0c1654731be784094f33d7e90bb2f6e2563.png)

---

<div class="post-metadata">

**Author:** ![Dijker](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@Dijker](https://community.homey.app/u/Dijker)\
**Post date:** [October 23, 2024, 5:01am UTC](https://community.homey.app/t/how-to-setup-a-flow-when-you-want-two-events-to-be-true-at-not-the-exact-same-time/118354/7 "2024-10-23T05:01:00Z")

</div>

> [@EE\_PE\_Savage](#):
>
> show up under “AND” only an option for when a zone is active and not also when a zone is inactive?

Because every AND card can be inverted and then it becomes…

 ![Screenshot_20241023_065858_Homey](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/a/5a202026c52efa19a89e02f8fe9f9261f5ee072a.jpeg)

---

<div class="post-metadata">

**Author:** ![EE\_PE\_Savage](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ee_pe_savage/32/94365_2.png) [@EE\_PE\_Savage](https://community.homey.app/u/EE_PE_Savage)\
**Post date:** [October 23, 2024, 1:22pm UTC](https://community.homey.app/t/how-to-setup-a-flow-when-you-want-two-events-to-be-true-at-not-the-exact-same-time/118354/8 "2024-10-23T13:22:11Z")

</div>

Interesting, trying to look for the invert but that isn’t on my version. Then I realized with the AND card that you can make a path for true or it being false which would have the same result as inactive. Maybe a region difference, but you helped me figure it out either way. Thank you!

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/8/d8de84191d8dfe8f6f260aac46db28cb94b31850.png)

---

<div class="post-metadata">

**Author:** ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)\
**Post date:** [October 23, 2024, 10:10pm UTC](https://community.homey.app/t/how-to-setup-a-flow-when-you-want-two-events-to-be-true-at-not-the-exact-same-time/118354/9 "2024-10-23T22:10:18Z")

</div>

The example of @Dijker is from standard flows  
Your example card is from advanced flows.  
That one has two ‘outputs’ on the right hand side;

- The top one, which is blue, gets activated when the zone is active (the condition = true)
- The lower one, which is orange, gets activated when the zone is _not_ active (the condition = false)

Interesting info:

> [@\[FAQ\]\[Advanced Flow\] Infinite canvas. Infinite creativity](https://community.homey.app/t/faq-advanced-flow-infinite-canvas-infinite-creativity/65145):
>
> Something advanced is coming to Homey Pro… For the AMA [Advanced Flow — Ask Me Anything](https://community.homey.app/t/advanced-flow-ask-me-anything/65167) speech_balloon The FAQ from Athom is already on the information page on the bottom. The link should automagically switch to your language (en/nl / etc…) Read the introduction from Athom here: [Advanced Flow](https://homey.app/advanced-flow/) The EXTRA Things you can do in Advanced Flow Have multiple Triggers Have 1 (one) Start (Starting the Flow) Have Delays (0 -999 Seconds, 0-999 min.) All (function to wait for all incoming trigger…

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [October 24, 2024, 4:12am UTC](https://community.homey.app/t/how-to-setup-a-flow-when-you-want-two-events-to-be-true-at-not-the-exact-same-time/118354/10 "2024-10-24T04:12:00Z")

</div>

Im addition to Peter, you can rightclick the flow card and you will find the invert option in the context menu.
