In short: I was wondering if it is possible to send a command to a smart plug when the pi is good to kill it's power.
background I'm running a 3d printer which I'm going to control with a rpi 4 using octopi / octoprint. Well, with this I want to buy a smart plug to power on and off the printer. This is well documented. But what I hope to do is after a successful print shut down the pi and switch off the smart plug to which the pi is connected/powered.
But how do I send a command to the smart switch, on the right moment. So the pi doesn't power of too soon, but the pi is still able to send it's command.
The plugs I'm planning to buy are not yet decided. But I'm thinking about tp-link hs-100 or p100.
When I remotely want to start the pi I simply use the tp-link phone app to power the pi on, which can power on the printer later.