Abstract
The integration of advanced technology in smart homes has made the prevention of energy waste in the residential and building sectors a significant concern for both developed and developing nations in recent decades. This paper offers a thorough model for maximizing energy generation and consumption in smart homes with demand-responsive loads, energy storage systems (ESS), solar photovoltaic (PV) panels, bidirectional electric vehicles (EVs) that can communicate with both grid-to-vehicle (G2V) and vehicle-to-grid (V2G). The model uses a mixed-integer linear programming (MILP) framework to assess the technical and economic effects of these factors while accounting for the inherent uncertainties in outside temperatures, lighting loads, sun irradiation, and EV supply. Important situations include time-shifting deferrable loads (like washing machines), selling excess PV-generated energy to the grid, and putting price-based demand response (DR) techniques like real-time pricing (RTP) and day-ahead pricing (DAP) into practice. To manage uncertainties and adaptively schedule the operations of appliances, electric vehicles, and energy storage systems (ESS), the proposed HEMS uses a fuzzy programming technique supplemented by reinforcement learning. Harris Hawks Optimization (HHO) and Wild Horse Optimization (WHO) are two examples of metaheuristic algorithms used for optimization, whereas the conditional value at risk (CVaR) criterion is used for risk management. MATLAB simulations show that this adaptive technique can save up to 53% of home electricity expenses in tested scenarios while keeping computational efficiency under 60 s, which makes it suitable for real-time applications. The strategy opens the door for resilient and sustainable residential energy systems by highlighting new developments in smart grid integration, renewable energy use, and AI-driven optimization.