My nest boxes have a landing roost that can be folded up, I have had a few hens take to sleeping in the boxes, I physically remove them at night and place them on the roost proper. I then "close" the nest boxes to prevent them from worming their way back. I then "open" the nest box for morning. I know that is labor intensive, but chickens do train fairly well if treated consistently. Also, may just make an "x" over the opening with tape and remove it in the morning if you don't have a landing roost in front of your boxes that are easy to close. My eggs are generally very clean, but every once in a while, I need to train a hen that "forgets." Good luck.