Connecting a large number of distributed sources to the medium and low voltage grid poses many problems. The most important of these are the voltage changes inside the network, what can be observed when the power flow from these sources towards the HV/MV (High Voltage/Medium Voltage) transformer station. In particular, if the power consumption in nodes of the MV network is small and the distance between the place of installation of the source and the substation is large, increases and changes in voltage may be dangerous for the insulation of the network and burdensome for the consumers connected to it. The solution most frequently used to control voltage increases is the appropriate setting of the controller that affects the on-load tap changer of the MV/HV or even MV/LV (Medium Voltage/Low Voltage) transformer. It is also possible to regulate the reactive power of the sources and, of course, to limit their generated active power (curtailment of generation). The development of energy storage technology has made it possible to introduce consumers into the network, whose power can be controlled in a wide range. The article proposes the concept of an innovative voltage control system in the MV network, whose output values are three groups of parameters: HV/MV transformer ratio, reactive power of sources and active power of consumers connected in generation nodes. In the technological sense, it has been assumed that the loads are installations of electrolyzers used to produce “green hydrogen”, according to the P2G (Power to Gas) formula. The tests consisting in the execution of several hundred calculation cycles for the IEEE 37 test network, using the Monte Carlo simulation, have shown that the subordination of the hydrogen production process to the objectives of voltage control in the MV network clearly contributes to stabilizing its value, while meeting the technological requirements. The control variables of the proposed control system are the result of the optimization algorithm described in the article, the function of which is the quality of network voltage.