Detect valve position without colors
Template matching in the link below will work as a solution.

https://www.docs.opencv.org/2.4/doc/tutorials/imgproc/histograms/template_matching/template_matching.html

The downside is you will need templates of all your valves handles(coloured or not), also the templates and images will have to be the same resolution. 
Based on whether the template or the template rotated by 90 degrees matches you can come to a decision on the valves state.