Using templates to set temperature for Thermostat

Also take a look at Schedy, might be of use for you: