I used a PIR sensor module for the motion detection for a security light and fixed everything in a small transparent plastic box (PIR sensor module also inside the box). It is working fine without any issues. Whenever there is a motion it switches on the light. So I believe it works for your case as well with out any issues from behind the clear glass. Just give a try!!