Flow to turn on and off lights by room occupancy

@Darren_Barton
I have written an extensive tutorial about how to implement presence detection and use it to control lights. You can read it down below.
However, for this specific use case I don’t think you’ll need that complex setup, nor any third party app. The Aqara apps allow you to just configure the reset time in the advanced settings of the presence sensor. Just increase the presence sensor reset time to 10 minutes (600 seconds) and you’re done.

here’s the link to my tutorial, in case you want to build more complex automation in the future: