What if for all the people who remain at home, their device_tracker regularly reports “enter”. It means that just a moment after your device_tracker reports “leave” (and the lock is locked) someone else’s device_tracker reports “enter” (and the lock is unlocked).
I don’t know for a fact if that is how your device_trackers work but it would explain the behavior you’re observing.
I believe you can replace the two automations you are using with this one (untested because I don’t have device_trackers and zones):
It will also report (to the system log) which device_tracker did what (enter or leave). You can then refer to the log to see which entity is responsible for unlocking the lock.
It’s a Schlage connect connected via zwave USB. Yes it always works on its own like it should.
I’m going to try to observe it when I get home I almost wonder if somehow homeassistant is not reporting the state correctly or the lock is not recording the state correctly
I mean it should work pretty much the same … but from my personal experience to accomplish having something happen when someone comes or goes I use “home” and “not_home” with the person entity with a couple device_trackers in it to prevent it falsely or briefly switching back and forth … there is also a consider_home option to delay the marking of someone as “not_home” which may be what’s happening if a phone briefly switches WiFi, goes to sleep, etc… and the automation @123 showed you will help you troubleshoot that.