I have SmartThings at home for various IoT things. Among them I have a garage door controller, and a presence sensor. I put the sensor in my car, and wrote a script that closes the garage door when my car leaves, and open the garage door when my car comes back (with some logic to prevent it from opening unexpected, I documented that part in my blog: https://wang.yuxuan.org/blog/item/2017/03/smartthings-myq-an...)