Energy storage thermostat