You may have to replace the sensor but first you can try a reset by turning the unit off at the switch on the gas valve wait a minute then turn the switch back on.
Honeywell water heater gas control valve reset.
Turn the gas control dial to off and let sit for one minute.
Keep track of which front is which.
After resetting it several times and bypassing the thermal switch i noticed.
If your water heater does not begin working or another lock out condition occurs have a competent hot water heating specialist diagnose the system and make repairs.
If the pilot remains lit you will need to replace the gas control valve.
Slide the ribbon of wires out of the clip on the housing and the front of the gas valve is free.
Repeat these steps with the new gas valve.
If you have a power vented unit a 7 flash is a flammable vapor sensor error.
8 reset gas valve this will only appear after the gas valve has been shutoff and continues to produce a current to the thermopile.
The water heater s gas valve is located near the bottom of the unit and connects to your home s natural gas line.
Turn the water heater s gas valve switch to the off position wait for a few seconds and then flip the switch to the on position to reset the system.
Reverse the above steps to mount the new front onto the old back that s still hooked to the water heater.