I've been having problems with wasps and carpenter bees for a long time, and suddenly this week, flies.
After some research, I found some studies about the first two. Apparently carpenter bees don't like citrus. Wasps are repelled by peppermint, or a mix of lemongrass, geranium, and cloves...