An energy management system for at least one managed device disposed to receive the energy via a meter connected to an energy supply including an external energy source and an internal energy source (116, 117), the internal energy source being arranged to selectively supply energy to the at least one managed device and/or to the external energy source, the system comprising: a system controller comprising a computer processor configured for communication with the at least one managed device, the meter, and a computer readable storage medium containing computer executable instructions that when executed by the computer processor perform a method comprising: obtaining an energy consumption rate of the at least one managed device from the meter; determining whether the energy consumption rate exceeds energy available from the internal energy source (116, 117) arranged to selectively supply energy to the at least one managed device and/or to the external energy source; obtaining demand information from a demand information source, the demand information comprising information about a demand state of the external energy source; determining from the demand information whether the demand state of the external energy source is a peak demand state; determining a priority of the at least one managed device; determining an energy need of the at least one managed device; and characterized in instructing the at least one managed device to employ an operational mode, the operational mode including a normal operational mode and a reduced operational mode during a peak demand state, based on the priority, the energy need determined by a minimum energy requirement of the at least one managed device for proper operation, the demand state and whether the energy consumption rate of the at least one managed device exceeds energy available from at least one of the external energy source and internal energy source (116, 117). obtaining an energy consumption rate of the at least one managed device from the meter; determining whether the energy consumption rate exceeds energy available from the internal energy source (116, 117) arranged to selectively supply energy to the at least one managed device and/or to the external energy source; obtaining demand information from a demand information source, the demand information comprising information about a demand state of the external energy source; determining from the demand information whether the demand state of the external energy source is a peak demand state; determining a priority of the at least one managed device; determining an energy need of the at least one managed device; and characterized in instructing the at least one managed device to employ an operational mode, the operational mode including a normal operational mode and a reduced operational mode during a peak demand state, based on the priority, the energy need determined by a minimum energy requirement of the at least one managed device for proper operation, the demand state and whether the energy consumption rate of the at least one managed device exceeds energy available from at least one of the external energy source and internal energy source (116, 117).