* Installing dependencies on a stock Raspbian install: sudo apt-get update sudo apt-get upgrade sudo apt-get install python3-pip python3-dev python3-gpiozero sudo pip3 install paho-mqtt * Create the python script as /home/pi/mqtt_fan.py * Create a systemd service definition file as /lib/systemd/system/mqtt_fan.service