I have them very close to my whiteworm cultures -a great conditioning food for fish breeding. I used to have a lot of trouble with fungus gnats getting into the cultures, but when I see a few, I open the lids and allow them to explore the sundew and the Nepenthes. The flies seem fatally attracted to the plants, and that has allowed me to keep the cultures thriving when in the past, measures to stop the tiny fly populations would periodically cripple the cultures.
I also use window fans in the fishroom in summer (it's in the garage, not the house), and when the fans aren't spinning small gnats and mosquitoes get through the grates in them. There's a spider up in the corner who chips in, but if you were to walk into the fishroom now, you would think flying bugs were simply unknown in there.
Do you think misting the plants might help? I don't have an automatic system.