Print pause & filament sensor

Hi to all,

I have Wanhao D6 plus printer and controlling with Wanhao Astrobox (AstroBox_Touch-v0.16(2). I would like to update my system with filament sensor. As far as I know I can’t connect sensor directly to Astrobox . I would like to know how to pause print job with astrobox if I connect sensor on printer.