Utility authorities utilize various methods to promote end-user energy conservation, including higher tariff rates and demand response (DR) strategies. This paper investigates an Optimized Smart Home Energy Management System (OSHEMS) designed to minimize grid dependence and energy bills while ensuring reliable load delivery. A hybrid architecture prototype was implemented, integrating a photovoltaic (PV) array, battery storage, and the electrical grid. The system combines Maximum Power Point Tracking (MPPT) solar chargers and Pure Sine Wave (PSW) inverters for efficient energy management. The Home Energy Management Whale Optimization Algorithm (HEMWOA) was employed to optimize energy usage and achieve cost reduction while enhancing user comfort. Real-time pricing (RTP) tariffs incentivizing flexible energy consumption during peak hours were incorporated. OSHEMS manages, schedules, and monitors energy sources and appliances, determining the optimal consumption mix. Experimental results demonstrate a significant decrease in grid reliance (46.6%) and energy costs (57.7%) compared to non-scheduling scenarios. These findings highlight the potential of OSHEMS in promoting sustainable and cost-effective energy consumption in smart homes.