filling and draining at the touch of a button

How are the containers/bags going to be supported? If they're suspended, or supported by a platform/support which could be allowed to move, then it would be possible to take the weight with a preloaded element which would deflect when the weight exceeded a threshold. You could use that either as a visual prompt to stop filling, or to operate a switch to indicate the full level.