Door auto-unlock via esp32 - help finding the right condition

Dear all

I have a smart lock. When I approach the front door, my smartwatch sensor connects to the esp32 (in a nearby closet). After connecting, HA waits for the storm door to be opened. Once the storm door opens, the smart lock will unlock.

Because the esp32 range is very iffy ---- How do I add another condition to determine that I am outside the door vs inside the home?

THanks all!

spitballing here…

smartwatch connects to wifi, updates status via mqtt, mqtt topic updates, unlock door.

This should unlock your door anytime you’re within distance of your wifi.

Thanks for the idea.

I tried wifi via deco integration. Watch/phone connects from too far away from front door that it might pose some risk. Thus, i got into esp32 thinking i could finetune the distance to be a lot closer to the door.