A court may dismiss any action in which a person is prosecuted for operating a vehicle in violation of Section 27150 or 27151 if a certificate of compliance has been issued by a station pursuant to Section 27150.2, or if the defendant had reasonable grounds to believe that the exhaust system was in good working order and had reasonable grounds to believe that the vehicle was not operated in violation of Section 27150 or 27151.
Ca. Veh. Code § 27150.7