Routine during time

hello everyone, I would like to know if by creating a routine that goes from one time to another it is possible to have the routine verified during this time.
Let me explain better: from one hour now I turn on a switch and at another time of the day I turn it off.
But if during this period of time I turn off the switch manually always from the app, it will not remain on during this period but will remain in the off condition…
Is it possible to do something?

I’m asking this because I’m trying to create a chronothermostat that in certain periods of the day must always and in any case turn valves on and off

Routines are event based, if you want to ensure that something that was on cannot be turned off during a certain period of time, the only option would be another routine: “if device is turned off during this period of time, turn it on”.

I have made one routine like this,

precondition = timespan, enable “Run this at the beginning of the time period” (new option!)
condition = thing is off
action = turn thing on

and another,
condition = one minute after above timespan
action = turn thing off

I use this to keep the corner light outside on during nighttime, even if I (or other routines like telling Alexa to “turn all lights off”) accidentally turn it off.