This lecture presents a project in progress at Zurich University of Applied Science in Winterthur, focusing on coordinating different sub-systems in a cost-optimal way within a smart grid lab. The project involves implementing an energy management system that considers forecast predictions for wind, PV, load, and prices for the next 24 hours, using real devices and emulated devices controlled by PLC. The optimization is implemented using MATLAB and the Gurobi solver, with plans to develop a graphical user interface for students to interact with the system and to enhance the optimization process by considering uncertainties.