I have modified the original code so the fan runs slower and Quieter using PWM. For Volumio this is worthwhile since the Fanshim fan is noisy at full speed.
Full details on GitHub at https://github.com/grayerbeard/fanshim-python-pwm/tree/volumio.
Note that this repository isspecially modified to cover issues such as volumio having the “volumio” user instead of “pis”. I tested thois on my R Pi 4 and on an R Pi 3 using the same SD.
Note that there are a few places where the text "pi"has been replaced by “volumio” to suite volumio OS.
These notes may also be useful if you wanted to run any Python3 based code that needs to talk to the GPIO pins on some other OS.