Create a loop for a timer/sensor

Please share the automation you are using… How to Ask a Good Question #8 & 9