If the filament sensor is connected to the printer, then the printer's firmware needs to have Action Commands enabled, so that it can inform OctoPrint that the filament has runout and it should pause.
thanks for the reply so if that is the case, i have to watch the output window of Octoprint and see if a specific string appears, or ask the manufacturer, then build a kind of trigger?
The filament sensor is already integrated into the printer, so I suppose that should be the case.
You can lengthen the cable from the filament sensor and run it to your GPIO pins and install this plugin Filament Sensor Simplified Then in the Terminal Suppress temperature messages send M412 S0 and than M500 that will disable the filament sensor so it doesn't beep all the time saying it's out a filament when it is not then send M503 and the last line should say M412 S0