How to use esp8266/ESP-12F/or Arduino to control ebmpapst 48V DC fan?

I want to make an air filter using a ebmpapst 48V DC fan.

The fan’s model is D1G133-BF49-16 and the reason of using it is because it’s business retired and cheap. But the fan is 10 years old, there is no manual online. The nearest manual I can find is a this one and The connection diagram is as below:

The fan I brought comes with a potentiometer to control it. But I want to use esp8266 to control it over wifi. But I don’t know how to connect the wires…

The original connection diagram is as follows. What is strange to me is they just connect a 7.4M potentiometer between the red (42V DC) and the yellow (PWM/lin) line. It seems is’t not a method specified on the above connection diagram… But it works… But why it doesn’t need the 4.7K resistor but still works? and they use a 7.4M potentiometer not 10K but still works?

Now I want to connect esp8266 to it so that I can control it over wifi (and also locally by the potentiometer as well)…

I just draw the following diagram, but I’m not sure is this right (especially for the red wires).

I’m afraid if something goes wrong it may burn the esp8266 (like 42v going into esp8266…), so I haven’t test it.

The questions are do I need the 33K resistor, and what is it for? Do I need the 12V voltage-regulator diode, and what is it for? Is there anything more needed or anything need to change for this?

Another question is I heard the esp8266’s PWM is software based and has some flicking issues… Do I need to be concerned about that?

An update:
Just had a try using the above diagram. The PWM control works. But it seems the fan speed is not as fast as using potentiometer to control. When PWM pin is set to 100% (1023/1023 on ESPEasy), the fan speed is not at full speed...