This paper proposes a stochastic dynamic programming framework for the optimal energy management of a smart home with plug-in electric vehicle (PEV) energy storage. This paper is motivated by the challenges associated with intermittent renewable energy supplies and the local energy storage opportunity presented by vehicle electrification. This paper seeks to minimize electricity ratepayer cost, while satisfying home power demand and PEV charging requirements. First, various operating modes are defined, including vehicle-to-grid, vehicle-to-home, and grid-to-vehicle. Second, we use...