From Smart Grids to Buildings to Cities