I think you can implement that use case in a much simpler way.
You can get rid of using a counter variable by implementing this:
- A boolean variable (“motion_event”) which is set to TRUE by any of your events (motion, door opening, etc.)
- A condition (“motion_event_in_last_15mins”) with is linked to (motion_event = TRUE). Make it a trigger condition and set a timeout setting of 15 minutes
- A logicblock that turns lights on when “motion_event_in_last_15mins” goes TRUE and turns them off when it goes FALSE
Every new event will reset the 15 minutes timeout for the condition, so you will achieve the desired result without counters.
See this diagram I made for this thread for more info on how the timeout delay works