Hybrid solar-battery power source is essential in the nexus of plug-in electric vehicle (PEV), renewables, and smart building. This paper devises an optimization framework for efficient energy management and components sizing of a single smart home with home battery, PEV, and potovoltatic (PV) arrays. We seek to maximize the home economy, while satisfying home power demand and PEV driving. Based on the structure and system models of the smart home nanogrid, a convex programming (CP) problem is formulated to rapidly and efficiently optimize both the control decision and parameters of the home battery energy storage system (BESS). Considering different time horizons of optimization, home BESS prices, types and control modes of PEVs, the parameters of home BESS and electric cost are systematically investigated. Based on the developed CP control law in home to vehicle (H2V) mode and vehicle to home (V2H) mode, the home with BESS does not buy electric energy from the grid during the electric price's peak periods.