Smart integration of electric vehicles in an energy community