Well, with something like this the answer is always in the details, and you didn’t provide any.
If it is based on the time of day, why require a manual button press?
For rules that look like this I recommend the Design Pattern: How to Structure a Rule.
-
Determine whether the rule even needs to run. In this case
-
Calculate what needs to be done
-
Do it.
You will always want to run the rule so 1 isn’t in play. So we are left with 2 and 3.
We also have to deal with
Which is a whole new requirement you’ve not mentioned until now.
The first question is is the set of ten roller shutters the same set for each scene? Or do you have one scene with only three of them and another with all ten?
It makes a huge difference in the potential approaches.
Ultimately you will need to figure out the timing and then farm the work of issuing the UP command and waiting into Timers, not Thread::slkeeps.