Complex motion/presense rule/s?

you may want to check out this tutorial by Scott

here is a further reading on the idea Markus mention
Rule Example Wasp in Box