Pi PoE HAT fan control

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).

4 Likes

This doesn’t work for me. i am using the latest HA version and a branc new PoE hat but the fan never spins, only briefly at boot time. Any idea how to solve this?

Hello and welcome to the forums.
Can you be more specific about what you have tried so I can help you in a better way.

Hello,

I have the latest 64 bit version of HA and have tried to edit the config.txt file with all the different values mentioned above. No luck.

I edited my earlier post (Link) and suggest to check if dtoverlay=rpi-poe Is present in config.txt

The piece of code below can be found in the latest rPi documentation. I hope this points you in the right direction.


Name:   rpi-poe
Info:   Raspberry Pi PoE HAT fan
Load:   dtoverlay=rpi-poe,<param>[=<val>]
Params: poe_fan_temp0           Temperature (in millicelcius) at which the fan
                                turns on (default 40000)
        poe_fan_temp0_hyst      Temperature delta (in millicelcius) at which
                                the fan turns off (default 2000)
        poe_fan_temp1           Temperature (in millicelcius) at which the fan
                                speeds up (default 45000)
        poe_fan_temp1_hyst      Temperature delta (in millicelcius) at which
                                the fan slows down (default 2000)
        poe_fan_temp2           Temperature (in millicelcius) at which the fan
                                speeds up (default 50000)
        poe_fan_temp2_hyst      Temperature delta (in millicelcius) at which
                                the fan slows down (default 2000)
        poe_fan_temp3           Temperature (in millicelcius) at which the fan
                                speeds up (default 55000)
        poe_fan_temp3_hyst      Temperature delta (in millicelcius) at which
                                the fan slows down (default 5000)

This post has fixed my PoE fan issue, thank you to everyone. In the end I learned that you need the dtoverlay, and 4 poe_fan_temp entries!

This is what I had before but it doesn’t work. Cannot believe so simple functionality needs that much tweaking and it is not added by default in HA raspberry edition.

dtoverlay=rpi-poe
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

Could you please check below configuration, it worked for me!

PoE Hat Fan Speeds

dtoverlay=rpi-poe
dtparam=poe_fan_temp0=65000,poe_fan_temp0_hyst=5000
dtparam=poe_fan_temp1=67000,poe_fan_temp1_hyst=2000

I could get mine to work with any of the above suggestions.
Then I found this article instead.
https://www.raspberrypi.org/forums/viewtopic.php?t=316908

So using “dtoverlay=rpi-poe-plus” instead of “dtoverlay=rpi-poe” worked for me.

So I simply powered off my HASSIO, move my SSD to the computer, and at the end of the config.exe (Using Notepad++) added the 6 lines. The # is just a commenting line, but I kept it there.

# PoE+ FAN TEMPERATURE CONTROL
dtoverlay=rpi-poe-plus
dtparam=poe_fan_temp0=45000,dtparam=poe_fan_temp0_hyst=3000
dtparam=poe_fan_temp1=50000,dtparam=poe_fan_temp1_hyst=3000
dtparam=poe_fan_temp2=62000,dtparam=poe_fan_temp2_hyst=4000
dtparam=poe_fan_temp3=70000,dtparam=poe_fan_temp3_hyst=5000

3 Likes

Bloody outrageous isn’t it!!

Hello,

Can someone please explain me what hyst setting does?
I can’t find it and everyone uses different values of this.

ps, I am new with raspberry and home assistant.

Sure. It is only required if you have added the POE+ hat onto your RaspberryPi.

It is a small board that allows the RaspberryPi to be powered from a POE (Power Over Ethernet) switch. Regular switches can’t PoE. That way you don’t have to power it by USB.

The setting above controls the fan speed on that board, according to temperature. So it is only used if you have the PoE hat.

Thanks for your response,

I have a PoE+ hat, and set your values in the Config.txt
They do work, the fan is much quiter :slight_smile:
But I do not understand what the “poe_fan_temp1_hyst=3000” does or why its 2000 3000 4000 5000 etc.
It says its Delta Temperature? But i have still no idea on why to set them on what value?

I haven’t thought much about the values themselves :see_no_evil: I just tried the once I found, and they worked :slight_smile:

'Params: poe_fan_temp0 Temperature (in millicelcius) at which the fan turns on (default 50000)

poe_fan_temp0_hyst Temperature delta (in millicelcius) at which the fan turns off (default 5000)’

This was what I found, but doesn’t say much :slight_smile:

Ah oke haha,

I set dtparam=poe_fan_temp2=62000 to =65000. Hoped that the temp would not reach 65 and staid in temp1. But when setting 62000 to 65000 the temp also went from 60000-62000 to 63000-65000 :sweat_smile: so did not matter, was trying to find a way to keep it in temp1 speed.

Don’t know if its okey for the Fan to go on/off continuous at the temp border from temp1 to temp2…

Hyst stands for hysteresis. The 5000 value means that 5°C temperature change is needed after the previous state change (fan off / speed change) before the next change will happen. This prevent the fan from switching states very rapidly.

The explanation for what the four temperatures actually are can be found in my earlier post: Pi PoE HAT fan control - #12 by SarumaN

I included part of that post below.

If fan noise is not an issue for you temp0 should be lower that room (ambient) temperature (fan always on) and temp4 should be lower than your target temperature of 65°C. For example

T1:15°C
T2:22°C
T3:30°C
T4:45°C this means that starting at 45°C the fan is at full speed.

The hyst parameter should always be smaller than the T1, T2, T3, T4 differences. Hyst=5°C.

Thank you very much for the explaination!

For fan noise is fine at temp0 and temp1, afther that its to loud.

I have set:

# PoE+ FAN TEMPERATURE CONTROL
dtoverlay=rpi-poe-plus
dtparam=poe_fan_temp0=45000,dtparam=poe_fan_temp0_hyst=3000
dtparam=poe_fan_temp1=50000,dtparam=poe_fan_temp1_hyst=3000
dtparam=poe_fan_temp2=62000,dtparam=poe_fan_temp2_hyst=4000
dtparam=poe_fan_temp3=70000,dtparam=poe_fan_temp3_hyst=5000

But the problem at this is that the fan keeps going from Temp1 > Temp2 > Temp 1 > Temp 2 and so on.
It keeps going faster for les than a minute and then back to Temp1 for maybe a bit more than a minute.

To prevent this, i should increase temp1_hyst, or temp2_hyst?

So an option to change this can be

From your example, to my temp values, is this correct?

Params:

    poe_fan_temp0           Temperature (in millicelcius) at which the fan
                            turns on (45000)
    poe_fan_temp0_hyst      Temperature delta (in millicelcius) at which
                            the fan turns off (42000)

    poe_fan_temp1           Temperature (in millicelcius) at which the fan
                            speeds up (50000)
    poe_fan_temp1_hyst      Temperature delta (in millicelcius) at which
                            the fan slows down (47000)

    poe_fan_temp2           Temperature (in millicelcius) at which the fan
                            speeds up (62000)
    poe_fan_temp2_hyst      Temperature delta (in millicelcius) at which
                            the fan slows down (58000)

    poe_fan_temp3           Temperature (in millicelcius) at which the fan
                            speeds up (70000)
    poe_fan_temp3_hyst      Temperature delta (in millicelcius) at which
                            the fan slows down (65000)

So for my problem, the hyst of temp 2 is to low?