A pot of basil on the windowsill keeps flies out of the kitchen.
Against flies: fill a transparent Sandwich bags or freezer bag with water and hang in the door and window opening. For some reason flies won't enter, mosquitoes do :(
As many have trouble flying into your house then place in places where you do not suffer wild they keep them out nettles.
Take a walnuts branch and hang it on the open window / door. Walnut emit an odor which is perceived as annoying fly.