This study pioneers sustainable energy solutions amidst escalating demand and fossil fuel depletion. Its primary novelty lies in proposing an integrated energy system, encompassing a concentrated solar plant, thermal energy system, and hybrid power supply within the solar energy domain. This integration substantially enhances overall system performance. The architectural design integrates various energy conversion components, including wind turbines, energy storage devices, and electric heaters, fostering synergistic collaboration. The optimization of energy usage is a key focus, utilizing heating and electricity costs as pivotal signals for participation in an Integrated Demand Response program (IRD). The demand response model, encompassing both thermal and electric loads, incorporates a sophisticated price elasticity matrix. Addressing challenges associated with renewable energy intermittency, phased carbon emissions, and the advantages of demand response, this study introduces an advanced system operation optimization model to effectively curtail operational costs. In the realm of methodology, this research breaks new ground by proposing an enhanced optimization algorithm that ingeniously combines the Whale Optimization Algorithm (WOA) with the Wavelet Transform (WT). This novel amalgamation significantly enhances the algorithm's search capabilities, providing superior performance in tackling the complexities inherent in the optimization problem. The proposed model undergoes rigorous evaluation in a comprehensive study featuring diverse energy sources and multiple scenarios. The outcomes of this evaluation distinctly showcase substantial reductions in overall operational costs compared to conventional approaches. This multifaceted contribution positions the study at the forefront of endeavors to revolutionize energy systems for enhanced sustainability and efficiency.