While perhaps not suitible for commercial applications I have implemented a door position sensor. Not only does it allow reporting of the door opening and closings but also the current position if it is partially open!
It uses an unmodified Ruuvi tag, factory installed firmware and uses RuuviCollector to update an influx database running on RuuviBerry installed on a Rasperberry Pi Zero W!
The Ruuvi includes an X-Y-Z accelerometer. When the tag is not moving, the Z component reflects the orientation of the tag. See previous discussion Garage Door Monitor
Attach a Ruuvi tag with a piece of double-sided mounting tape to the door frame so it hangs down over the door at the hinge edge. This allows the tag to tilt based on the door position.
accelerationZ when closed =-0.16, partially open=0.264, fully open= 0.872
See a video
Perhaps one of you mechanical engineers with CAD / 3D printer skills can make up a more “professional” version.