Cities and communities drive the transformation of the global energy system. The shift to more distributed generation and electrification, in the form of rooftop solar panels, wind power and electric vehicles, is developing across the world. This brings new challenges when managing the energy system. Fortunately, digitisation and automation offer solutions to do this in a smart way.