People in developed countries spend today most of their time inside buildings as part of the modern way of life. As a result, the building sector accounts for almost 40% of the total energy consumption and a big part of the energy bill goes to maintain the visual and thermal comfort of their occupants. At the same time, awareness is being raised during the last decades about the greenhouse gas emissions and the possibly irreversible effects of global warming; both linked to excessive use of non-renewable primary energy sources which still power most of the world, including our buildings. Thus, moderating the energy consumed in them is a top priority. However, this does not imply a horizontal cut in energy consumption that would result in a drop of user comfort. Instead, we suggest that improving energy efficiency in buildings while maintaining or even improving the user comfort is the optimal solution. It is indeed the core of this thesis that there is a great energy saving potential in refining the control of building systems such as electric lighting, heating, cooling and ventilation, which more than often consume a lot of energy without delivering the analogous amount of visual and thermal comfort. In this direction, this thesis proposes the development of a novel predictive control algorithm for the control of electrochromic glazing using a low cost sky scanner using a simple web camera. The developed algorithm demonstrated an average prediction accuracy of 92% and integrates and controls the blinds and electric lighting to maximise visual comfort taking into account outdoor and indoor conditions, presence and user actions. Measurements and extensive simulations showed that the elaborated algorithm improves thermal and visual comfort when compared to standard glazing coupled with blinds and exhibits acceptable levels of energy consumption for space heating and electric lighting. In the same subject of improving building control, a novel approach for controlling building systems by using state-based stochastic data-driven models to identify "season" is defined and developed. We reason that the season variable is unique to every building and it depends on weather conditions, user behaviour and building construction. The developed models identified "season" with an accuracy that ranged from 69 to 91% and it was shown through simulations that a controller based on Hidden Markov Models can reduce energy demand for heating and improve the thermal comfort of occupants in different building construction types. Finally, the use of Hidden Markov Models was further explored in this thesis by suggesting a novel model for the estimation of occupants' visual comfort in buildings. The proposed model is based on horizontal workplane illuminance measurements using ceiling-mounted sensors as well on vertical illuminance monitoring at the observer's eyes plane (pupillary illuminance) by means of wearable portable sensors. We argue that the proposed model improves greatly over the various existing discomfort glare indices and metrics and it is also convincingly demonstrated that it can be seamlessly integrated and used in building automation systems based on fuzzy logic.