This paper represents an optimization-based home energy management system, by taking advantages of renewable resources and energy storage system for optimally managing the energy consumption and generation of the house. The surplus of renewable generation will be stored in energy storage system or will be injected into the main grid. An optimization algorithm is developed for this system in order to minimize the electricity bill of the house considering electricity tariffs. Four home appliances are considered to be controlled by this system for reducing the consumption in critical periods. The outcomes of optimization problem would be the optimal scheduling of the resources including renewable generations, energy storage system, consumption reduction, and power transactions with the grid. In the case studies, the developed model will be employed in three different scenarios, which considers simple electricity prices and time-of-use tariffs in order to test and validate the performance of the developed model.