Just a heads up, it may be advisable from the beginning to change your trigger from “device” to ‘state” trigger.
Your can check the state in developer tools section, but most door sensors are either in a state of ‘on’ or ‘off’ rather than the expected open or closed for example.
The reason for this is over time you may wish to change the door sensor, replace it, move it somewhere else etc and the device ID would change and mess up any automations and or scripts that reference to it, were as if you were to reference to the state of the entity_id instead then even completely changing the device you could simply edit the new sensors entity_id and none of your automations or scripts would be affected.
PS: you can easily change entity_id but not the device ID