Try this and let us know how it works for you. … It certainly did work for me and it is easy to test.
Lavender !! … A couple years ago I have a big fly problem under my back porch. Flies by the hundreds were under the roof. I found that flies don’t like the smell of Lavender, so I plugged in a Glade air freshener with pure Lavender scent to test. The swarm soon left the area. I still had an occasional fly coming by, but he usually don’t stay very long. … It worked for me very well!
This year I haven’t had to need to plug in the glade yet and I’ve been looking to plant a couple of Lavender bushes around the back of the house as a more long term solution to keep flies away from and out of the house.