The advanced communication and control technologies in smart grids enable end users to actively participate in balancing supply and demand in response to electricity tariff changes by controlling their electricity consumption through demand response (DR) programs. In order to further exploit the cost saving potential in residential houses, home energy management (HEM) systems have gained increasing interest, particularly in the last decade. HEM system basically focuses on the control of home appliances to reduce their electricity usage or to shift the operations of predefined appliances to the periods with lower prices. However, the integration of local renewable generation units to the residential houses considerably complicates the tasks of HEM systems. This study, therefore, proposes a novel dynamic HEM approach capable of integrating both load and source side dynamics into decision-making process. In the new HEM approach, power consumption of appliances, electricity tariff and power from renewable sources are dynamically taken into account with a 5-min time step. A forecasting model is incorporated into the HEM system for better matching of energy consumption to renewable energy generation. The simulation and experimental results show that the proposed HEM system considerably improves cost savings for residential prosumers and can be implemented in real-world applications. (C) 2017 Elsevier Ltd. All rights reserved.