Thanks for the version 3. and for the logic on how to cure the issue.
The flag concept makes sense and will try to work some code .
I uploaded your ver3 to my esp and it runs with no errors, however,
the heater stat never changes.
if i set temp way up or - super cool - stat of heater is always on.
TIMER APPROACH
I did the timer thing on the ON and OFF button, but obviously not right. I can turn the heater on and it stays on , I can also turn off the heater fan but after that the set temp never works...
Joe