I use a presence based automation to unlock my smart lock inside my garage when I am driving home. The problem is that this automation fires off sometimes when I am leaving home as well. Right on the edge of departing my home zone, it puts me into Away but sometimes momentarily reverts to Home before it sticks with Away finally. Because of this my smart lock unlocks even though I am leaving the house.
I was hoping to solve this by only triggering the unlock automation if entering home AND was away for at least 5 minutes prior.
I tried using a condition for the latter part of that AND statement, but that doesn’t work. At the time of triggering the automation it doesn’t have any past state to deal with, and in the current state of Home the condition will always be False.
How can this be solved?