JamSentry, a device to detect filament jams and runouts

Here is a device I built to detect printer jams and filament runouts. I use it on my Lulzbot printers. Here is how to build one.

I’m very interested in this idea. I made a similar post using Octoprint. The way I did it Octoprint can detect a filament runout condition only. But I think a jam would occur first since most rolls don’t have the end of filament loose. The filament is sort of bend into the spool.
So a way to judge tension on a spool in addition to a break is excellent.

What sort of gcode changes need to be made to “gcode sender program”?