Today, climate change combined with the energy crisis is accelerating the worldwide adoption of renewable energies through incentive policies. However, due to their intermittent and unpredictable behavior, renewable energy sources need EMS (energy management systems) as well as storage infrastructure. In addition, their complexity requires the implementation of software and hardware means for data acquisition and optimization. The technologies used in these systems are constantly evolving but their current maturity level already makes it possible to design innovative approaches and tools for the operation of renewable energy systems. This work focuses on the use of Internet of Things (IoT) and Digital Twin (DT) technologies for standalone photovoltaic systems. Based on Energetic Macroscopic Representation (EMR) formalism and the Digital Twin (DT) paradigm, we propose a framework to improve energy management in real time. In this article, the digital twin is defined as the combination of the physical system and its digital model, communicating data bi-directionally. Additionally, the digital replica and IoT devices are coupled via MATLAB Simulink as a unified software environment. Experimental tests are carried out to validate the efficiency of the digital twin developed for an autonomous photovoltaic system demonstrator.