Debugged Version - Functioning with Pet Detection, schedule, on demand