Actions after print-job is done: Trigger URL etc

Hello,

OctoPi is running quite well. :grinning:
Right now I wonder, if OctoPrint can trigger any further external activities by sending an URL request after the progress ended at 100% AND the rendering of time-laps were done.
I would like to use my FHEM home-automation for turning off the plug, where the printer is connected to + sending a push notification.

Thanks for your help

Look in settings under Event Manager. You can do this with system commands and calling the command curl.

I had a quick look at the documentation. Maybe I do not fully get it. Is there any concrete example, how it should look like and where exactly it needs to be done?
Of course it will be useful to trigger he external url after finishing a print-job and after even finishing the video rendering.
Thanks for any hints.

also, you might want to check out the webhooks plugin. it allows you to do this event driven command but geared towards web request stuff.

Hi, I configured as described:
Eventmanager > Event "MovieDone" added (Command with curl {url]) / Type=system
but it still doesn't seem to work. Anything I missed?

Did you verify your curl command works first from the command line? You may need to have the full path to the command /usr/bin/curl

How can I test in best way?
From what folder shall I try it when being connected to Raspberry via PuTTY?

if you are supplying the full path to curl it shouldn't matter where you test the command from.

I have opened PuTTY and triggered both options:

curl http://192.168.178.20:8083/fhem?cmd.FS20ST_06=set%20FS20ST_06%20off&XHR=1&fwcsrf=csrf_559962721233202&fw_id=3022

Result:
pi@octopi:~ $ curl http://192.168.178.20:8083/fhem?cmd.FS20ST_06=set%20FS20ST_06%20off&XHR=1&fwcsrf=csrf_559962721233202&fw_id=3022
[1] 906
[2] 907
[3] 908

/usr/bin/curl http://192.168.178.20:8083/fhem?cmd.FS20ST_06=set%20FS20ST_06%20off&XHR=1&fwcsrf=csrf_559962721233202&fw_id=3022

Result:
pi@octopi:~ /usr/bin/curl http://192.168.178.20:8083/fhem?cmd.FS20ST_06=set%20FS20ST_06%20off&XHR=1&fwcsrf=csrf_559962721233202&fw_id=3022 [13] 921 [14] 922 [15] 923 [8] Done XHR=1 [10] Exit 127 fw_id=3022/usr/bin/curl http://usr/bin/curl%20curl%20http://192.168.178.20:8083/fhem?cmd.FS20ST_06=set%20FS20ST_06%20off [11] Done XHR=1 [12] Done fwcsrf=csrf_559962721233202 pi@octopi:~

But nothing is happening.

When requesting the url http://192.168.178.20:8083/fhem?cmd.FS20ST_06=set%20FS20ST_06%20off&XHR=1&fwcsrf=csrf_559962721233202&fw_id=3022 in a browser on my Windows client (incognito window), everything behaves as expected.

Any suggestion about what to do, to make it happen?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.