Advanced energy management