I'm pretty sure humans understood taking advantage of sunlight to warm structures since the earliest structures. Most animals understand the sunlight/shade difference. The aztecs, egyptians, etc..