The use of renewable energy sources can reduce the greenhouse gas emissions and the dependence on fossil fuels. The main problem of the installations based on renewable energy is that electricity generation cannot be fully forecasted and may not follow the trend of the actual energy demand. Hybrid systems (including different subsystems such as renewable energy plants, energy storage systems based on hydrogen or dam water reservoirs) can help in improving the economic and environmental sustainability of renewable energy plants. In addition, hybrid systems may be used to satisfy other user demands (such as water supply or hydrogen for automotive use). However, their use should be optimized in order to fulfill the user demand in terms of energy or other needs. In this paper, a model representing an integrated hybrid system based on a mix of renewable energy generation/conversion technologies (e.g., electrolyzer, hydroelectric plant, pumping stations, wind turbines, fuel cell) is presented. The model includes an optimization problem for the control of the different ways to store energy. The goal is to satisfy the hourly variable electric, hydrogen, and water demands. A specific application area in Morocco is considered and the results obtained are discussed in detail.