Demand-side management has emerged as a key strategy to enhance the flexibility and re-
liability of modern power systems, particularly in the context of the increasing penetration of
renewable energy sources. This is achieved by leveraging the flexibility of a wide range of dis-
tributed energy resources. The aggregated control of such devices can provide valuable services
to the grid (e.g. load shaping, frequency regulation, or congestion management), thus con-
tributing to system stability and economic efficiency. In demand-side management applications,
the number of controllable devices is typically very large, which naturally motivates the use of
mean-field control (MFC). Optimal transport (OT) provides an intuitive approach for modeling
the evolution of the aggregate distributions considered in the MFC.
We develop a tractable optimization framework for the real-time coordination of heteroge-
neous loads (e.g. electric vehicles and water heaters), combining ideas from OT and MFC. We
first extend the framework of Moment Constrained Optimal Transport for Control (MCOT-
C) to a heterogeneous setting. We then propose a model predictive control approach where
the agents' data is progressively discovered during the day. The proposed approach is validated
through numerical experiments on real datasets for electric vehicles and water heaters,
demonstrating the effectiveness of this method in imposing global restrictions while preserving
agent-level dynamics. The results show an emerging phenomenon with each system adapting
to the (lack of) flexibility of the other. This proves to be very beneficial compared to a separate
optimization of the different populations.

