Shawn Bruce edited this page Oct 6, 2017 · 6 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

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

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

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

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

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.