# Two criterias met or keeps it on hold/monitoring for some time if not met

**URL:** <https://community.homey.app/t/two-criterias-met-or-keeps-it-on-hold-monitoring-for-some-time-if-not-met/107502>\
**Category:** Devices\
**Created:** [April 1, 2024, 8:57pm UTC](https://community.homey.app/t/two-criterias-met-or-keeps-it-on-hold-monitoring-for-some-time-if-not-met/107502 "2024-04-01T20:57:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pinpoint](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pinpoint/32/79444_2.png) [@pinpoint](https://community.homey.app/u/pinpoint)\
**Post date:** [April 1, 2024, 8:57pm UTC](https://community.homey.app/t/two-criterias-met-or-keeps-it-on-hold-monitoring-for-some-time-if-not-met/107502/1 "2024-04-01T20:57:44Z")

</div>

I have two presence detectors, one in living room and one in bedroom. I want to run a specific flow which sets all users to sleep when the detector in the bedroom is activated while the other in the living room is deactivated. I don’t want it to run when there is presence detection in the living room, and if my wife is late to bed (1-2 hours after me), I want it to run as soon as she leaves the living room.

I can’t seem to find any clever solution to set this up.  
I understand that it is not possible to run one trigger each “presence” and “no presence” and link them to ALL.

I only get it to run a flow as long as both criterias are met when the trigger has started,.  
How can I easily solve this?

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [April 1, 2024, 9:55pm UTC](https://community.homey.app/t/two-criterias-met-or-keeps-it-on-hold-monitoring-for-some-time-if-not-met/107502/2 "2024-04-01T21:55:08Z")

</div>

Sensors will never be activated at the same time, so you should use several flows with combinations of triggers and states like  
WHEN sensor 1 is activated AND sensor 2 is active THEN ….  
WHEN sensor 2 is activated AND sensor 1 is active THEN ……

Etc  
In advanced flows you might combine this simple flows.

---

<div class="post-metadata">

**Author:** ![pinpoint](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pinpoint/32/79444_2.png) [@pinpoint](https://community.homey.app/u/pinpoint)\
**Post date:** [April 8, 2024, 11:37am UTC](https://community.homey.app/t/two-criterias-met-or-keeps-it-on-hold-monitoring-for-some-time-if-not-met/107502/3 "2024-04-08T11:37:14Z")

</div>

Ok thank you. I ended up making multiple triggers as well as if not criteria is met, delay for some minutes and check again. So far it looks like this works great.

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [April 8, 2024, 2:01pm UTC](https://community.homey.app/t/two-criterias-met-or-keeps-it-on-hold-monitoring-for-some-time-if-not-met/107502/4 "2024-04-08T14:01:48Z")

</div>

You might not need delays if you also trigger on deactivation:  
1 WHEN sensor1 is deactivated AND sensor2 is true  
2 WHEN sensor1 is deactivated AND sendor2 is false  
3 WHEN sensor2 is deactivated AND sensor1 is true  
4 WHEN sensor2 is deactivated AND sensor 1 is false

You can even combine 1 and 2, 3 and 4:

WHEN sensor1 is deactivated AND sensor2 is true THEN … ELSE …

WHEN sensor2 is deactivated and sensor1 is true THEN … ELSE …

---

<div class="post-metadata">

**Author:** ![pinpoint](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pinpoint/32/79444_2.png) [@pinpoint](https://community.homey.app/u/pinpoint)\
**Post date:** [April 8, 2024, 2:23pm UTC](https://community.homey.app/t/two-criterias-met-or-keeps-it-on-hold-monitoring-for-some-time-if-not-met/107502/5 "2024-04-08T14:23:24Z")

</div>

Ok thanks. There is by default set a delay for the presence sensor to deactivate (a couple of minutes), I think this is to prevent turning off devices if there is a short period of time the sensor is unable to detect presence. (So my devices won’t turn off when they’re not supposed to). Therefore I need a delay to check again after some time that the presence sensor really is off.

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [April 8, 2024, 3:32pm UTC](https://community.homey.app/t/two-criterias-met-or-keeps-it-on-hold-monitoring-for-some-time-if-not-met/107502/6 "2024-04-08T15:32:26Z")

</div>

It won’t hurt to check again. However when the second check of the sensor is different from the first check, I suppose it would cause a trigger as the sensor state has changed and one of the flows shall be triggered.
