Using the Tasmota plugin and Print Scheduler together

Hi all,

My aim is to have the Tasmota switch turn on my printer when I schedule a print using the Print Schedule Plugin. This way, I can schedule a print to start and the printer will be turned on and ready to print.

I have installed the following two plugins:

In the Tasmota device settings under the plugin configuration, I have set up the device so that it can be powered on and off using the GCODE command "M80 1". You can find more information about this in the documentation here: GitHub - jneilliii/OctoPrint-TasmotaMQTT.
You can also see a screenshot of my settings below:

In the Print Scheduler, I have added the GCODE to the "Before Each Print" section:

M80 1 ; Turn printer on

My logic is that this GCODE will be run before the print starts, turning the printer on and connecting it in time for the print to begin.

Am I understanding this all correctly?

Thank you for your time.

This won't work unless your printer is back powered and keeps a connection open to the printer. In most cases that's bad anyway, so instead you have to use a system command to trigger the power on of the plug. You can find the turn on command here, which will require an API key you can generate from Application Keys settings in OctoPrint.

EDIT: you may need to include the full path to curl, in which case prepend the commands on the wiki with /usr/bin/ so it would be /usr/bin/curl ...

1 Like

Thank you jneilliii this works perfectly!

For anyone looking to add use this in the future, make sure you use this command to turn it on:

curl -s -H "Content-Type: application/json" -H "X-Api-Key: YOUR_API_KEY" -X POST -d '{ "command":"turnOn", "ip":"<ip of tasmota device in settings>", "idx":"<index of tasmota device in settings>" }' http://YOUR_OCTOPRINT_SERVER/api/plugin/tasmota

As referenced from the docs here. In my case no need to add the /usr/bin/

Also, expect a little delay after the scheduled time and the plug being turned on (about 30 seconds); I was too impatient.

Great, the delay is probably coming from the connection delay settings in the Tasmota plugin. You have to give the printer time to power on and get ready before trying to connect.