Method for operating a power plant to provide ancillary services functionality to an electrical grid, the power plant comprising a group of wind turbine generators (10a,b) arranged for supplying power to an electrical grid, an energy storage system comprising at least one energy storage device arranged for supplying power to the electrical grid, and a power plant controller, the method comprises the power plant controller implementing the following: - receiving state information regarding the group of wind turbine generators (10a,b) supplied by at least one sensor, state information regarding the energy storage system supplied from at least one sensor, and configuration data on the power plant characterized by - receiving measurement sets and set points of at least one electrical parameter from the electrical grid, - deriving a plurality of ancillary service output signals for the plurality of ancillary services algorithms (511, 521, 551, 561, 571) for providing ancillary service functionalities to the electrical grid using the measurement sets and set points of the at least one electrical parameter, - selecting one of the derived ancillary service output signals as the overall power plant reference value for the power plant depending on the received state information regarding the group of wind turbine generators (10a,b) and the energy storage system, and the received configuration data on the power plant, - calculating, based on the overall reference value, a first control reference signal for the group of wind turbine generators (10a,b) and a second control reference signal for the at least one energy storage device, and - dispatching the first control reference signal to the group of wind turbine generators (10a,b) and the second control reference signal to the at least one energy storage device. - receiving state information regarding the group of wind turbine generators (10a,b) supplied by at least one sensor, state information regarding the energy storage system supplied from at least one sensor, and configuration data on the power plant characterized by - receiving measurement sets and set points of at least one electrical parameter from the electrical grid, - deriving a plurality of ancillary service output signals for the plurality of ancillary services algorithms (511, 521, 551, 561, 571) for providing ancillary service functionalities to the electrical grid using the measurement sets and set points of the at least one electrical parameter, - selecting one of the derived ancillary service output signals as the overall power plant reference value for the power plant depending on the received state information regarding the group of wind turbine generators (10a,b) and the energy storage system, and the received configuration data on the power plant, - calculating, based on the overall reference value, a first control reference signal for the group of wind turbine generators (10a,b) and a second control reference signal for the at least one energy storage device, and - dispatching the first control reference signal to the group of wind turbine generators (10a,b) and the second control reference signal to the at least one energy storage device.