Traditional power grid and its demand-side management (DSM) techniques are centralized and mainly focus on industrial consumers. The ignorance of residential and commercial sectors in DSM activities degrades the overall performance of a conventional grid. Therefore, the concept of DSM and demand response (DR) via residential sector makes the smart grid (SG) superior over the traditional grid. In this context, this paper proposes an optimized home energy management system (OHEMS) that not only facilitates the integration of renewable energy source (RES) and energy storage system (ESS) but also incorporates the residential sector into DSM activities. The proposed OHEMS minimizes the electricity bill by scheduling the household appliances and ESS in response to the dynamic pricing of electricity market. First, the constrained optimization problem is mathematically formulated by using multiple knapsack problems, and then solved by using the heuristic algorithms; genetic algorithm (GA), binary particle swarm optimization (BPSO), wind driven optimization (WDO), bacterial foraging optimization (BFO) and hybrid GA-PSO (HGPO) algorithms. The performance of the proposed scheme and heuristic algorithms is evaluated via MATLAB simulations. Results illustrate that the integration of RES and ESS reduces the electricity bill and peak-to-average ratio (PAR) by 19.94% and 21.55% respectively. Moreover, the HGPO algorithm based home energy management system outperforms the other heuristic algorithms, and further reduces the bill by 25.12% and PAR by 24.88%.