Leaving a zone without notification and entering the home zone with a notification

Hi,

I want to be able to leave a zone without notification and enter the home zone with a notification.

Searching I can only see you can notify on each not just the enter to zone.

Thanks

Adi

Can anyone help please?

Thanks mate, nice Blueprint and I’m trying to use it but my use case is for notifying a mate (who doesn’t use Home Assistant) with the following missing in case your interested in adding more functionality:-

Device to notify - Can you make that optional? I’m using the Custom Action on arriving with a WhatsApp message instead so I don’t need to notify myself or my g/f as I will already be home - without adding a HA connected phone, it never fires.

I want the notification to be sent only if I have left one zone (no notification) > entered home zone, instead of everytime I get home he gets a message - is that possible?

Happy to buy you a couple of coffees for your help and support :slight_smile:

1 Like

Oh, sry. I completely missed that. Just give the new version a try. Thanks for reporting!

Thanks that 1st part works now- thanks!

Is this even possible? - I want the notification to be sent only if I have left one zone (no notification) > entered home zone, instead of everytime I get home he gets a message - is that possible?

So you want only leaving notifications to be sent for some zones and arriving notifications for others? Did I understand that correctly?

So I want a condition that says if I leave zone A and drive to zone b then send the WhatsApp to my friend.

What I don’t want is him getting a message everytime I get to zone b from anywhere else if that makes sense?

So you want to start at A and when arriving at B the notification shall be send?

With help of Proximity Integration a notification on the way is possible. But thats kind a tricky and could also produce false positives.

  1. just import the new version of the blueprint

  2. create a input_text helper
    Bildschirmfoto 2023-11-17 um 10.47.24

  3. Define your persons and zones in your automation

  4. Create this custom condition for arriving. It checks if last leaving zone was A.

  5. Add your custom whatsapp action for arriving

  6. Create this custom action for leaving. It stores the leaving zone to a helper.

Thanks I will try this, could you paste the code in please?

Here you are. Be sure to change everything to your entities.

alias: "[TEST]  Zone Notification"
description: ""
use_blueprint:
  path: panhans/zone_notification.yaml
  input:
    persons:
      - person.panhans
    zones:
      - zone.b
    custom_action_arriving:
      - service: service.WHATSAPP
    custom_action_leaving:
      - service: input_text.set_value
        data:
          value: "{{ zone_from }}"
        target:
          entity_id: input_text.zone_text_helper
    is_leaving_notification_enabled: false
    zones_leaving:
      - zone.a
      - zone.c
      - zone.d
    custom_conditions: []
    is_arriving_notification_enabled: false
    custom_conditions_arriving:
      - condition: template
        value_template: >-
          {{ states('input_text.zone_text_helper') ==
          state_attr('zone.a','friendly_name') }}
    custom_conditions_leaving: []

I looked at Helpers and selected text but I get a different format than in your image?

Mine was already created. Just give it a name and you are good to go.

Thank you - does this look ok below? Do I need a zone b mentioned as friendly name of home?

alias: WhatsApp Dailey when home v2
description: ""
use_blueprint:
  path: panhans/zone_notification_extended.yaml
  input:
    persons:
      - person.adi
    zones:
      - zone.home
    is_leaving_notification_enabled: false
    custom_action_arriving:
      - service: whatsapp.send_message
        data:
          clientId: default
          to: [email protected]
          body:
            text: Just got home
    custom_conditions:
      - condition: time
        after: "18:00:00"
        before: "22:00:00"
        weekday:
          - mon
          - tue
          - wed
          - thu
          - fri
        enabled: false
    duration: 0
    zones_leaving:
      - zone.julies
    custom_conditions_arriving:
      - alias: >-
          Custom condition template for arriving. It checks if last leaving zone
          was A.
        condition: template
        value_template: >-
          {{ states('input_text.zone_text_helper') == state_attr('zone.a',
          'Julies') }}
    custom_action_leaving:
      - service: input_text.set_value
        data:
          value: "{{ zone_from }}"
        target:
          entity_id: input_text.zone_text_helper
        alias: Custom action for leaving. It stores the leaving zone to a helper.

Change it like this.

But with that configuration the arriving action will be triggered all the time. You need to define the zones from where you’re getting home but don’t want to have a notification, too.

But maybe there is a more elegant way, if you use a time condition. Lets say, you arrive at home and the last time you leave zone julies must be within an hour ago. Maybe this is a better approach?!

Well from A > B it’s about 10mins but let’s put 20mins in case I pop to the shops?