🌐 Zone Notification Extended

Then this should do the trick:

{% set restricted_zones = ['home',state_attr('zone.w_dorf_3km','friendly_name')] %}
{{ (trigger.from_state.state in restricted_zones and trigger.to_state.state in restricted_zones) == false}}
1 Like

It works, thank you very much!

When I change the location through developer mode,
on Android devices messages come through
on iOS devices messages are not delivered, in the logs there is such an error
[homeassistant.components.mobile_app.notify] [apns-collapse-id] header cannot be empty. This message is generated externally to Home Assistant.
If I send test messages through the notify service - messages are delivered normally on both iOS and Android.

Hi, a trace log would be great but the message points to an issue that something is way too long like maybe the notification tag.

Notification tag was empty, I added there some text and now its work! Thank you.

Oh, that’s good and bad in both ways. The good: it works, the bad: recent notification will overwrite old ones.

Could you check if you can get a notification on your iOS device with this service call? Did you also enabled critical notifications?

service: notify.YOUR_SERVICE_HERE
data:
  message: Test
  title: Test
  data:
    tag: "{{ none }}"

Thanks for this Blueprint
I am trying to configure the automation but I am getting error in between the traces as below

what could be the reason . I am using Andriod Phone

second question: are these field mandatory to be filled ?

Suggestion for improvment:
can you add one filed to select Alexa echo to announce the notification.

Thanks

Did you trigger you automation manually? If yes, see the FAQ in the initial post.

No, they are already filled with defaults.

Here in the thread is an example for this. You can simply add a custom action and copy the notification text into the fields of the alexa service call.

This is the way I managed to notifiy via Amazon Alexa devices/service.
I start with raising the volume for all devices, then shout out the notification finishing with lowering the volume for all devices.

Excerpt for one device…

custom_action_arriving:
      - service: media_player.volume_set
        data:
          volume_level: 0.85
        target:
          entity_id: media_player.gesamt
      - delay: "00:00:03"
      - service: notify.alexa_media_arbeitszimmer
        metadata: {}
        data:
          message: >-
            <prosody volume="+6dB">Das Tor geht gleich auf! Sind alle Hunde im
            Haus? </prosody>
          title: Achtung!
     - delay: "00:00:03"
      - service: media_player.volume_set
        data:
          entity_id: media_player.gesamt
          volume_level: 0.4

Love the Blueprint, super smart logic here!

Thanks!

Just to check, the “x minutes before notification fires off”, this is doing these two things (assume x = 2 mins):

1, Person arrives at zone, is in zone for 2 minutes. “Arrive” notification sent
2, Person leaves a zone, once they have left and stay gone for 2 mins, “left” notification sent.

What happens if someone is just driving through the zone?
Seems like 1 would not trigger, but 2 would. Unless the logic for 2 is only trigger leaving notification once person has BEEN in the zone for 2 mins and then leaves. Is this possible?

1 Like

I think this needs a little more digging, but it seems difficult to me since automations are stateless and only operates with the current and maybe last state of an entity.
What it needs is the duration between the over last and the last state (not current one) and imho there is no way described to get these information.
I’d setup some sql sensors in my setup but not for that purpose.

1 Like

OK so perhaps it needs a proxy for the state? So something like:

  • When a person enters a zone, turn on a dummy switch.
  • When person leaves a zone, turn off dummy switch.
    If when the switch turns off, it has been on for 2 mins, fire the notification?

Or using something like this?

$moment(data.old_state.last_changed).diff($now())

Thanks for the hint: trigger.from_state.last_changed should do the trick.

1 Like

Really like the Zone Notifications Extended Blueprint!

Is it possible to make finer steps in Duration? I have experienced WiFi glitches that trigger a zone automation, but only last a short time. There are some correct zone changes that open my garage door for instance that 1 minute could be longer than desired. Maybe 30 sec steps for Durations?

Thanks

1 Like

Yes, I will change the slider selector to duration selectors but that also means to resetup or edit the existing automations. (breaking change)

I’ve got basic notifications set up for entering/leaving a zone. I wanted to add a button for viewing my map for each notification but I cant get this working.

what do you need to confirm this? i had to add a tag to get notifications to work to a iPhone.

i am tracking andriod user and send to iphone?

Did you try the suggested service call and check about critical notifications?

Hello, I’ve been trying to diagnose a issue, it’s not working for my ios device, but on Android is working. All type of notifications are enabled in the settings, tried using the notify group and also selected the device to be notified in the ui. Other integrations can send messages to the same device.