This work presents the efforts on optimizing energy consumption by deploying an energy management system using the current IoT component/system/platform integration trends through a layered architecture. LoBEMS (LoRa Building and Energy Management System), the proposed platform, was built with the mindset of proving a common platform that would integrate multiple vendor locked-in systems together with custom sensor devices, providing critical data in order to improve overall building efficiency. The actions that led to the energy savings were implemented with a ruleset that would control the already installed air conditioning and lighting control systems. This approach was validated in a kindergarten school during a three-year period, resulting in a publicly available dataset that is useful for future and related research. The sensors that feed environmental data to the custom energy management system are composed by a set of battery operated sensors tied to a System on Chip with a LoRa communication interface. These sensors acquire environmental data such as temperature, humidity, luminosity, air quality but also motion. An already existing energy monitoring solution was also integrated. This flexible approach can easily be deployed to any building facility, including buildings with existing solutions, without requiring any remote automation facilities. The platform includes data visualization templates that create an overall dashboard, allowing management to identify actions that lead to savings using a set of pre-defined actions or even a manual mode if desired. The integration of the multiple systems (air-conditioning, lighting and energy monitoring) is a key differentiator of the proposed solution, especially when the top energy consumers for modern buildings are cooling and heating systems. As an outcome, the evaluation of the proposed platform resulted in a 20% energy saving based on these combined energy saving actions.