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

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?

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.

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.

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 …

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.

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.