## 1 Introduction  
Climate change and the urgency to reduce greenhouse gas emissions have led to the transformation towards a more sustainable and ecosystem-friendly energy system becoming a global priority. In this context, the electricity sector plays a key role, as it is responsible for a large part of these emissions at a global level [1]. It is therefore crucial to boost the use of renewable energy sources in order to reduce emissions. For example, Spain, like many other countries, has set ambitious targets in this respect, aiming to generate 74% of its electricity from renewable sources by 2030 [2].  
Figure 1 shows the evolution of demand coverage in Spain over the last few years.  
This article covers the critical aspects that enable these objectives to be achieved, including an analysis of both current energy consumption and the functioning of the electricity market, in order to understand how the demand and price of energy is managed. It also examines the role of renewables in the European context together with the current tariff situation, which is crucial to understanding the conditions faced by consumers. The importance of correctly calculating PV installations and properly predicting solar radiation is also highlighted, as these are key factors in optimizing the integration of solar energy into the electricity system. It also emphasizes the need for accurate matching of energy consumption and production to avoid imbalances in the electricity grid. Then, the developed tool is presented. It helps consumers to select the most appropriate tariff according to their needs and assesses the profitability of a photovoltaic installation. Finally, the conclusions develop the results obtained and put forward recommendations to move towards a more sustainable energy system.  
However, the path towards the full integration of renewables into the electricity system presents multiple challenges and considerations. One crucial aspect is the ability of homes and buildings to achieve energy self-sufficiency, especially through the installation of photovoltaic systems of rooftops. A detailed analysis reveals that energy planning must consider not only annual data, but also hourly data for more accurate forecasting and planning [4]. In addition, compensation policies play a key role in the economic viability of these installations, with significant implications for the use of available roof pace.  
The current situation, marked by the COVID-19 pandemic and volatile energy prices, has highlighted the need to accelerate the transition towards a cleaner and decentralized energy model. The integration of renewable energies, including solar photovoltaics, is presented as a key solution in this context [5]. Experiences such as the implementation of energy communities in vulnerable areas have proven to be viable models, highlighting the importance of citizen participation and the development of appropriate policies.  
Spain's photovoltaic sector, for example, emerges as a significant opportunity for economic recovery and meeting sustainability goals [6]. However, detailed strategic analysis is required to identify challenges and opportunities, as well as to develop effective short-, medium- and long-term strategies. Advances in solar PV forecasting techniques, especially those based on artificial intelligence and machine learning, promise to improve the accuracy and efficiency of these systems, paving the way for a successful and sustainable energy transition [7].