Raspberry Pi 5 Fan control

Adding to your post, I found this:

fan_temp0               Temperature threshold (in millicelcius) for 1st cooling level (default 50000). Pi5 only.
fan_temp0_hyst       Temperature hysteresis (in millicelcius) for 1st cooling level (default 5000). Pi5 only.
fan_temp0_speed   Fan PWM setting for 1st cooling level (0-255, default 75). Pi5 only.
fan_temp1               Temperature threshold (in millicelcius) for 2nd cooling level (default 60000). Pi5 only.
fan_temp1_hyst          Temperature hysteresis (in millicelcius) for 2nd cooling level (default 5000). Pi5 only.
fan_temp1_speed         Fan PWM setting for 2nd cooling level (0-255, default 125). Pi5 only.
fan_temp2               Temperature threshold (in millicelcius) for 3rd cooling level (default 67500). Pi5 only.
fan_temp2_hyst          Temperature hysteresis (in millicelcius) for 3rd cooling level (default 5000). Pi5 only.
fan_temp2_speed         Fan PWM setting for 3rd cooling level (0-255, default 175). Pi5 only.
fan_temp3               Temperature threshold (in millicelcius) for 4th cooling level (default 75000). Pi5 only.
fan_temp3_hyst          Temperature hysteresis (in millicelcius) for 4th cooling level (default 5000). Pi5 only.
fan_temp3_speed         Fan PWM setting for 4th cooling level (0-255, default 250). Pi5 only.

From here: https://forums.raspberrypi.com/viewtopic.php?t=359778
(HA Supervisor. In terminal: sudo nano /boot/firmware/config.txt; down below [all] paste your code)

1 Like

Has anyone managed to get the fan to only run when the CPU is above 50 degrees? I also have a Raspberry Pi 5 with homeassistant os.

I can’t find this file! Can you help me?

Thanks

How are you attempting to access it? It needs to be done directly on the device, and you’ll need to connect the pin to an HDMI display with a keyboard and mouse

I tryed with ssh! It will not work on this way?

It will not as far as I am aware.

Ok! I’m going to try connecting it directly. Thank you

Quick remark based on my experience with the above written:

  1. Yes, this approach is only available when connetced locally - not via SSH
  2. I was struggling with the VI control as the keyboard layout I used wasnÂŽt properly configured in this mode. I checked for VI commands and found the following useful ones
    i typing a simple “i” enters the editing mode of VI
    ZZ typing a double, capital “ZZ” saves the changes and exits VI
  3. In this logged in mode it is possible to force a reboot with
    shutdown -r now

Hope that helps! For me it worked well

Hi, can you share your Config for your Pi5 Fan? Thanks

ThereÂŽs no big deal around that. I simply followed the explanations given by carll as he described above.
The main points are: You need to be locally connected via HDMI and of course with a local keyboard.
Once you do that, you can type in login. You will not be asked for any password or so.
If you want to see the file structure, use the ls command. It will show the file structures.
You should see amongst others the mnt directory. If you enter cd mnt you will get into that directory.
Another ls shows the boot directory. With cd boot, followed by another ls you will see finally see the config.txt file. Entering vi config.txt opens the possibility to edit the file.
My biggest problem was the keyboard I had, because it had a german layout and I had to figure out where some characters are located (e.g. the hyphen).
Aside of that I followed the description of carll:
"When you are ready
 These are the settings I have used. this means at 35c the fan will run at 175 until temp drops 5c. I have played with this a lot over the last few days, this I found keeps my pi5 around 35c all the time with very little to no fan noise

dtparam=fan_temp0=35000
dtparam=fan_temp0_hyst=5000
dtparam=fan_temp0_speed=175"

1 Like

Ah cool, thanks it works! I had the same Problem with my german Keyboard too. But now it works! Danke :wink:

did you type it under [all] ? i cant get it to work

type under [all]

my:

[all]

#Luefter
dtparam=fan_temp0=35000
dtparam=fan_temp0_hyst=5000
dtparam=fan_temp0_speed=75

dtparam=fan_temp1=50000
dtparam=fan_temp1_hyst=5000
dtparam=fan_temp1_speed=125

dtparam=fan_temp2=60000
dtparam=fan_temp2_hyst=5000
dtparam=fan_temp2_speed=175

dtparam=fan_temp3=65000
dtparam=fan_temp3_hyst=5000
dtparam=fan_temp3_speed=250


dtparam=fan_temp2=60000
dtparam=fan_temp2_hyst=5000
dtparam=fan_temp2_speed=175

dtparam=fan_temp3=65000
dtparam=fan_temp3_hyst=5000
dtparam=fan_temp3_speed=250

1 Like

I’ll give this a shot.

Do we expect this to survive an HAOS update, or will it need to be re-applied every time we update?

Those last two are posted twice :slight_smile: still, thanks for posting.

I have control this

 it was a copy and past false
In my config is all ok, thanks

It has survived HAOS updates for me. YMMV I suppose but I set those parameters up in 2024.6.x and it persists to today.

Just FYI, you do not need to actually do this via a local login, remote over ssh is also possible.

Add GitHub - adamoutler/HassOSConfigurator: A set of Add-Ons to configure HassOS For various platforms and development purposes. as repository and install HassOS SSH port 22222 Configurator.

Helllo , sorry i am late but i have a question . How did you manage to get the fan’s RPM in HomeAssistant ?

Hi, can you tell me how you monitor the fan speed through home assistant? Or what is this dashboard called (system plus)