This paper evaluates the reliability of smart home energy management systems (SHEMSs) in a residential community with an unreliable power grid and power shortages. Unlike the previous works, which mainly focused on cost analysis, this research assesses the reliability of SHEMSs for different backup power sources, including photovoltaic systems (PVs), battery storage systems (BSSs), electric vehicles (EVs), and diesel generators (DGs). The impact of these changes on the daily cost and the balance of energy source contribution in providing electrical energy to household loads, particularly during power outage hours, is also evaluated. To address the uncertainty of electricity market prices, a risk management approach based on conditional value at risk is applied. Additionally, the study highlights the impact of community size on energy costs and reliability. The proposed model is formulated as a mixed-integer nonlinear programming problem and is solved using GAMS. The effectiveness of the proposed risk-based optimization approach is demonstrated through comprehensive cost and reliability analysis. The results reveal that when electric vehicles are used as backup power sources, the energy index of reliability (EIR) is not affected by market price variations and shows significant improvement, reaching approximately 99.9% across all scenarios.