But this is not always correct… I noticed that my dir of travel can also be stationary when the state trigger leaving Work zone get’s activated.
So how can I keep track that I’m towards Home and keep into account that the I exited Work zone right before?
What do you mean by it being “not always correct”? How can you know if it’s correct? Will it be correct a certain amount of time after you leave work? Will it be correct if it’s stationary when you leave, and then changes to something else?
First you have to specify when and/or under what conditions it should be considered correct. Then a suggestion can be made as to how to proceed.
Good point… as soon if the dir of travel is towards and I left the work zone, I would like to trigger the notification.
I just wanted to point out that when I only set the trigger for leaving the work zone my dir of travel sometimes is stationary ( because I’m at a traffic light ).
So when dir of travel changes to towards, and you’ve left the work zone within the last century, …???
I think you need to think more about what the exact sequence(s) need(s) to be to send the notification.
How about this? After leaving work, wait until dir of travel is not stationary. Then if it’s towards, then send the notification, otherwise abort. Will that work? Or could it be “away_from” after you leave the work zone (maybe, e.g., if you’re walking to the car in the wrong direction???)
Sorry, don’t mean to be facetious, but until you’ve thought about all the possibilities and defined exactly what should cause the notification to be sent it’s kind of hard to implement something that will do what you want.
No worries, I hope you don’t mind this discussion. Because this is the first time I want to dive a bit deeper in the automation possibilities so normal I did not yet think this through enough.
So in my mind… the work zone in home assistant is a circle and for my notification trigger I would like to send it as soon as I cross that circle. Timing would be in minutes I guess… so from 0 to 5minutes I left the circle.
Then the direction is important. I only want to actually send the trigger if it is determined that I’m toward my Home zone. So not stationary or unknown or away ( so none of the other directions ).
Just an FYI. If you were to leave the work zone, while dir of travel was not towards, and while it stayed that way and before the 5 minutes were up, you re-entered the work zone and left it again, the wait_template would be aborted and the next step would run, meaning it would send the notification. Not a likely scenario, but possible, especially if you “hover around” the border of the zone. This is just a side effect of the way automations work. If that becomes a problem there is a solution – move the action steps into a script, and then in the automation action “turn off” the script then run it. Let me know if/when you might need that.