Thank you so much. So if I understand the algorithm is more or less:
Open valve at start time and close it at start time+duration then if there’s a repeat value add it to the start time and check if this new time is before the end time if so execute if not don’t.
Hope that with your help I got it ! 🙂