Manage energy in the smart grid