Home energy management systems and electric vehicles: challenges and opportunities