<div class="section abstract"><div class="htmlview paragraph">Eco-driving algorithms use the available information about traffic and route conditions to optimize the vehicle speed and achieve enhanced energy consumption while fulfilling a travel time constraint. Depending on what information is available, when it becomes accessible, and the level of automation of the vehicle, different energy savings can be achieved. In their basic formulation, eco-driving algorithms only leverage static information to evaluate the optimal speed, such as posted speed limits and location of stop signs. More advanced algorithms may also consider dynamic information, such as the speed of the preceding vehicle and Signal Phase and Timing of traffic lights, thus achieving higher energy efficiency. The objective of the proposed work is to develop an eco-driving algorithm that can optimize energy consumption by leveraging not only static route information, but also dynamic macroscopic traffic conditions, which are assumed to be available in real-time through Infrastructure-to-Vehicle communication. In this work, modeling and simulation are used to demonstrate the operation of the algorithm, which is implemented in the controller of an electric truck model. The speed optimization is formulated as an optimal control problem and solved as a hierarchical Model Predictive Control using Approximate Dynamic Programming. Macroscopic traffic congestion is modelled as a dynamic process using the Lighthill-Whitham-Richards model, which is a first-order hyperbolic partial differential equation that models the spatial and temporal evolution of traffic density. The results show that for heavy traffic conditions, the speed adaptation based on real-time macroscopic traffic conditions, that is, considering the characteristic macro scales of traffic congestion, can result in reduced energy consumption, while not affecting the total travel time.</div></div>