ziirish / OctoPrint-TuyaSmartplug

Tuya Smartplug plugin for OctoPrint
Other
19 stars 15 forks source link

Turning ON the smart plug with curl #38

Closed Deses closed 2 years ago

Deses commented 2 years ago

I'm trying to use curl to start the printer when the PrintScheduler plugin sends a system command.

According to PrintScheduler's wiki, the command I should use should look like something like this:

curl -s -H "Content-Type: application/json" -H "X-Api-Key: XXXXXXXXXXXXXXXXXXXX" -X POST -d '{ "command":"turnOn", "ip":"192.168.1.110" }' http://localhost/api/plugin/tuyasmartplug

But the response I'm getting is: {"error":"Mandatory parameters missing"}.

Where can I take a look at the plugin's API to see what are the parameters?

Deses commented 2 years ago

Found it here!

curl -s -H "Content-Type: application/json" -H "X-Api-Key: XXXXXXXXXXXXXXXX" -X POST -d '{ "command":"turnOn", "label": "Ender 3" }' http://localhost/api/plugin/tuyasmartplug