Implementing smart energy management