Sure my code is here. Enjoy...let me know if you have any questions.
I also wrote two smart apps
To set a mode on schedule, I implemented two schedules in this version M-F and S-S
Set mode when temp is reached...untested....i don't use this one so much.