Sustainability is one of the main goals to pursue in several aspects of everyday life; the recent energy shortage and the price raise worsen this problem, especially in the management of energy in buildings. As the Internet of Things (IoT) is an assessed computing paradigm able to capture meaningful data from the field and send them to cloud infrastructures, other approaches are also enabled, namely model-based approaches. These methods can be used to predict functional and non-functional properties of Building Energy Management Systems (BEMS) before setting up them. This paper aims at bridging the gap between model-based approaches and physical realizations of sensing and small computing devices. Through an integrated approach, able to exploit the power of different dialects of Petri Nets, this paper proposes a methodology for the early evaluation of BEMS properties as well as the automatic generation of IoT controllers.