In this study, we model and solve the scheduling problem embedded in a home energy management system (HEMS), which enables users to overcome the major obstacles in implementing demand response programs. The problem aims to find the minimum energy cost while taking into account the time-varying prices, generation from renewable sources, usage demands for each appliance in household, battery storage capacity and grid constraints. Due to the uncertainties in supply, demand and electricity price, a stochastic optimization approach is utilized. A solution to the problem determines schedules of the operating periods of household appliances, charging cycles of battery storage and plug-in electric vehicles (EVs) and electricity purchase and sale periods for the following days in the decision horizon. We analyze both effects of different price tariffs on HEMS and conduct simulations in order to compare two cases for a green house in terms of energy consumption, where first case is when the house is supported by HEMS and the second one is when the house has no decision support system. Experimental results support the benefit of the usage of the proposed model in a HEMS.