In many home security systems they use magnet switches to detect the state of the door.
You could also use something like IR to see if a certain part of the door frame is blocking the light.
And one more option is to sense if the door is horizontal or vertical, basically you would mount it to the inside of the door, when it opens it would be horizontal and closed would be vertical. This is actually how most of the off-the-shelve generic sensors work.
If you have a particular method that you prefer I can give some specific sensor recommendations as well.
Edit: I missed that you said you wanted it 4 meters from the door. I am not sure if you just want this because you don't want to deal with wireless, but the IR method can also work in which you put something that reflects IR on the door and then have your sensor look to see if your IR beam has been reflected or not.
Some more additions:
If it were me, I would get something like this, there are lots of other brands and methods that are used. Buying sensors and wireless modules can be pretty expensive when bought in quantity 1 and probably wont be worth the cost over just buying the off the shelf method.
Now if it were me wanting to tackle a fun project, I would use an accelerometer attached to the inside of the door (could even be a board just Velcro'd to the inside of the door). The accelerometer doesn't need to be anything special, just something that when attached can detect acceleration in the down direction when the door is vertical and the down direction when the door is horizontal. It so happens that the force of gravity will show up on an accelerometer. I would then use an Xbee module to transmit the status to an xbee that is inside.
Realistically you don't need to transmit very much very often, you could put everything into sleep mode when ever you aren't reading and then once every minute or so wake up and transmit the current state. Because of how little the device is on it could easily run off of a battery for a decently long time.
There may be other, better, methods of detection, but when ever I do a "for fun" project I like using parts that I might use in other projects. It helps to grow the intellectual property that I have, which is useful for the future.
Get a 5V transformer, put a bridge rectifier on it, connect it to a digital input, add a 10k resistor in series and a 5V zener diode across to protect the input from overvoltage as transformer will probably give you greater than 5V peaks.
In arduino firmware set up an external interrupt on said digital input. You should be getting interrupts 100 or 120 times per second. On every interrupt record a timestamp. In the main loop check if last recorded timestamp is older than 0.1 second.
Best Answer
Assuming 1, this is a proof of concept with a standard soda bottle and bottle cap, 2, no liquid will be used for this (waterproofing and safety is not being accounted for), and 3, your handling the bluetooth and sensor input on your own.
A mercury or tilt switch is not practical. Any movement of the bottle will trigger it, let along twisting it off. Also, mercury in possibly a drink bottle? No thanks.
A hall sensor would require a magnet placed on the bottle (a fixed point). This might increase production costs from new material and changes in manufacturing.
A rotary encoder is expensive compared to a potentiometer. And so much more complex in terms of input. A pot is also more complex than you need.
A simple push button or momentary lever switch is really the most practical thing. Just mount it so it is closed when on the bottle, and it is opened when off the bottle (or vice-versa). That's all you need. Just two states (On/Off). The rest is your coding.
A slightly better option is a photoresistor. No moving parts, as long as the bottle is black/dark or there is a label around the neck up to the cap, and the bottle is used in a lit room, it will work. Then again, it might not work in a dark room like say someone watching a movie with the lights off. Nah, a simple switch is best.