You can install an IOT Relay to control your spindle using Gcode commands
M3 S1000 ; Turn Spindle On M5 ; Turn Spindle Off
NB: Do not plug anything else into the IoT relay (leave the Normally On and Always On sockets disconnected). ONLY connect the Router to the Normally Off socket as shown.
Connecting RoutER11 to the IoT Relay
Connecting Dewalt DWP611 to the IoT Relay