Fan control utilising hwmon and pid.
Go to file
Giovanni Harting 0800a3e2e8 reformat with black;
use pwm_min of 1 since newer kernels have different behaviour on pwm=0
2023-08-26 00:15:09 +02:00
.gitignore made .gitignore include idea 2019-09-11 15:19:13 +02:00
LICENSE relicense to GPLv3 2020-02-09 15:35:21 +01:00
README.md Update 'README.md' 2020-03-01 20:41:28 +01:00
config-example.yaml added fan interval per thermalzone and pid interval global 2021-04-29 09:27:14 +02:00
pyfan.py reformat with black; 2023-08-26 00:15:09 +02:00
pyfan.pyi added python type hint stub 2021-04-29 09:27:41 +02:00
pyfan.service Switched back to sbin 2019-10-04 10:23:47 +02:00
pylintrc added pylintrc based on googles pylintrc 2021-04-10 19:55:33 +02:00

README.md

PyFan

This python script utilizes linux's hwmon interface and a PID controller for fan controlling. No external dependencies besides simple_pid and PyYAML are needed.

Installation

Archlinux

AUR package

Other

Put pyfan.py into /usr/local/sbin and give it +x.

Usage

Put your config in /etc/pyfan (see example config) and enable pyfan as a service (see example service file).

Finding your fans

It is recommended to use pwmconfig from lm_sensors to detect your fans.

To know which hwmon is what device and what pwm controls what fan, the following commands can help you:

List all devices + names: tail /sys/class/hwmon/hwmon*/name

Enable control for a specific pwm: echo 1 > /sys/class/hwmon/hwmonX/pwmX_enable

Set fan speed: echo [0-255] > /sys/class/hwmon/hwmonX/pwmX

After you have figured out which fan is controlled by what pwm, you can adjust your config. You can have as many thermal zones as you want, just repeate them like shown.