Actually 4 lines of code are needed and basically what you input is the curve of how the fan reacts to temperature in a proportional way. More info can be found here:
RaspBerry Pi GitHub
And here:
HASS OS GitHub
Please check that the following line of code is present in config.txt.
dtoverlay=rpi-poe
and append these lines at the end of config.txt
dtparam=poe_fan_temp0=10000,poe_fan_temp0_hyst=1000
dtparam=poe_fan_temp1=55000,poe_fan_temp1_hyst=5000
dtparam=poe_fan_temp2=60000,poe_fan_temp2_hyst=5000
dtparam=poe_fan_temp3=65000,poe_fan_temp3_hyst=5000
My fan is now constantly on but at low speed and will speed up when needed (CPU load up -> temp up -> fan RPM up). A constantly switching fan is not preferred over one that is constantly on (at low speed).