1. A method for balancing an energy storage system, the energy storage system comprising a plurality of connected battery cells, in a vehicle comprising an electric machine arranged for propulsion of the vehicle, the method comprising: monitoring a need for balancing of the cells; initiating a request for the balancing based on the operational condition related to the battery cells; discharging or charging the energy storage system until the state of charge of the energy storage system has reached a predetermined level; balancing the voltage of the battery cells when the state of charge of the energy storage system has reached the predetermined level; allowing input instructions representing a time schedule for the balancing upon initiating the request for balancing; and initiating the discharging or charging so that the energy storage system reaches the predetermined level of the state of charge in accordance with the input instructions.