Heating pipes system with valves and counter