Power ON/OFF 3d printer from octoprint

Hello,

I have setup the octoprint today and have been enjoying it a lot. I want to expand what my printer can do a bit more. I would like to be able to power my 3d printer via octoprint. When I start a print the first thing it would do, would be to power the printer, and once done it would turn it off.

I have no idea where to start, I have programming experience and am willing to learn,but I have gamedev experience. I am really not sure what are the steps I should be taking.

Would you be able to instruct (overview) of what I need to do overwall. I am just not sure what to google/youtube/research to get this going.

Thank you,

First, I would look at the existing options

In particular, PSU Control. PSU Control itself handles the logic of when to turn the printer on & off, and then the network of sub-plugins adds support for specific methods of doing so.

Creating a PSU Control sub-plugin might be a nice way to get used to plugin development, if you want to support a different switching method than what someone else has done. You avoid too much complexity, and there's lots of examples to learn from.

Keep in mind, this is just controlling the power to the printer. You will never be able to power your printer directly from OctoPrint. That is what's known as backpowering and is a bad thing.