Is there a way I can track how much filament is left on a roll?
Either an add-on sensor I can build or software that will track how much is used vs how much is supposed to be on the roll?
Have a Prusa Mk4 and it's working ok so far but been having trouble with very long prints so trying to figure out if my rolls have enough left
Look up instructions for your slicer on how to get the weight (in grams) of an object before it prints.
Take your spool, and weigh it -- ideally with a kitchen scale, in grams.
Go to this website and find your empty spool weight.
Subtract the spool weight from the kitchen scale weight. This is how much filament you have left.
Compare the number from your slicer to the filament you have left.
If you'd like, you can also look into getting a filament runout sensor so you don't have to hover over your printer to catch when exactly it runs out of filament. It'll automatically stop the print so you can replace to spool.
There are octoprint plugins for that, but most people seem to weight the rolls. Substract the weight of an empty roll and divide by weight vs length. You have to measure those things first.
Assuming the filament on roll actually weighs its marketed mass (eg you get 1 kg of plastic on a 1 kg spool), you should only need to weigh the spool before you use it. That said, I bet there's variation in density amount colors for the same vendor/material and I suspect they measure by length.
I'm going to have to weigh my next spool and look for a method to track usage. My prints tend to be larger and I'm constantly worrying about running out of filament. Thankfully my prints are mostly functional, so I don't mind a random color change, but babysitting until the end of the spool is a pain.
You could weigh it, but you'd have to know the specific spool weight. Some spools have a scale on the side giving a rough estimation on how much is left in grams, but you could only do this yourself if you knew how much was on it to begin with (calculating the volume left and printing a scale for example). Other than that... No. Have a new spool ready and wait until the old one is empty.