Here is another example where things don’t work as people might think:
if
Door Sensor contact changes to open
then
if Time is between sunset and sunrise
then
with
Hall Light
do
turn on
wait 10 minutes
turn off
end with
end if
end if
So during the night, if the door opens the light comes on and ten minutes later it turns off.
The door being closed does not stop the light being turned off on a delay. Not only is the Time restriction not reached to be reevaluated but it probably wouldn’t have changed anyway. Only the parent condition affects TCP.
The only way the delay doesn’t complete is if the door opens for a second time during the wait and it is now after sunrise.