Oh blah, I know exactly what you are talking about. When I had my small nursery and would ready the seedlings to grow for the clients later in the spring, I would get these, think they are called mould gnats (also known as fungus gnats, I prefer to call them mould gnats) and they are a pain in the butt. They would be attracted to the moist soil, particularly is the seedlings had been grown for a longer period of time. Sometimes when one is working with "sunshine" mix type growing mediums (soiless mediums they are called), there is an algae that forms on it, kind of slimey. Comes from the low pH of the soil, which is made mostly of spaghnum peat moss, some pearlite and other components. They love the black slime and that is when I would have the problem. It never became so bad I couldn't stand it, but it was just part of what happens when one is growing young plants in this type of medium for a long time.
I am wondering what you are using for your soil for your plants. You indicated that you sterilize your soil. Lends me to think it is soil you have obtained from outside for your plants?
In all honesty, how many plants do you have? Do you have few enough that you could change the entire soil medium and start out with fresh. I know you mentioned that that would be a whole lotta work. But I think this is what you will need to do. It may save you a whole lotta grief further down the road.
What type of potting soil are you using? Perhaps if it is one that too much peat moss in it, get a different type that has less of this. Peat moss is notorious for having a very low pH, you may have to alter the pH of the soil by raising it a little bit. That would cause less algae to grow on the soil. I am sure this is what the little boogers are attracted to. Also, I think that you are over watering the plants.
More clearly define what type of soil you have. I had the problems with the algae forming because there were certain young seedlings that needed to have been kept moist, very moist, with no drying out. As opposed to many that should have a fair amount of drying soil out and then watering deeply. These were the plants affected with the mold nats. A dang nuisance.
Back in my old life my house was full of houseplants, some very old ones, some not so old. I did not EVER once have a problem with any kind of mould knat inside. I think this is because I basically NEGLECTED the houseplants, as far as watering would go. Seriously....I know that plants that are grown inside require less watering. They don't have the wind to evapourate the moisture and tend to have a more stagnant air circulation, hence less evapouration than outside. When I watered my houseplants, and have had them for nigh onto 40 years of living with houseplants, so kind of have an idea of what I am talking about, if anything I have under-watered my houseplants. I would water no often than every couple of weeks, at the miniumum. Some plants only received water every month. Keeping soil moist in the inside environment for plants can be one of the worst things for them. Plants (and you don't have to believe this as gospel, I do not purport to know everything, am only citing my experience here), for optimum root growth and vegetative growth should have the appropriate water conditions for their environment. For example, if a plant is kept moist all the time, the roots will not grow properly, as they will not be growing to search for water. Another opposite example. A plant that needs to search for water will have great and lovely roots. Ones that will sustain that plant, keep it strong, have lots of roots to absorb water and nutrients. The older a plant gets, the less water it needs, if it has been nurtured properly from the beginning. A healthy, older plant will have a beautiful root system, that when watered, will have all those strong roots to gather the water nutrient to live. A plant that has no root system, by improper care, will need more water (and will not be able to use it very well) because it has a very small root system. I don't know if this makes sense, but it is what it is. That is why my plants go easily go well over 2 weeks (most of them that is) with only a deep watering, every now and then. That is because they were in the appropriately sized containers that they could grow great and massive roots, to absorb water and nutrients with great big root systems. Another thing, water less in the winter, when temperatures are cooler, most people over water in the wintertime, bad, bad, careful of overwatering. I have rambled on enough.
Hope you get the problem solved. I too would hang the sticky traps for the flies. I never bothered in the greenhouse, the flies only affected certain areas and then those plants eventually went outside anyways, just a pain in the rear for sure though. Keep us posted on how things work out for you. Have a wonderful day, CynthiaM.
Here is a link to a forum that discusses the fungus knat (I call it mould knat), it is interesting, read the discussion, you will become better informed by others that keep plants in the house
[You must be registered and logged in to see this link.]