I got just what you need and it works great.
The potato works great.
Prevent indoor entry of gnats by making sure there is no open windows open without screens on. Aug is a bad time for them as they are worst that time of the year.
Put sticky traps on the soil surface to trap the gnats
Put potato slices on the surface of the soil. The larvae like it and will be drawn to it… After about 4 to 5 days, remove the potato slices with the larvae. To get rid of them you can do a lot of things like either use a NO pest strip, neem oil or putting sand on the surface of the soil will suffocate the eggs and get rid of them as well. Tobacco juice kills them, and works well for re-occurrences!
They can be in or on the soil and can fly. In order to get rid of them you can use neem oil, sand or perlite on the surface again kills them, and no pest strips catch the ones that fly. A chemical product called Zone works very well and is very powerful and works well in Hydroponics/Aeroponics!
Other Products which can be used in Hydroponics/Aeroponics and soil are:
Safer Yard & Garden Insecticide
GNATROL( used in Hydroponics/Aeroponics in the water as well as soil),
Safer Sticky Stakes,
Hot Pepper Wax
Doc’s Neem Pest Soap
Safer’s Insecticidal Soap