Common problem with motion sensors being used to trigger an off after inactivity. You might find the following discussion interesting: