I’ve been considering building a filament runout sensor and have this one in mind:
This works with an Octopi and can pause the print if the filament runs out. Unfortunately it doesn’t have dual extrusion support, but I may submit a PR if I have the free time: https://github.com/kontakt/Octoprint-Filament-Reloaded/issues/3
I see that Marlin has FILAMENT_RUNOUT_SENSOR support as well, although since I’ll be using OctoPi - no need to tweak my Lulzbot Marlin config (and pull my hair out when I change toolhead and reflash).
It’ll be a few weeks before I build one, but will share my thoughts here.