The integration of renewable energy sources together with an energy storage system into a distribution network has become essential not only to maintain continuous electricity supply but also to minimise electricity costs. The operational costs of this paradigm depend highly upon the optimal use of battery energy. This paper proposes day-ahead scheduling of the battery energy while considering its degradation costs due to charging-discharging cycles. The degradation costs with respect to the depth of charge are modelled and added to the objective function to determine the actual operational costs of the system. A framework to solve the function is developed in which particle swarm optimisation, the Rainflow algorithm and scenario techniques are integrated. Uncertainties of parameters, modelled by scenario generation and reduced by scenario reduction techniques, are discussed. Simulation results demonstrate that the proposed method can reduce the operational costs by around 40% compared to the baseline method. They also reveal that uncertainty in power generation and power demand has no influence on the energy schedule of the battery, but variation in electricity prices has an impact on the outcome. Several pragmatic tests verify the effectiveness of the proposed method.