The building energy flexibility potential of a Norwegian single-family detached house is investigated using predictive rule-based control (PRBC) and building performance simulation (using IDA ICE). Norwegian timber buildings are lightweight and four different insulation levels are considered. Both onoff and modulating air-source heat pumps are analyzed and compared to direct electric heating which is the most common heating system for Norwegian residential buildings. A detailed model for both the heat pump system and the building is implemented, a level of detail not found in previous research on building energy flexibility. The three PRBC investigated have the following objectives: reduce energy costs for heating, reduce annual CO2eq. emissions and reduce energy use for heating during peak hours. This last objective is probably the most strategic in the Norwegian context where cheap electricity is mainly produced by hydropower. The results show that the price-based control does not generate cost savings because lower electricity prices are outweighed by the increase in electricity use for heating. The implemented price-based control would create cost savings in electricity markets with higher daily fluctuations in electricity prices, such as Denmark. For the same reasons, the carbon-based control cannot reduce the yearly CO2eq. emissions due to limited daily fluctuations in the average CO2eq. intensity of the Norwegian electricity mix. On the contrary, the PRBC that reduces the energy use for heating during peak hours turns out to be very efficient, especially for direct electric heating. For air-source heat pumps, the control of the heat pump system is complex and reduces the performance of the three PRBC. Therefore, results suggest that a heat pump system should be modeled with enough detail for a proper assessment of the building energy flexibility. First, by varying temperature set-points there is a clear interaction between the prioritization of domestic hot water and the control of auxiliary heaters which increases energy use significantly. Second, the hysteresis of the heat pump control and the minimum cycle duration prevent the heat pump from stopping immediately after the PRBC requires it. Finally, the paper shows that the influence of thermal zoning, investigated here by cold bedrooms with closed doors, has a limited impact on the building energy flexibility potential and the risk of opening bedroom windows.