wow i worked in plumbing for a while, and ive never seen this. I know what the shut off valve is but have no clue what that is in the wall. Looks like it might be a PRV of some sort if it drains out the side like that. Ive only seen those on water heaters. What kind of fixtures etc do you have in your house??