A method of controlling an inverter of electrical energy sources for supplying one or more loads, said inverter comprising: - inputs for receiving availability states (Vi10, Vi20) of several energy sources (1, 2), - inputs for receiving possible operating modes (Md1 to Md4) of the source inverter, and - outputs (32, 33) for controlling an open or closed state of switches (4, 5) for connecting the electrical power sources (1, 2) to one or more loads, the method being characterised in that it comprises: - a step of identifying all possible combinations of the operating modes (Md1 to Md4) and the possible availability states of the energy sources (Vi10, Vi20), and - a step of associating consisting of associating a unique open or closed state configuration of each switch (4, 5) with each combination identified in the identification step; - a step: - of reading a functional operating mode (Md) selected from the possible operating modes (Md1 to Md4), and - of reading the availability states (Vi10, Vi20) of the energy sources (1, 2); - a step of monitoring a change of functional operating mode (Md) or a change of availability status of one or more power sources (Vi10, Vi20) in that, in the event of a change in the functional operating mode (Md) or a change in the availability status of one or more power sources (Vi10, Vi20), the method performs a step of commanding the outputs (32, 33) to set the switches (4, 5) to the configuration associated with the new combination of the functional operating mode (Md) and the status of the power sources (Vi10, Vi20), wherein the possible operating modes (Md1 to Md4) of the source inverter comprise the following operating modes: a first operating mode called "automatic mode" in which the source inverter automatically switches to the configuration in which both switches are open when the source is no longer available and automatically switches to the configuration in which the first switch is closed and the second switch is open when the first source is available again, - a second operating mode known as "forced emergency mode" in which the source inverter switches to the configuration in which the first switch is closed and the second switch is open and remains in this configuration regardless of the availability of the sources (1, 2); - a third operating mode called "maintenance mode" in which the source inverter switches to the configuration in which both switches (4, 5) are open and remains in this configuration regardless of the availability of the sources, and a fourth operating mode known as "coupling mode" in which the source inverter switches to the configuration in which both switches (4, 5) are closed, i.e. with said load connected simultaneously to the sources. - inputs for receiving availability states (Vi10, Vi20) of several energy sources (1, 2), - inputs for receiving possible operating modes (Md1 to Md4) of the source inverter, and - outputs (32, 33) for controlling an open or closed state of switches (4, 5) for connecting the electrical power sources (1, 2) to one or more loads, - a step of identifying all possible combinations of the operating modes (Md1 to Md4) and the possible availability states of the energy sources (Vi10, Vi20), and - a step of associating consisting of associating a unique open or closed state configuration of each switch (4, 5) with each combination identified in the identification step; - a step: - of reading a functional operating mode (Md) selected from the possible operating modes (Md1 to Md4), and - of reading the availability states (Vi10, Vi20) of the energy sources (1, 2); - of reading a functional operating mode (Md) selected from the possible operating modes (Md1 to Md4), and - of reading the availability states (Vi10, Vi20) of the energy sources (1, 2); - a step of monitoring a change of functional operating mode (Md) or a change of availability status of one or more power sources (Vi10, Vi20) in that, in the event of a change in the functional operating mode (Md) or a change in the availability status of one or more power sources (Vi10, Vi20), the method performs a step of commanding the outputs (32, 33) to set the switches (4, 5) to the configuration associated with the new combination of the functional operating mode (Md) and the status of the power sources (Vi10, Vi20), wherein the possible operating modes (Md1 to Md4) of the source inverter comprise the following operating modes: a first operating mode called "automatic mode" in which the source inverter automatically switches to the configuration in which both switches are open when the source is no longer available and automatically switches to the configuration in which the first switch is closed and the second switch is open when the first source is available again, - a second operating mode known as "forced emergency mode" in which the source inverter switches to the configuration in which the first switch is closed and the second switch is open and remains in this configuration regardless of the availability of the sources (1, 2); - a third operating mode called "maintenance mode" in which the source inverter switches to the configuration in which both switches (4, 5) are open and remains in this configuration regardless of the availability of the sources, and a fourth operating mode known as "coupling mode" in which the source inverter switches to the configuration in which both switches (4, 5) are closed, i.e. with said load connected simultaneously to the sources.