On my K1c I used a TPLink wifi switch to shut down the printer approximately 4 min after completion of a print.
I had rooted the printer and installed moonraker and fluidd.
this is the mods required to operate the tplink.
In moonraker.conf :-
[power printer]
type: tplink_smartplug
address: 192.168.0.172 ‘use the IP address of your smart plug
restart_klipper_when_powered: True
restart_delay: 3
port: 9999
In gcode_macro add :-
[gcode_macro POWER_OFF_PRINTER]
gcode:
{action_call_remote_method(“set_device_power”,
device=“printer”,
state=“off”)}
[delayed_gcode delayed_printer_off]
initial_duration: 0.
In the End print macro add the last line :-
[gcode_macro END_PRINT]
gcode:
Qmode_exit
EXCLUDE_OBJECT_RESET
PRINT_PREPARE_CLEAR
M220 S100
SET_VELOCITY_LIMIT ACCEL=5000 ACCEL_TO_DECEL=2500
TURN_OFF_HEATERS
M107 P1
M107 P2
END_PRINT_POINT
WAIT_TEMP_START
M84
UPDATE_DELAYED_GCODE ID=delayed_printer_off DURATION=300
Unfortunately creality has hidden the moonraker.conf file in the K2 printers and is not accessed by fluidd.
May be there is some one who knows how to access moonraker in the creality file system.
Bill