Hello, and welcome to the forum.
My tutorials cover the kind of examples you are looking for. This is an introductory guide to building a smart home using Aqara. Pay special attention to Lesson 1 and its supplement; they will give you a clear understanding of how the Automation 2.0 logic works. Automation 2.0 Tutorial Collection - Lesson 1 report