Your photo didn't display for me.
If you're using something like the
WCP hall effect sensor, most teams would treat that as a limit switch, observe its state via a DigitalInput, and count the number of times the switch tripped in code. The PID is a pretty long way to solving your problem.
I would recommend two limit switches on your elevator -- one that trips when you are in the lowest position, and the one that rides on the elevator triggering at the various tote heights (note that I think of the hall effect sensor as a limit switch). This lets you know initially when the elevator is in the lowest position, so that you can correctly determine at what level you're at.
Alternatively, you can always start the robot with the elevator at/below the first position, so that you know your starting position. I'm not a fan of this approach because it doesn't work well if your robot crashes during a match.