Just check out ne version. Whitespaces will be ignored now.
Nice one - thanks
Iāve also removed spaces anyway
Thanks again
Ok, so the automation is triggered correctly but seems the notification got queued and send not immediately, is that correct? Youāre on iOS, right?
//EDIT: Seem iOS need a special treatment. I will provide you a test version tomorrow. Maybe setting this critical option solves your problem.
So, the symptoms are:
-
When I reach the zone (subdivision) boundary when leaving home, the automation seems to correctly detect that, at the appropriate place where my zone boundary ends, and immediately issues a notification. However, it issues a notification that Iām arriving. I believe this is incorrect, as the transition is from āhomeā to āawayā (or inside the zone to outside). This is the undesirable outcome.
-
When I return into the zone, it correctly identifies that Iāve arrived back and immediately issues a correct notification. This is the desired outcome.
This zone boundary is 390 meters away from the house, so well outside of my local WiFi coverage.
Youāre correct that I am on IOS (iPhone 14 Pro running latest version of IOS), with good 5G coverage. (Although, Iāve noticed there hasnāt been an update to the companion app since I installed it earlier this year.)
OK, thanks.
BTW, Critical notifications are enabled for HA on my phone.
Tomorrow, I need to be somewhere that I have access to a web browser, so maybe I can get a decent JSON trace while away from the house - that might help to see what happened when I left the zone.
Didnāt get it. This is the history of the person state:
And here the timestamps of the triggered automation:
You only enabled arriving notifications. So you will get two notifications at 7:57 and 9:41
So now have a look at your screenshot:
Its 9:44. First notification 1 hour ago. Thatās 8:44. Nothing changed that time. Latest notification 2min ago. 9:42. That fits somehow.
So it seems the first notification comes way too late since the automation got triggered at the right moment. Could you have a look into your companion app. On Android I got a notification history in companion settings. Could you check timestamps there?
However Iāve added the critical notification setting to the blueprint. Maybe you check it out and test it again.
OK, maybe Iām being a little dumb here and not fully understanding what I should be seeing.
Iāve only done one trip today, which lasted ~ 1 hour or so. Before I started off, I cleared all the previous notifications from my phone so there were no old notifications hanging around. To my thinking, I should have only got one notification - when I arrived back home.
When I drove out of the gate from the subdivision, the phone pinged with a notification that I was arriving back (wrong), and that was around 8:00 am - I didnāt check the exact time, but around 8-ish would be in the right ballpark. So this first notification was in error. It wasnāt delayed, as it happened just as I transited the zone boundary. (Plus, Iām curious as to why was it triggered twice 2 minutes apart at 7:57 am and 7:59 am? I wonder if somehow it thought Iād dropped out of the zone after 7:57 am and reentered before 7:59 am, that would sort of explain it, but that should not have happened.)
When I got back an hour or so later (9:41 seems about right, as Iād texted my wife at 9:34 saying I was heading back), I received the second notification as soon as I entered the subdivision (correct). Again, no discernible delay.
What am I missing?
Ya know, Iām thinking maybe I should enable leaving and arriving notifications to see if it reports me leaving and then arriving back in the correct order (with correct timestamps)?
OK, it looks like it may be a phone issue. I enabled both departures and arrivals this morning, and got both as I was leaving the subdivision, 1 minute apart.
So, Iām suspecting my phone is either losing the plot on the way out of the subdivision, or itās somehow grabbing my WiFi network again. Either way, Iāll try reducing the radius of the zone and see if that fixes the issue.
You can also try the default Zone Notification blueprint that ships with home assistant per default. Would be interesting if you experience with that the same issue.
If yes there is something wrong with your phone / app settings or your connection. Maybe you could play with the polling interval or other settings in companion app related to location service. Donāt know how it looks on iOS, but on android I have to change some settings for certain devices, e.g. pixel 4a. With my pixel 7 for example location updates work out of the box.
OK, Iāll try the default Zone Notification to see if the symptoms change. However, this standard blueprint has very limited options for actions, which really doesnāt suit my needs.
Using your extended version, I just walked out of my subdivision and I got an erroneous āArrivalā message before I was half-way out of the zone. I then got a correct departure message when I was well outside the zone. I also go a correct arrival message when I walked back into the zone, albeit this was delayed fractionally. (BTW, I tried to download a Trace from my phone when I got the first erroneous Arrival message, but I have absolutely no idea where it is stored on the iPhone or how to retrieve it. Any ideas?)
Sadly, the IOS companion app doesnāt offer any form of tuning parameters, nor does IOS itself - itās pretty much locked down - and annoyingly, thereās no logging facility
OK, I think Iāve solved the mystery. Itās not a phone issue, but the way zones work in HA (and the way the blueprints handle them).
I have two overlapping zones: Home and Subdivision, both centered on my house. When Iām home, Iām clearly in both, but HA only allows a device tracker to be in one zone at a time, so it picks āHomeā. When I travel outside the subdivision, I cross the boundary between Home and Subdivision (still inside Subdivision) - thatās where the erroneous āarrivingā message comes from. As I continue out of the Subdivision zone, I get the āleavingā message (as expected). When I arrive back in Subdivision, I get the āarrivalā message (as expected). When I get closer to the house and enter the Home zone, it doesnāt give me a ādepartureā notification, but quietly moves me from the Subdivision zone to the Home zone.
The solution was to modify my Home zone (in configuration.yaml) to have a much larger radius that encompasses the whole subdivision, and get rid of the Subdivision zone altogether. I tested it and it works as expected. Of course, the down side is that it makes using the person entityās location to determine whether theyāre actually home or not problematic.
Feature idea: It would be great if I could type a zone name instead of choosing a zone entity via the entity picker.
Example: I could set a zone around all of the grocery stores that I go to and call it āGrocery Storeā. Then I would type āGrocery Storeā for the zone to match instead of choosing zone.grocery_store
, zone.grocery_store_2
, zone.grocery_store_3
, etc.
Then I would use this blueprint to send me a notification with a link to my Home Assistant Shopping List.
Matching a zone name instead of choosing a zone entity would allow me to add more āGrocery Storeā zones on my map without modifying this blueprint each time.
So, you want to add some wildcard functionality. I think itās a good addition to add two additional text fields (enter/leave) for that use case.
// Would you go with entity ids or with the friendly names?
I would use the Friendly Names. I think it would be simpler for a novice user as well.
I just did a quick test. Works for me. If you want you can test it. When everything is fine I will merge it into the main branch.
hey @panhans, great work.
I am wondering if you can help with something that may be simple. I want to configure the message in the notification to include waze travel time.
e.g Person has left work, will be home in XX minutes
thanks
Iād installed waze travel time integration on my test system. Thanks, I didnāt know it unit now.
Try this:
{{ person }} has left {{ zone }}, will be home in {{ state_attr('sensor.waze_travel_time','duration') | round() }} {{ state_attr('sensor.waze_travel_time','unit_of_measurement') }}.
Hi I started using this but wondering if there is a way to only send a notification when my device stays in a location for a certain amount of time. As it stands now with my zones configured a lot of them are congested in the same area and every device is bombarded with notifications when Iām simply passing through to another destination.
Another question I had was is there a way to switch the notifications from critical to a normal push notification? as it is now you are unable to silence them which for me is fine but for my wife she finds this to be very annoying.
Thank you for the work you have done!!!