In this study, we investigate the operation of an optimal home energy management system (HEMS) with integrated renewable energy system (RES) and energy storage system (ESS) supporting electricity selling functions. A multi-objective mixed integer nonlinear programming model, including RES, ESS, home appliances and the main grid, is proposed to optimize different and conflicting objectives which are energy cost, user comfort and PAR. The effect of different selling prices on the objectives is also considered in detail. We further develop a formula for the lower bound of energy cost to help residents or engineers quickly choose best parameters of RES and ESS for their homes during the installation process. The performance of our system is verified through extensive simulations under three different scenarios of normal, economic, and smart with different selling prices using real data, and simulation results are compared in terms of daily energy cost, PAR, user's convenience and consecutive waiting time to use appliances. Numerical results clearly show that the economic scenario achieves 51.6% reduction of daily energy cost compared to the normal scenario while sacrificing the user's convenience, PAR, and consecutive waiting time by 49%, 132%, and 1 hour, respectively. On the other hand, the smart scenario shows only slight degradation of user's convenience and PAR by 2% and 18%, respectively while achieving 46.4% reduction of daily energy cost and the same level of consecutive waiting time. Furthermore, our simulation results show that a decrease of selling prices has tiny impacts on PAR and user comfort even though the daily energy cost increases.