Before continuing, be aware that this remote broke after just a couple of days. It could be bad luck, however I made a new one with the nexa magnetic switch sensor seen here:
My apartment is full of 433MHz and zwave devices. However I couldn't find any door lock sensor. (I can't use servo locks). My idea was to use a raspberry pi and the gpios but having to hook something up the the outlet just to be able to see if the door is locked or not felt like a bad idea. I wanted something running on batteries and this was the best idea with the least amount of wires :) This is of course not wifeapporved and i will do something to hide the remote and the wires later, or atleast make everything white to blend in ;)
I had a microswitch and a old nexa remote which I didn't use and which together would make a great sensor.
Step 1: The Remote
I first opened the remote and found that I needed 3 wires to simulate keypresses. As you can see this board had premade holes which made the wires easy to attach.
Step 2: Attach Wires
Now I can simply connect one of the brown wires to the green wire to send a on or off signal.
These wires were connected to the microswitch. If the switch is closed it should send a off signal, if the switch is opened it should send a on signal.(Domoticz which I use see a locked doorlock as off and a open doorlock as on)
Step 3: Mounting and Final Result
I placed the microswitch inside the lock with double sided tape. In the video below you can see the sensor in action :-)