We analyse the transition of a decentralized economy whose energy supply switches progressively from non-renewable (NRE) to renewable energy (RE) sources. The two energies are perfect substitutes but RE production o↵ers a lower Energy Return On Energy Invested (EROEI). The transition is characterized by a decreasing trend of the aggregate EROEI and by major changes both in the allocation of output between consumption and investment and in the allocation of capital between energy and final good productions. As a result, the energy transition may (and will usually) be characterized by a non-monotonic evolution of aggregate income and private consumption: after a peak and before the NRE exhaustion, the economy experiences a contraction. We analyze what a↵ects 1) its magnitude and 2) the possibility of an ulterior recovery of income. Incidentally, a complementarity appears between a rapid development of RE production and the availability of NRE: the end of the NRE era puts a drag on the development of the RE production.