Take the code from this post, change the code to set the temp on the thermostat instead of setting the fan to ‘on’. Should get you going