Two procedures are analyzed to control the flow of hydrogen produced by an electrolyzer in a plant connected to a distributed electricity grid. The general idea of both procedures is to approximate the consumption power of the electrolyzer to the tracked hourly mean useful power of a wind generation system. The first technique uses a perceptron to predict hourly wind-speed values as the basis for the power consumption of the electrolyzer. The second approximates the hourly consumption of the electrolyzer to the useful power of the wind generation system over the previous hour. Calculations have shown that the control procedure, using either one of these two techniques, leads to substantial improvements in the main parameters of the plant, compared to an installation in which electrolyzer consumption is constant. In particular, the number of batteries in the accumulation system may be reduced. Moreover, considering the possibility that the hydrogen production plant might supply electricity to the external electricity grid, various objectives for operational optimization of the installation are analyzed. A function that defines the joint exploitation of the wind energy by the electrolyzer and the external electricity grid is introduced and then, by using that function, an optimal operating regime for the plant is determined.