The application of the most recent advances of the Internet-of-Things (IoT) technology to the automation of buildings is emerging as a promising solution to achieve greater efficiencies in energy consumption, and to allow the realization of sustainable models. The application of IoT has been demonstrated as effective in many fields, such as confirmed, for instance, by the Industry 4.0 concepts, which are revolutionizing modern production chains. By following this approach, the use of distributed control architectures and of IoT technologies (both wired and wireless) would result in effective solutions for the management of smart environments composed of groups of buildings, such as campuses. In this case, heterogeneous IoT solutions are typically adopted to satisfy the requirements of the very diverse possible scenarios (e.g., indoor versus outdoor coverage, mobile versus fixed nodes, just to mention a few), making their large-scale integration cumbersome. To cope with this issue, this paper presents an IoT architecture able to transparently manage different communication protocols in smart environments, and investigates its possible application for the monitoring and control of distributed energy resources in a smart campus. In particular, a use–case focused on the integration of the Long Range Wide Area Network (LoRaWAN) technology is considered to cope with heterogeneous indoor and outdoor communication scenarios. The feasibility analysis of the proposed solution is carried out by computing the scalability limits of the approach, based on the proposed smart campus data model. The results of the study showed that the proposed solution would be able to manage more than 10,000 nodes. An experimental validation of the LoRaWAN technology confirms its suitability in terms of coverage and latency, with a minimum LoRaWAN cell coverage range of 250 m, and a communication latency of about 400 ms. Finally, the advantages of the proposed solution in the supervision and management of a PV system are highlighted in a real-world scenario.