Photovoltaic generation has arisen as a solution for the present energy challenge. However, power obtained through solar technologies has a strong correlation with certain meteorological variables such as solar irradiation, wind speed or ambient temperature. As a consequence, small changes in these variables can produce unexpected deviations in energy production. Although many research articles have been published in the last few years proposing different models for predicting these parameters, the vast majority of them do not consider spatiotemporal parameters. Hence, this paper presents a new solar irradiation forecaster which combines the advantages of machine learning and the optimisation of both spatial and temporal parameters in order to predict solar irradiation 10 min ahead. A validation step demonstrated that the deviation between the actual and forecasted solar irradiation was lower than 4% in 82.95% of the examined days. With regard to the error metrics, the root mean square error was 50.80 W/m(2), an improvement of 11.27% compared with the persistence model, which was used as a benchmark. The results indicate that the developed forecaster can be integrated into photovoltaic generators' to predict their output power, thus promoting their inclusion in the main power network. (C) 2021 Elsevier Ltd. All rights reserved.