An optimization method for optimizing the use of a generator unit in a power station that is arranged to produce electrical energy and to deliver it to a network and that includes, in addition to the generator unit, both a solar panel and a battery, the battery storing a fraction of an electrical energy produced by the solar panel in order to power the subscribers of the network during the night, the optimization method being characterized in that it comprises the steps of: · predicting, as a function of an initial state of charge (SOCi) of the battery at the end of a day, an initial amount of energy (Ei) that the battery will be able to deliver to the network during the night following the day; · predicting both an expected consumption and an expected consumption profile that are to be expected for the network during the night and estimating, as a function of the initial amount of energy and of the expected consumption, whether it will be necessary to start the generator unit during the night; · if starting is going to be necessary, estimating, as a function of the initial amount of energy, of the expected consumption, and of the expected consumption profile, a starting time (Td) for starting the generator unit and a minimum length of operating time (Dm) for operating the generator unit, the minimum length of operating time being sufficient for the generator unit to deliver both a sufficient top-up energy to the network to satisfy the expected consumption of the network once the entire initial amount of energy has been distributed and also a sufficient recharging energy to the battery to enable it to satisfy the expected consumption after the generator unit has been stopped; · determining a final state of charge (SOCf) of the battery as a function of the recharging energy, which final state of charge constitutes a stop criterion for stopping the generator unit. · predicting, as a function of an initial state of charge (SOCi) of the battery at the end of a day, an initial amount of energy (Ei) that the battery will be able to deliver to the network during the night following the day; · predicting both an expected consumption and an expected consumption profile that are to be expected for the network during the night and estimating, as a function of the initial amount of energy and of the expected consumption, whether it will be necessary to start the generator unit during the night; · if starting is going to be necessary, estimating, as a function of the initial amount of energy, of the expected consumption, and of the expected consumption profile, a starting time (Td) for starting the generator unit and a minimum length of operating time (Dm) for operating the generator unit, the minimum length of operating time being sufficient for the generator unit to deliver both a sufficient top-up energy to the network to satisfy the expected consumption of the network once the entire initial amount of energy has been distributed and also a sufficient recharging energy to the battery to enable it to satisfy the expected consumption after the generator unit has been stopped; · determining a final state of charge (SOCf) of the battery as a function of the recharging energy, which final state of charge constitutes a stop criterion for stopping the generator unit.