Currently, enhancing sustainability, and in particular reducing energy consumption, is a huge challenge for manufacturing enterprises. The vision of the fourth industrial revolution (so-called “industry 4.0”) is not only to optimize production and minimize costs, but also to reduce energy consumption and enhance product life-cycle management. To address this challenge, a multi-agent architecture aimed at elaborating predictive and reactive energy-efficient scheduling through collaboration between cyber physical production and energy systems is proposed in this paper. Smart, sustainable decision tools for cyber physical production systems (CPPS) and cyber physical energy systems (CPES) are proposed. The decision tools are data-driven, agent-based models with dynamic interaction. The main aim of agent behaviours in the cyber part of CPPS is to find a predictive and reactive energy-efficient schedule. The role of agents in CPES is to control the energy consumption of connected factories and switch between the different renewable energy sources. Dynamic mechanisms in CPPS and CPES are proposed to adjust the energy consumption of production systems based on the availability of the renewable energy. The proposed approach was validated on a physically distributed architecture using networked embedded systems and real-time data sharing from connected sensors in each cyber physical systems. A series of instances inspired from the literature were tested to assess the performance of the proposed method. The results prove the efficiency of the proposed approach in adapting the energy consumption of connected factories based on a real-time energy threshold.