Putting motion sensor and cameras in jars to protect them from the weather

Has anyone tried putting one of the motion senors in a jar to protect it, in an outdoor location? Also, I am thinking of putting a camera in a jar for protection for use outside. I have seen enclosures for sale on Amazon for cameras so they can be placed outside. Anyone have any experience with these enclosures?

PIR sensors work very poorly through glass. To me that is part of the beauty of the Wyze cams, I’ve 6 all looking through glass and they all detect motion based on pixel change.