Method to control a hybrid powertrain, comprising a combustion engine; a gearbox with an input shaft and an output shaft, which combustion engine is connected to the input shaft; a first planetary gear, which is connected to the input shaft; a second planetary gear which is connected to the first planetary gear by connecting a first planetary wheel carrier of the first planetary gear with a second sun wheel arranged in the second planetary gear or by connecting the first planetary wheel carrier of the first planetary gear with a second internal ring gear arranged in the second planetary gear; a first electrical machine, connected to the first planetary gear; a second electrical machine, connected to the second planetary gear; at least one gear pair (01, 60, 72) connected with the first planetary gear and the output shaft; and at least one gear pair (02, 66, 78) connected with the second planetary gear and the output shaft wherein the method comprises the steps: a) engaging a gear corresponding to the at least one gear pair (G1, 60, 72), which is connected with the first planetary gear, in the gearbox, or corresponding to the at least one gear pair (G2, 66, 78), connected with the second planetary gear and the output shaft; b) selecting a gear by connecting two rotatable components (22, 26, 50) in the first planetary gear with each other, with the use of a first coupling device; or by connecting two rotatable components (28, 32, 51) in the second planetary gear with each other, with the use of a second coupling device; and c) controlling a switch, connected to the first and the second electrical machines (14, 16), in such a way that driving stages for the electrical machines (14, 16) in the switch become deactivated, so that the first electrical machine is set into a waiting state, if the second coupling device connects the two rotatable components (28, 32, 51) of the second planetary gear with each other, and in such a way that the driving stages in the switch become deactivated, so that the second electrical machine is set into a waiting state, if the first coupling device connects the two rotatable components (22, 26, 50) of the first planetary gear with each other. a combustion engine; a gearbox with an input shaft and an output shaft, which combustion engine is connected to the input shaft; a first planetary gear, which is connected to the input shaft; a second planetary gear which is connected to the first planetary gear by connecting a first planetary wheel carrier of the first planetary gear with a second sun wheel arranged in the second planetary gear or by connecting the first planetary wheel carrier of the first planetary gear with a second internal ring gear arranged in the second planetary gear; a first electrical machine, connected to the first planetary gear; a second electrical machine, connected to the second planetary gear; at least one gear pair (01, 60, 72) connected with the first planetary gear and the output shaft; and at least one gear pair (02, 66, 78) connected with the second planetary gear and the output shaft wherein the method comprises the steps: a) engaging a gear corresponding to the at least one gear pair (G1, 60, 72), which is connected with the first planetary gear, in the gearbox, or corresponding to the at least one gear pair (G2, 66, 78), connected with the second planetary gear and the output shaft; b) selecting a gear by connecting two rotatable components (22, 26, 50) in the first planetary gear with each other, with the use of a first coupling device; or by connecting two rotatable components (28, 32, 51) in the second planetary gear with each other, with the use of a second coupling device; and c) controlling a switch, connected to the first and the second electrical machines (14, 16), in such a way that driving stages for the electrical machines (14, 16) in the switch become deactivated, so that the first electrical machine is set into a waiting state, if the second coupling device connects the two rotatable components (28, 32, 51) of the second planetary gear with each other, and in such a way that the driving stages in the switch become deactivated, so that the second electrical machine is set into a waiting state, if the first coupling device connects the two rotatable components (22, 26, 50) of the first planetary gear with each other. a) engaging a gear corresponding to the at least one gear pair (G1, 60, 72), which is connected with the first planetary gear, in the gearbox, or corresponding to the at least one gear pair (G2, 66, 78), connected with the second planetary gear and the output shaft; b) selecting a gear by connecting two rotatable components (22, 26, 50) in the first planetary gear with each other, with the use of a first coupling device; or by connecting two rotatable components (28, 32, 51) in the second planetary gear with each other, with the use of a second coupling device; and c) controlling a switch, connected to the first and the second electrical machines (14, 16), in such a way that driving stages for the electrical machines (14, 16) in the switch become deactivated, so that the first electrical machine is set into a waiting state, if the second coupling device connects the two rotatable components (28, 32, 51) of the second planetary gear with each other, and in such a way that the driving stages in the switch become deactivated, so that the second electrical machine is set into a waiting state, if the first coupling device connects the two rotatable components (22, 26, 50) of the first planetary gear with each other.