Pressure mats that work with SmartThings. These are also popular for Halloween, by the way.
Using the user code on a smart door lock is a very good idea and should be one of the most reliable methods if it’s a door that has a smart lock on it.
Some people have tried this with two sensors, but the timing gets really tricky. See the following recent discussion for more details: