I write this to (hopefully) add a little bit of information. I am a retired Mechanical Engineer and not an Electrician or Plumber). Our fireplace had the same intermittent problem. The fireplace has a standing (lit all of the time) pilot. The flame from the pilot light heats a thermocouple that provides millivolt power to the switch on the wall. Of course, this millivolt power opens the gas valve when the switch closes. I recently learned are while this switch LOOKS like a $4.00 rectangular decora switch it actually should be a more costly $20 millivolt switch probably with less resistance. Skytech sells this millivolt switch, a timer switch, or a remotely controlled switch for this application. Now, to be perfectly honest, i bought the special millivolt timer and the measured resistance across its internal switch but it didn't seem much different than a regular $4.00 decora switch. Still, I can imagine the Skytech switch has a genuine purpose beyond my understanding. While installing the timer, I decided to lightly sand the 15-year accumulation of residue (carbon?) off of the thermocouple. Since I replaced the switch and cleaned t
he thermocouple, the fireplace always starts. I suspect that my repair had more to do with cleaning the thermocouple off than changing the switch. Most repair guys (as noted by a previous writer) would replace the thermocouple (which is reasonable). This is is more of an a/c or fireplace repair guy's area of expertise than an electrician's.