Thank you. That worked. I did search for it but couldn’t find it for some reason. I was not able to use the code you pasted, the formatting is funky. However, I was able to find the code in GitHub based on what you posted.
Here is the link directly to the GitHub code:
https://github.com/constjs/SmartThings-Devices/blob/master/monoprice_motion_sensor.device.groovy