I created a program (attached photo below) that turns on the bedroom light for 45 seconds, then Alerts me when it's about to turn off, waits an additional 15 seconds, and then turns the bedroom light off. The problem is, if I just walk into the bedroom quickly, and then walk out, the light never turns off. The reason this is happening is because the motion sensor has a 30 second "timeout". After those 30 seconds the motion sensor reports "off" and the program becomes false. Since the program switches to "false" before the final off command can be executed, the light remains on.
The easiest solution would be to increase the timeout, unfortunately the 30 second timeout is a requirement for different unrelated program, so I can't change it. Does anyone have any suggestions on how to get the program to continue executing, in spite of the fact that the motion sensor reports "off" without changing my time out?