Buildings and other man-made structures consume 30–40% of the primary energy for heating, cooling, ventilation and lighting. This phenomenon will increase with the growth of the population and the associated energy consumption 28. The ability to reduce energy consumption has become an urgent priority. The successful design and preparation of a novel smart window that combines energy-saving and electricity generation achieves comprehensive utilization of solar energy, which supports an important new insight into resolving the energy consumption.