> A talented high school student can write one today, and do it with a Rasberry Pi and for much less than $1 million (more like 5-10K).
Yes, writing a bang-bang controller would be trivial. Even some kind of PID controller wouldn't be too hard for an enterprising high schooler to try.
What makes the professional systems valuable is that they can build much more accurate models of how the building heats and cools. These models depend on the building's geometry, usage patterns, outside climate, etc., and are notoriously hard to produce. However, they can produce meaningful savings over long time periods since they ultimately use less energy due to the quality model.