I advise you to be familiar with the engine first by following some tutorials. You will find it all on the website.
If not to try to answer your question.
You can, for example, use a control that you add to your space, this controler will take care of moving the space (movement of the door)
For the switch, you have several possibilities.
You can use the GhostControl (JBullet) to detect a collision with a zone, which will determine that you are close to your switch. Then check if you look in the direction of the interrupter, you have a scalar products between the direction vector and that of the switch.
In A AppState, you execute the code that performs these searches, when conditions are met, it is from the AppState that you call a method of your Controller attached to your door.
Then your Controler will move your door, play a sound …
Another possibility, without the use of Jbullet, is to first test the distance between your switch. If you are close, then you test if you look at the switch. If both conditions are met, then you call a method of your door controller.