Yeah a building automation controller would do the trick. I program and troubleshoot some of the oldest and newest commercial controllers on the market. Residential isn't my strong suit but i dabble as a hobby in my home.
It could be possible with two relays,a temp sensor, and a hub like smart...