Skip to content

Instantly share code, notes, and snippets.

@dominictayloruk
Forked from pirate/udm_fancontrol_setup.sh
Last active January 12, 2026 21:57
Show Gist options
  • Select an option

  • Save dominictayloruk/078c88edc1aa601558b34702bc058cee to your computer and use it in GitHub Desktop.

Select an option

Save dominictayloruk/078c88edc1aa601558b34702bc058cee to your computer and use it in GitHub Desktop.
Setup Unifi Dream Machine (UDM) automatic fan speeds control to lower temps and increase device lifespan.
#!/bin/bash
echo "[i] Here are your UDM sensor readings before (for before/after comparison):"
sensors
echo
echo
echo "[+] Installing fancontrol package using apt..."
apt-get update -qq
apt-get install -y fancontrol
echo
echo "[+] Setting up /etc/fancontrol config file (edit as-desired after this script completes)..."
tee /etc/fancontrol <<EOF
INTERVAL=2
DEVPATH=hwmon0=devices/platform/soc/fd880000.i2c-pld/i2c-0/0-004c
DEVNAME=hwmon0=lm63
FCTEMPS=hwmon0/device/pwm1=hwmon0/device/temp1_input hwmon0/device/pwm1=hwmon0/device/temp2_input
FCFANS=hwmon0/device/pwm1=hwmon0/device/fan1_input
MINTEMP=hwmon0/device/pwm1=40
MAXTEMP=hwmon0/device/pwm1=64
MINSTART=hwmon0/device/pwm1=30
MINSTOP=hwmon0/device/pwm1=15
MINPWM=hwmon0/device/pwm1=10
MAXPWM=hwmon0/device/pwm1=255
EOF
echo "[*] Restarting fancontrol service to apply changes..."
systemctl restart fancontrol
sleep 1
echo
echo "[√] Complete. Check the sensor readings to make sure fans are spinning faster:"
sensors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment