The Internet of Things (IoT) has experienced tremendous growth in recent years. The increase in the number of devices, greater miniaturization of computing capacity and virtualization techniques have favored its adoption in industry and other sectors. Likewise, the introduction of new technologies (such as Artificial Intelligence, 5G, Tactile Internet or Augmented Reality), together with the rise of edge computing, are paving the way, and formulating the requirements, for what is known as the Next Generation Internet of Things (NGIoT).These advances pose new challenges such as the establishment of proper architectures that meet those needs and, at the same time, are flexible, scalable, and practical for implementing services that bring value to society. In this sense, IoT could be a key element for policy and decision making. A very useful tool for this is the definition and calculation of composite indicators, which represent an impact on a real phenomenon through a single value. The generation of these indicators is an aspect promoted by official entities such as the European Union, although their automation and use in real-time environments is a rather uncharted research field. This type of indexes must follow a series of mathematical operations and formalities (normalization, weighting, aggregation...) to be considered valid. This doctoral thesis proposes the union of both fields, proposing a new generation Internet of Things architecture oriented to the calculation and prediction of composite indicators. Based on the candidate's experience in European and regional research projects, and building on open source technologies, the design, development and integration of the modules of such architecture (data acquisition, processing, visualization and security) has been included as part of the thesis. These approaches and implementations have been validated in five different scenarios, covering five composite indexes in environments with disparate requirements following a methodology designed during this work. The use cases are focused on sustainability aspects in urban and maritime-port environments, but it has been highlighted that the solution can be extrapolated to other sectors as it has been designed in an agnostic way.The result of the thesis has also been analyzed from the point of view of technology transfer. A tentative product definition has been formulated, as well as a possible financing in more advanced stages of maturity and its potential exploitation as a marketable element.