This chapter deals with hierarchical model predictive control (MPC) of smart grid systems. The design consists of a high-level MPC controller, a second level of so-called aggregators,which reduces the computational and communication related load on the high-level control, and a lower level of autonomous consumers. The control system is tasked with balancing electric power production and consumption within the smart grid, and makes active use of the flexibility of a large number of power producing and/or power consuming units. The load variations on the grid arise on one hand from varying consumption, and on the other hand from natural variations in power production from e.g. wind turbines. The consumers represent energy-consuming units such as heat pumps, car batteries etc. These units obviously have limits on how much power and energy they can consume at any given time, which impose constraints on the optimisation taking place at the higher levels of the control system. This chapter presents a novel method for computing the aggregated constraints without approximation, yielding better utilisation of the units when the load variations are large. The method is demonstrated through simulation of a smart grid containing consumers with very different characteristics. It is demonstrated how the novel aggregation method makes it possible for the top level controller to treat all these as one big consumer, significantly simplifying the optimisation.