TP-Link Smartplug plugin, stop with timer?


I would like to know if it is possible to turn off the printer when it has finished, but with a delay or at least cooling.

I have a TPLink connected socket, and so far I have configured it so that the TP link cuts the printer when it sees the M81 command, a command that I integrated into Cura.
It works well but it stops immediately after finishing. So I would like a delay before turning off or a temperature threshold of the tray for example.

I tried this:

But I removed the line M81 from cura.
And it doesn't work.
Is there a way ?
Do I have to leave M81 in Cura?

Thank you for your help.

Excuse me for ma limited english, I'm french

Read through this thread and especially the post I directly link. This is exactly what I'm doing on my rebuild for my 3D printer's interface.

You're probably just missing the Off on Idle option being enabled for the individual plug. You can actually disable the GCODE options altogether once you do that and remove it from your gcode print complete scripts.

Thank you,

I'm testing her dice tomorrow.