Refine timeout logic so that motion within five minutes of turning switch off, will turn switch back on