I needed to query the handle position of my window-door to the terrace, but only had a reed switch door sensor in the frame that registered if the window physically moved out from the frame. This adapter moves the magnet that triggeres the reed switch along with the mushroom cams of the window so that the movement of the window/door handle already changes the switch. I now can query the door handle position even when the door itself is still closed. And that without any battery-powered radio sensor!
Please note: This is just to conway the general idea - you'll need to adjust the model to your window situation!
For a very detailed description, please refer to my Blog.
Fabtotum Personal Fabrikator
The supports are improving the sledge part of the thing, but if your printer is good at overhangs (which mine is not...), you may print without support.
The printed slider with magnet glued to it
I used Windows 10 included 3D Builder to design this thing - I like this program very much!