Edit the printer end code.
So,in cura 3.1 click preferences/configure cura/printers/machine settings
I have this in my end code
M104 S0 ; turn off extruder
M140 S0 ; turn off heatbed
M107 ; turn off fan
G1 X0 Y210; home X axis and push Y forward
M84 ; disable motors