3D print rotary knob, small PCB with eg. grey code attached inside the knob, springs pressing pogo pins onto grey code disc
Turning knobs on DLSSLR as reference: https://d3nevzfk7ii3be.cloudfront.net/igi/meNesvULPoQvRX3M.huge
Those have 12 positions it seems.