Report as inappropriate

In octoprint, install the System Command Editor pluging.
Click on the green box, and add 2 commands:
name: "Turn on" and "Turn off" or whatever you want
action: "turnOn" and "turnOff" or whatever you want
command: "gpio mode 0 out & gpio write 0 0" and "gpio mode 0 out & gpio write 0 1" (Yes, turn off is write 1), this is using GPIO 17 (pin 11), check here for the gpio numbers: https://projects.drogon.net/raspberry-pi/wiringpi/pins/