At a global level, buildings constitute one of the most significant energy-consuming sectors. Current energy policies in the EU and the U.S. emphasize that buildings, particularly those in the residential sector, should employ renewable energy and storage and efficiently control the total energy system. In this work, we propose a Home Energy Management System (HEMS) by employing a Model-Based Predictive Control (MBPC) framework, implemented using a Branch-and-Bound (BAB) algorithm. We discuss the selection of different parameters, such as time-step, to employ prediction and control horizons and the effect of the weather in the system performance. We compare the economic performance of the proposed approach against a real PV-battery system existing in a household equipped with several IoT devices, concluding that savings larger than 30% can be obtained, whether on sunny or cloudy days. To the best of our knowledge, these are excellent values compared with existing solutions available in the literature.