Keep plants that flies dislike at the entrance doors. Some herbs and plants repel flies just by the mere fact of growing near a door. Mint is one such plant––place it in large pots next to the front and back doors to act as a possible deterrent barrier.[4] It's not guaranteed but it can serve as at least one way to shoo those flies outside.
If there are flies in the kitchen, crushed mint placed on your kitchen bench may help to deter them from sitting around the food preparation areas, while growing basil can also deter them from the kitchen.[5]
Other plants that can work well provided they're bruised a lot, include sprigs of lavender leaves, tansy, pennyroyal or rue in a vase.[5] Castor oil and tomato plants are also said to keep away flies.[2] Lad's love, the original source of pyrethrum,[4] can be used as a fly deterrent. Place bunches of this into vases with water and keep around the house. The aroma of lad's love outlasts its life, so keep dried sprigs in place.