This paper focuses on developing an interdisciplinary mechanism that combines machine learning, optimization and data structure design to build a demand response and home energy management system that can meet the needs of real-life conditions. The loads of major home appliances are divided into three categories containing fixed loads, regulate-able loads, and deferrable loads, based on which a decoupled demand response mechanism is proposed for optimal energy management of the three categories of loads. A learning-based demand response strategy is developed for regulate-able loads with a special focus on home HVACs (heating, ventilation and air conditioning). The paper presents how a learning system should be designed to learn energy consumption model of HVACs, how to integrate the learning mechanism with optimization techniques to generate optimal demand response policies, and how a data structure should be designed to store and capture current home appliance behaviors properly. The paper investigates how the integrative and learning-based home energy management system behaves in a demand response framework. Case studies are conducted through an integrative simulation approach that combines a home energy simulator and MATLAB together for demand response evaluation.Index Terms -smart grid, demand response, home energy management, neural network, regression, optimization, dynamic electricity price, building energy consumption.