The integration of information and communication technologies into the Smart Grid (SG) will make it smarter to provide a more efficient power delivery, economically viable and safe. In fact, electrical systems should be controlled in more flexible way to manage critical situations such as the intermittency of renewable energy and the development of new consumers like electric vehicles (EVs). In this paper, we first propose an end-to-end SG architecture with all its associated actors such as main production, transmission, distribution, SG and cyber-security managers. In contrast to the literature, this architecture takes into account both the power and communication aspects of the SG as well as the relationship between all its components. Then, we focus on EVs as prosumers (producers and consumers thanks to their energy storage capacity) and how integrate them efficiently into the power grid. Hence, we propose in a first phase a Bayesian game-theory model that aims to integrate them into the SG and maintain the equilibrium between the offer and the demand, hence avoiding electricity intermittence. In a second phase, we concentrate on EVs as consumers and propose a new Bayesian game model to optimally integrate green electricity sources into this electricity network in order to charge EVs’ batteries. This aims to promote the electricity network capacity and have an eco-friendly effect on the environment by minimizing the usage of polluting energy sources. The obtained simulation results prove that our models help to efficiently integrate the EVs into the SG and use green electricity sources with more flexibility and less loss.