Your real problem is how to integrate or mount on valve.
If rising stem you could use a flag on the stem and mount approximate switches to detect the flag. Switches mounted separately with mechanical adjustment of position possibel.
And/or if non-rising stem the best way technical is to mount a manual gear with integrated or possibillity to mount limit switches on the gear. Several suppliers.
Valve accessories such as position switches or actuators are more difficult to implement well with rising stem valves than with quarter turn valves. Position switches are a standard feature for automated valve actuators. However the actuator selection is also easier for rotary valves. Perhaps a double nut on the stem inside the yoke could be fixed in a manner to activate a proximity switch. Consult the valve suppliers; and accessory manufacturers such as Westlock, Moniteur, GO, etc.
You also need to know the electrical hazardous area classification as well as the sensing voltage and current. The length of the travel also varies by the valve size.
rotork fluidsystem have hydraulic & pneumatic actuators that can easily be fitted with limit switches or position transmitters without any difficulty, as these are "standard requirements". They also have (not published on the net) experience with wellhead linear actuators, these had perspex visual inspection fitted on spring chamber with inductive limit switches fitted.