Usually cauldrons are used for exactly that purpose. The comparator outputs a power level according to the water height inside the cauldron: Empty->0, a third->1, two thirds->2, full->3.
In 1.14 you can also use a composter for the same purpose (signal strength up to 8) and it has the advantage that it can be filled and emptied by a machine. Inputting compostable items has a chance to increase the height in it, but for cakes and pumpkin pies, this chance is 100%. There's a tradeoff whether you want to prepare lots of pies or cakes or whether you want to add extra redstone to it to check whether the power level actually increased, then you can use any of the other items in this list (archive), including automatically farmable ones, such as cactus.
You can also use minecarts with chests or hoppers. When one of these is on a detector rail, a comparator can read out its contents just like for a regular chest. It's probably hard to develop a piston tape-like circuit for minecarts, but it's certainly possible. Rails can be pushed by pistons and minecarts on them move with them.
Shulker boxes can be broken by pistons, transported with hoppers and placed by dispensers. But that's probably not helpful for your usecase.