Method for operating an electric energy storage that is provided for an electric consumption unit, wherein the electric consumption unit is additionally coupled to an electric power grid and wherein the grid supplies electric power to the consumption unit under different supply conditions at different time periods, wherein for each of the different supply conditions, the costs for delivered energy are different and costs refers to monetary costs or environmental costs, and wherein a control device observes the state of charge of the energy storage and controls an electric power flow of the energy storage by means of an electric power converter, wherein the control device performs the following steps: - providing different operation logics for controlling the power flow as a function of the state of charge and as a function of a total unit load, wherein the total unit load is a net balance value of a power consumption in the consumption unit and an internal power delivery in the power consumption unit, - observing a status signal that is signaling the present and/or the next supply condition of the grid, - selecting one of the operation logics as an active operation logic depending on a current value of the status signal, - operating the power converter according to the active operation logic, characterized in that one of the supply conditions is a peak supply condition, where the costs are highest, which is valid during peak periods (Pp) and for the peak supply condition a peak operation logic is selected, which comprises the following logic: - if the total unit load is greater 0, indicating a net power consumption, and the state of charge is greater than a predefined peak threshold (BTHp), a negative power flow is set for discharging the energy storage, - if the total unit load is smaller 0, indicating a net power delivery, the power flow is set to 0 independently of the state of charge in the case that net energy metering applies for the electric consumption unit or otherwise, if the state of charge is below a predefined maximum level (100%), a positive power flow is set for charging the energy storage, and one of the supply conditions is an off-peak supply condition, when the costs are lowest, which is valid during off-peak periods (Pop) and for the off-peak supply condition an off-peak operation logic is selected, which comprises the following logic: - if a time duration remaining until the end of the present off-peak period (Pop) is shorter than or equal to a predefined stretched Final Charge Window, a positive power flow for charging the energy storage is set to a scaled value which is calculated such that the state of charge reaches maximum level (100%) at the end of the off-peak period (Pop), wherein the Final Charge Window is a time value needed for charging the energy storage from its present state of charge to the maximum level (100%), if a maximum converter power (InvMaxPower) of the power converter is used, and the stretched Final Charge Window is the Final Charge Window multiplied by a stretch factor α, with α greater than or equal to 1, wherein said scaled value is the maximum converter power (InvMaxPower) divided by the stretch factor α. - providing different operation logics for controlling the power flow as a function of the state of charge and as a function of a total unit load, wherein the total unit load is a net balance value of a power consumption in the consumption unit and an internal power delivery in the power consumption unit, - observing a status signal that is signaling the present and/or the next supply condition of the grid, - selecting one of the operation logics as an active operation logic depending on a current value of the status signal, - operating the power converter according to the active operation logic, - if the total unit load is greater 0, indicating a net power consumption, and the state of charge is greater than a predefined peak threshold (BTHp), a negative power flow is set for discharging the energy storage, - if the total unit load is smaller 0, indicating a net power delivery, the power flow is set to 0 independently of the state of charge in the case that net energy metering applies for the electric consumption unit or otherwise, if the state of charge is below a predefined maximum level (100%), a positive power flow is set for charging the energy storage, and - if a time duration remaining until the end of the present off-peak period (Pop) is shorter than or equal to a predefined stretched Final Charge Window, a positive power flow for charging the energy storage is set to a scaled value which is calculated such that the state of charge reaches maximum level (100%) at the end of the off-peak period (Pop),