Making a smarter thermostat

GOAL: Use CoRE to average temperature across various sensors and adjust thermostat accordingly.

I do not have a Nest Thermostat, or an Ecobee, that can do this out of the box. What I would like to do is enable my $100 wifi thermostat to be as smart as these $200+ thermostats using CoRE. I know it’s possible, but I’m having trouble thinking outside of the box enough to finish the rules in CoRE.

Initially, my thought was to poll the temperature sensors I want to average every X minutes, and then move the temperature up or down 1 degree accordingly. My thoughts are that this might create an issue, i.e. the poll times are not set often enough, or too often, and the temperature keeps increasing by 1 degree until the thermostat is now set for 100 degrees.

So I would have to set a limit on the thermostat, or a target temperature. It’s a complex setup, just looking for some help brainstorming.

Currently, I have rules setup to decide, based on outdoor temperature, to set the thermostat to heat or cool at X degrees. Just need to average the temperature within those rules, and perhaps adjust that rule, because every 10 minutes it will reset the temperature on the thermostat back to that X target.

Thanks!