3D-Print

How to automatically shutdown your 3D-Printer – OctoPrint/TP-Link Smart Plug

Reading Time: 2 minutes

Since I also run my Ender 3 V2 overnight for long 3D-prints, I have been looking for a solution to have the printer automatically turn off when it has been idle for several minutes. Normally, when the print finishs, all fans continue to run and the printer is still on.

Plugin Settings @OctoPrint Web-Interface

In order for OctoPrint to intelligently decide if the 3D printer should still be on or not, I bought a TP-Link KP115 Smart Plug. This smart wifi plug can not only turn the printer on and off but also measure and record the power that the printer is currently using.

There are several plugins that allow OctoPrint to communicate with the TP-Link KP115. I chose the “TP-Link Smartplug” plugin, which I am very happy with so far. The setup of the plugin was super simple. However, you first have to install the plugin via the KASA app on your smartphone, which shows you the IP address, which is important for OctoPrint. What’s cool is that you can also turn the outlet on and off with your phone, even though it’s connected to OctoPrint.

There are numerous settings that can be used to turn the printer on automatically when OctoPrint is started, for example. The most important feature for me, however, is that the printer automatically turns off after a certain amount of time when not in use to save power.

TP-Link Energy Monitor

TP-Link Energy Monitor Web-Inferface

In order to display the consumption of the 3D printer in a clear web interface, I downloaded the open-source project “TPLink Energy Monitor” from Github. I installed the project on my Linux VM, which is running 24/7 on our Home-Server. Installing the Docker container for the Energy Monitor is super simple using a terminal command.

In the web interface you can see different information like “Plug State”, “Total kWh today”, “Monthly kWH average” or even diagrams showing the consumption. You can see in this diagram that my Ender 3V2 uses about 20W when idle.

When Docker is already installed on your Linux device, you can just fire that into your terminal and your webinterface will be visible at localhost:3000. You can read the compelte instructions on Github here.

docker run -d --network host jbarnett/tplink-energy-monitor

All in all, this is a great extra to my Spagehtti Detective to keep track of everything the printer is doing. In addition, I think a smart socket is a great upgrade for anyone who runs their 3D printer overnight or isn’t always home to turn it off when not in use.

Leave a Reply

Your email address will not be published. Required fields are marked *