Re: Thermostat
![Post Post](./styles/FLATBOOTS/imageset/icon_post_target.gif)
If you want to switch to manual control, just disable your timer to stop it keeping on re-reading the sensor and doing any more logic comparisons...
To Disable timer:
timer 0
-->
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.com/
To Disable timer:
timer 0
memclear
SERIALPRINTLN "restart page"
cls
let curr = 0
let setp = 30
let stat = On
Print "ESP8266 WiFi Thermostat "
print
Button "Setpoint", [setpt]
textbox setp
wprint "<br>"
wprint "CurrTemp="
wprint htmlvar(curr)
wprint "<br>"
wprint "Heater="
wprint htmlvar(stat)
wprint "<br>"
button "Exit", [quit]
timer 4000, [refresh]
wait
[on2]
io(po,16,1)
SERIALPRINTLN "PIN 2 ON"
let stat = "On"
returngui
Wait
[off2]
io(po,16,0)
SERIALPRINTLN "PIN 2 OFF"
let stat = "Off"
returngui
Wait
[setpt]
returngui
Wait
[refresh]
curr = temp(0)
SERIALPRINTLN curr
if curr < setp then goto [on2] else goto [off2]
Wait
[quit]
timer 0
wprint "<a href='/'>Menu</a>"
end