A method for operating a bidirectional battery converter connected to an AC grid, taking into account an availability of locally generated electrical power, comprising: - defining a plurality of operating modes (1, 3, 4, 5, 10, 20) of the battery converter with regard to feeding electrical power into a battery connected on an input side and outputting electrical power from the battery depending on a state of charge of the battery and on electrical power available on an output side; - defining a plurality of threshold values (A to G) for the state of charge of the battery; and - in a case of a first lower threshold value being undershot, changing from a first operating mode, in which electrical power is output from the battery if a local power demand is not covered by the locally generated electrical power and/or if there is a global undersupply of electrical power in the AC grid, and in which electrical power is fed into the battery if the locally generated electrical power exceeds the local power demand and/or if there is a global oversupply of electrical power in the AC grid, to a second operating mode, - wherein in the second operating mode no electrical power is output from the battery or electrical power is output from the battery only if the local power demand is not covered at all, and electrical power is fed into the battery if locally generated electrical power is available and/or if there is a global oversupply of electrical power in the AC grid, characterized - in that in the case of a state of charge below a second lower threshold value, which is below the first lower threshold value, if electrical power is available on the output side, the battery is charged by electrical power being fed in until a first upper threshold value is reached, which is less than or equal to the first lower threshold value, wherein a first difference (Grid Res) between the first upper threshold value and the second lower threshold value is chosen so as to cover a standby consumption of the battery converter for a predefined first time period. - defining a plurality of operating modes (1, 3, 4, 5, 10, 20) of the battery converter with regard to feeding electrical power into a battery connected on an input side and outputting electrical power from the battery depending on a state of charge of the battery and on electrical power available on an output side; - defining a plurality of threshold values (A to G) for the state of charge of the battery; and - in a case of a first lower threshold value being undershot, changing from a first operating mode, in which electrical power is output from the battery if a local power demand is not covered by the locally generated electrical power and/or if there is a global undersupply of electrical power in the AC grid, and in which electrical power is fed into the battery if the locally generated electrical power exceeds the local power demand and/or if there is a global oversupply of electrical power in the AC grid, to a second operating mode, - wherein in the second operating mode no electrical power is output from the battery or electrical power is output from the battery only if the local power demand is not covered at all, and electrical power is fed into the battery if locally generated electrical power is available and/or if there is a global oversupply of electrical power in the AC grid, characterized - in that in the case of a state of charge below a second lower threshold value, which is below the first lower threshold value, if electrical power is available on the output side, the battery is charged by electrical power being fed in until a first upper threshold value is reached, which is less than or equal to the first lower threshold value, wherein a first difference (Grid Res) between the first upper threshold value and the second lower threshold value is chosen so as to cover a standby consumption of the battery converter for a predefined first time period.