If there are people or objects in the monitored area, then solve this problem by a motion detection. By rotating the sensor circuit board, a wide or narrow detection field can be set. Type Motion detector.
eBay