I have had collegues that did entire PHD's on this topic with giant simulations and machine learning... It's just to say that this is a very difficult problem to solve exactly, so go easy on yourself and find a simple approximation or something good enough to get you the edge on the prices you pay for heating. I see some good ideas in the comments already, but keep it simple is my best advice.