In the past, the main reason for the large scale integration of PV plants at consumer level was a potential profit guaranteed through feed-in tariffs. With this incentive mechanism and significant battery storage installation costs, there wasn’t any motivation for the consumers to integrate energy storage to balance out the mismatch between local generation and demand. With the significant cost reduction of PV modules and falling costs of battery storage, these technologies become more attractive. By integrating these technologies together with the other distributed generation resources available at the consumer level, we can reduce grid supply costs and use this to finance such projects. In order to achieve such cost reduction, available production and storage resources need to be scheduled in optimal manner. This paper describes an optimization model for the optimal scheduling of distributed generation and battery storage in order to assure minimal supply costs for the grid connected consumer. The model is casted as MIP and verified through year-scale simulations based on the actual electricity consumption data, electricity price and PV plant production data for University building.