That’s sort of how I do it in my house. You really need to have location and presence working together, otherwise it’s going to think you’re back if your phone suddenly drops off Wi-Fi and then comes back on.
I use homebridge/HomeKit for the location part but you can definitely use IFTTT. It works well and it’s fast for that particular function.