Improve false readings

Morning,
I have a driving indicator that tracks where I am at. I am trying to have it trigger when I go stationary for a period of time and then back to towards. I have read a lot of posts about the for.
Here is my experience on for. I assumed that for relates to the period of time that it waits for a single to, to change state. So for example, I have it reading proximity from my phones location. When the phone goes stationary for 15 secs ( to help with false triggers ). And then when the state goes towards. Fire the automation. The problem is this. If set stationary for 15 secs. It also sets towards for 15 seconds. Sometimes it either doesn’t fire or it will fire 5 minutes later. I did create an automation that will tell me what the sensor is doing. It is announcing pretty close. So the sensor is changing close to me stopping at a stop light. But will not trigger the other automation till it is way to late. There is a lot more to this automation. But I have removed everything else till I get this working correctly.