How to save latest called ptz preset

Hello guys. Help me please how can i save latest called ptz position for calling it in future?
i wanna use it for change position of my camera when somebody calls to doorbell, and after opening the door, change position back? I’m telling about already presetted positions. Thank you in advance.

P.S.: i have nodered instance too but can’t understand how to make flow.

Without seeing all the entities involved…

(events: state) doorbell → (current state) camera → (change) PTZ info from last node into msg.PTZ [just for safe keeping] → (wait until) door opens → (call service) PTZ back to starting point.

Not sure how you are controlling the camera as I can’t see an appropriate service to call when I check the Camera Intergration page so I can’t be more help.