Skip to content
Shawn Bruce edited this page Apr 15, 2021 · 8 revisions

PSUControl uses the OctoPrint SimpleAPIPlugin mixin for API.

Available API Commands

turnPSUOn
Turn the power supply on.

turnPSUOff
Turn the power supply off.

togglePSU
Toggle the power supply on/off.

getPSUState
Get the current on/off state of the PSU. Returns isPSUOn(boolean).

cURL Examples

turnPSUOn
curl -s -H "Content-Type: application/json" -H "X-Api-Key: YOUR_API_KEY" -X POST -d '{ "command":"turnPSUOn" }' http://YOUR_OCTOPRINT_SERVER/api/plugin/psucontrol

turnPSUOff
curl -s -H "Content-Type: application/json" -H "X-Api-Key: YOUR_API_KEY" -X POST -d '{ "command":"turnPSUOff" }' http://YOUR_OCTOPRINT_SERVER/api/plugin/psucontrol

togglePSU
curl -s -H "Content-Type: application/json" -H "X-Api-Key: YOUR_API_KEY" -X POST -d '{ "command":"togglePSU" }' http://YOUR_OCTOPRINT_SERVER/api/plugin/psucontrol

getPSUState
curl -s -H "Content-Type: application/json" -H "X-Api-Key: YOUR_API_KEY" -X POST -d '{ "command":"getPSUState" }' http://YOUR_OCTOPRINT_SERVER/api/plugin/psucontrol

curl -s -H "X-Api-Key: YOUR_API_KEY" -X GET http://YOUR_OCTOPRINT_SERVER/api/plugin/psucontrol

Clone this wiki locally