🌐 Zone Notification Extended

So, the error says the trigger object has no entity_id but the only allowed trigger is a person. Every entity in home assistant has an entity_id.
From that what I know the error only can occure if you select the automation and trigger it using the menu and not by changing the state of the person.

Omg… I did that every time in the beginning, but not in last few days. Sorry about that and for wasting your time.
How about the coffees?

Just a suggestion, but when I momentary leave the zone and go back to it, it will fire the notification. Nothing wrong with it, but lets say I’ve just went to take out the garbage, or my GPS flew out of the zone for a sec, it will fire a notification without need.

You have a timer for when you enter a zone and stay infor 5 mins, but it could have a timer to trigger only after you went out of the zone and stayed out, so if you come back in in less time that selected on that timer, it wont fire the notification.

Hope you find it helpful

1 Like

If you want to acknowledge my help and work, feel free to buy me a coffee. I have edited the first post to that effect. Thank you!

Thanks for your feedback! I can add a time slider the person must stay in zone before notification gets fired. Will provide a test version later this day. :wink:

//EDIT: Ohh… i am out. There is already a duration slider for this use case. Are you using the latest version of the blueprint?

This is a really neat bit of software. Many thanks. However, this isn’t working as desired. Hopefully, it’s a configuration issue on my part.

Scenario: I have created a zone to cover my housing estate (named Les Springs). This zone covers roughly a 400-500 yard radius from the house, well outside my WiFi range, so I’m using HA Cloud on my iPhone. I can access HA remotely using cell service, so I know the cloud-access is working.

Desired Operation: When I leave a zone (in my case, my subdivision - named “Les Springs”) I do not wish a notification. However, when I arrive back, I do wish a notification.

Actual Results: When I leave the zone, I get a notification. When I arrive home, I only get a notification when I’m pulling into my garage, so that suggests either a delay (as I’ve been in the zone for at least a few minutes), or its detecting my WiFi and using that.

Screenshot of Automation Configuration:

Automation Code (automatically generated from Automation menu):

- id: '1700093735163'
  alias: Test of HA Zone Notification
  description: ' '
  use_blueprint:
     path: panhans/zone_notification_extended.yaml
     input:
    persons:
       - person.darrell_earnshaw
    zones:
      - zone.les_springs_subdivision
      notify_device: 5c409a1f3a9f8b782f9f7526848593e5
      is_leaving_notification_enabled: false

Any thoughts?

1 Like

I’ve tested it right now with your configuration. Everything works for me as expected.
(If you want to test it without running just open states in the developer menu and manipulate the state of your person)

So, you just want to get a notification when you get in your zone, right? Can you please provide the trace log after you got the unwanted notification? Just click on your automation, then trace in the upper right corner. There you can download the json tracelog.

Upload it for example here, click on submit and share the generated link with me so I am able to dive deeper in your configuration and called logic.

You can play with the home assistant companion app settings to send your location more often. E.g. my wife’s phone is very lazy with location updates so sometimes the notification got missed when crossing a zone.

Thanks for your report / feedback!

//EDIT: you have to use this version for creating a full trace log since home assistant has a bug with hashtags (used for coloring android notifications) inside a variable which results in creating only incomplete trace logs.

OK. I deleted the old automation and created a new one using your template. This one worked fine - I got a notification when I entered the subdivision, and nothing when I left.

(The previous automation was based on the original HA zone notification, but I thought when I changed it to use the extended version it would overwrite it, but something didn’t quite work as planned…deleting the old automation and creating it solved the problem. Thanks.)

1 Like

:fire: ZONE NOTIFICATION EXTENDED v3.1 :fire:

Quick question: I think it’s still notifying me when I LEAVE the estate (and also when I arrive, which is the desired behavior). Obviously, I need to grab a trace on the way out, which means doing it from my iPhone. Where does it store the JSON?

Go to your automation. Click upper right corner on trace. Next view click upper right corner again. Please post version number and be sure you’re running latest version.

Hey there

Love this blueprint, and works well with little effort too.
However I have run into a small challenge that I’ve trying to solve.

My Set up

Zones
Home (default)
Home 2 (30 miles away)
School

I then have 4 persons setup each with a device tracker attached

My Challenge

This blueprint works really well when any of the above persons enter and leave Home. However it does not work when they enter or leave any of the other zones.

Initially I was thinking an entity is not being updated somewhere, but I have standard badges on my lovelace dash which clearly shows the Zone each person is in. So I’m not too sure what else to look at

Any help would be appreciated - let me know what other info you need

Thanks

First check if you’re running latest version. (3.1) Just have a look in your blueprint description. If this is the case, then post your latest trace log:

  1. Go to your automations
  2. Click the upper right menu
  3. Click on trace
  4. Next view click again and download trace
  5. Upload trace log e.g. here, generate link and share it with me

Update. The notification seems to be happening when I leave the sub-division and when I return, both with the same message. (Screenshot of the notifications from my phone are below.)

I can verify I am running version 3.1.

As far as capturing the JSON is concerned, it looks like I can only capture it when using a browser (as opposed to the companion app - IOS or Mac), which means I can only do it when I’m at home. Also, only one set of traces are available - the last ones when I arrived home, which means that I can only capture the trace of the desired notification, and not the undesired one. :frowning:

(The last JSON I could download is at: https://controlc.com/a05749f7.)

Any suggestions?


Could you post a picture of your history for that time window where you switching the zones?

Hey

Yes defiantly v.1
Sent you link to trace privately - Name [Sitansh - Zone automation trace]

Cheers
Sitansh

PS some notification started to come through this evening

Was this what you were looking for?

Not so sure what the history tells you: That the automation was enabled (i.e. ‘on’) for the whole time, or I was home (or away) for the whole time?

Thanks for the trace:

  1. You have whitespaces at the end of your zone e.g. "School ". HomeAssistant set the state of the person to “School” without whitespace. Check your names and eleminate whitespaces at the end and start. I will update the blueprint in order to ignore them.

  2. If leaving and arriving zones are same, just enter the zones in the first field.

  3. If notifications come too try to disable battery saver for the companion app. Notification are always send with following settings which forces them to send immediately:

ttl: 0
priority: high

The history graph and the log of the person you track to see the zone switches like this:

Then we can see when the person actually changes state.

Gotcha.

OK, if I run a history on myself then we get:

And this reflects the correct periods. I left at 7:59 am and came back at 9:41 am. So, it looks like HA recognized that I’d gone and come back correctly.