Hydraulic cylinder pressure switch