For step 2, the best method would depend on the number of pieces, you can try using 1000+ triggers/volumes (triggers and volumes are different devices btw) but I’m pretty sure doing custom math would be more efficient, it would at least cost less thermometer memory if it’s what you’re looking for
If the count is low you can use devices, tags if you don’t want to link them ig, but it’s not needed