I’ve managed to do it with a http action, it is the following:
rule "POST Printer Command"
when
Item OctoprintPrinterCommand received update
then
var url = "http://octopi.fritz.box/api/job?apikey=APIKEY"
var contenttype = "application/json"
var POSTrequest = '{"command":"' + OctoprintPrinterCommand.state + '"}'
var output = sendHttpPostRequest(url, contenttype, POSTrequest)
logInfo("Test Octoprint:", output);
end
The item has to contain “cancel” etc…
However I’m still wondering how to do this directly with an item…