We present a methodology based on mixed-integer nonlinear model predictive control for a real-time building energy management system in application to a single-family house with a combined heat and power (CHP) unit. The developed strategy successfully deals with the switching behavior of the system components as well as minimum admissible operating time constraints by use of a special switch-cost-aware rounding procedure. The quality of the presented solution is evaluated in comparison to the globally optimal dynamic programming method and conventional rule-based control strategy. Based on a real-world scenario, we show that our approach is more than real-time capable while maintaining high correspondence with the globally optimal solution. We achieve an average optimality gap of 2.5% compared to 20% for a conventional control approach, and are faster and more scalable than a dynamic programming approach.