Coolant temp gauge only comes on now and then. Is this a bad sensor? on 2007 Chevrolet HHR

Rookie cbe0621eac06868b3efe0d8d1d3611e23c60d3114864ea2ec19a68cfbd3eebab
does this need cleaned? The a/c does not work if the coolant temp gauge is not working.
(2) Answers
(1) Comments
I had the same problem. I replaced the thermostat and that fixed the problem. The new thermostat will remain open when they mess up. Mine also said coolant temp low. Hope this helps.