If you prefer natural pest repellents in your home, the folks at The Kitchn have the ideal solution to keep houseflies away. The secret lies in cloves, or even just clove oil.
Apparently, flies hate the smell of cloves. Hanging whole ones in a small square of cheesecloth and putting it wherever flies congregate should be an effective way to keep those pesky flies away.
Since it's the smell of cloves that the flies don't like, we suggest taking the tip a step further and grinding them up to create an air freshener.