I understand what you need. I want to use the entire spool of filament and don't want to trash out the end of the partial spool. I sell my prints and that cuts straight to the bottom line. If you google filament detection switch you will see several choices. I don't want to give a sales link but they are easy to find. I used one of those switches to control a 10 amp relay. This 10 amp relay gets power for the wall plug and then has a receptacle to plug the qidi x-max into. If the filament ends/breaks, it cuts power to the unit as though there was a power failure in the middle of the night. On startup simply preheat everything for about 30 minutes and then restart the print from the "failure" point. The only downside is that killing the power also kills the cooling fan and the heat can soak up into the extruder. It's easy to rectify should it cause problems. I wish Qidi would give us access to the source code, I'd add the code to interrupt it without power down. Would most likely take at most 5 lines of Python. Hope this helps.