I am often asked how to prevent chickens from sleeping in the nest box. In general, this is because perches are lower than nests. All you have to do is install them higher. Otherwise, close the entrance of the nest boxes before night and open before laying. In two or three weeks, your chickens will lose the habit of sleeping at the nest box.