Raspberry Pi 5 Fan control

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)

Add this command line sensor, you must be running HassOS:

- sensor:
    name: Pi5 Fan Speed
    unique_id: Pi5_fan_rpm
    scan_interval: 15
    command: "cat /sys/devices/platform/cooling_fan/hwmon/hwmon3/fan1_input"
    unit_of_measurement: "RPM"
    value_template: "{{value}}"

I tried getting this and troubleshooting but it doesn’t come up.

Testing on my terminal

Sensor.yaml

Entities

Maybe I am doing something wrong. Also, I feel the fan isn’t actually working. It spins for a split second during boot, so I think the connection is correct.

I used to use a Pi 4 inside an Argon One Case and it was this cool most of the time. I just moved to the Pi 5 and the temperature is x2 of the Pi 4.

this should work if you put it into you configuration.yaml:

command_line:
  - sensor:
      name: Pi5 Fan Speed
      unique_id: Pi5_fan_rpm
      scan_interval: 15
      command: "cat /sys/devices/platform/cooling_fan/hwmon/hwmon3/fan1_input"
      unit_of_measurement: "RPM"
      value_template: "{{value}}"

Apologies I’m very new to all of this! What am i doing wrong here? the Fan still seems to spin up very loudly?

Any pointers on how to start trouble shooting?

Thanks, I put it in my configuration.yaml and it came up. I tried the "cat /sys/devices/platform/cooling_fan/hwmon/hwmon3/fan1_input" and it didn’t work but "cat /sys/devices/platform/cooling_fan/hwmon/hwmon2/fan1_input" did for me. However, the value is 0 and it seems the fan isn’t working. I look at the fan and it’s not working too. Could it be the fan is faulty?

I have this here:

“cat /sys/devices/platform/cooling_fan/hwmon/*/fan1_input”

And works fine for me.

1 Like

you should try the command:

ls -l /sys/class/hwmon/

after that, there should see an entry with “cooling fan”. that should be the correct hwmon number that you should use for the cat command.

in my case this shows: hwmon3 → 
/
/devices/platform/cooling_fan/hwmon/hwmon3

Thanks for the help. I suspected the problem is with my fan on the PI. I recently got a home desktop to play around with Proxmox, so I decided to move my HA to the PC. Thanks so much though.