Fortunately, SmartThings allows you to create virtual contact sensors which Alexa will treat like real ones—and you can even turn them on and off like a switch.
So assuming you have a Samsung SmartThings system, it becomes pretty straightforward.
-
create a virtual contact sensor with switch capability.
-
set up a SmartThings rule to switch that sensor on when the real sensor activates.
-
create an Alexa routine (not a SmartThings routine) that runs when the virtual sensor activates. (Make sure you switch the virtual sensor off again so it will be ready for the next time.)
Please read the following FAQ (this is a clickable link) and then we can discuss any further questions you still have.