Left wallet behind notification

i’m not good at all on doing automations. Here is what i want to do. when i leave my house ( tracked by my phone ) and I have forgotten my wallet behind (tile tracking) I get a notifications when i’m like say 5000 meters aka 5 km away. Also wanna make sure i don’t get false notifications when my wallet is with me.

things i have already have done.

  • setup Proximity integration on my cellphone. I don’t know if i needed to do this.
  • setup my home zone on the map
  • added my Tile tracking into HA , also can see my wallet and keys on the map.

I found this one

  • trigger:
    • platform: template
      value_template: “{{ distance(‘device_tracker.me’, ‘device_tracker.tile’) > N }}”
      action:

    Send notification

    • service: …

I went to developer tools, input the temp and it give me = UndefinedError: ‘N’ is undefined . whatever that means

You wrote “greater than n” which means nothing, hence the error.

Replace n with an actual number.

1 Like

okay I will

Let us know how it goes.

this is what i came up with so far.

Can you please format the code?

ya i don’t know how sorry

Use the </> key in this menu when you paste the code in.

2 Likes
alias: Left wallet behind
description: ""
triggers:
  - value_template: "{{ distance('device_tracker.pixel_7_2', 'device_tracker.wallet') > 1 }}"
    trigger: template
conditions: []
actions:
  - action: notify.mobile_app_pixel_7
    metadata: {}
    data:
      message: you left your wallet behind
mode: single

Looks ok. Check the units - not sure if ‘1’ is 1Km or 1 mile or…

1 Like

i’m in KM so 1 km but i could make it farther if need be.

thanks for you help. Like I said not very good at this. the yaml part of it and understand. I have zero programing knowledge.

No worries. Come back here if you have any more questions.

1 Like

okay problem. so this morning i left my house and I did have my wallet with me. HA was giving notifications that i left my wallet behind.

A. should i increase my distance from 1 km to say 5 km?

B. input Longitude and Latitude into the automation. IF yes and how?

C. How would you create the automation ?

To be honest, with something like a wallet, it maybe better to create a habit. For example, keep your wallet with your car keys or in the shoe that you wear when you go out (either one will stop you forgetting them).

Having written that, this is how I do it to let me know if a window is open when I leave the house. Norte it uses a contact sensor on the front door, a motion sensor in the hallway and only works when I am alone. …but it alerts me when I am still on the driveway. I am sure it can be easily modified to not use the motion sensor but something else instead (motion outside, car integration…)

  - alias: "Notify dr/win still open after exiting front door"
    id: notify_contact_on_exiting_front_door
    description: ''
    mode: restart
    trigger:
      - platform: state
        entity_id: binary_sensor.front_door_contact
        from: 'on'
        to: 'off'
    condition:
      - condition: state
        entity_id: binary_sensor.aqara_contacts_open
        state: 'on'
    action:
      # wait for hallway motion sensor to timeout
      - delay: 10 # secs
      # wait for indication of movement
      - wait_template: >
          {{
            is_state('binary_sensor.indoor_movement', 'on')
            or
            is_state('binary_sensor.front_door_contact', 'on')
          }}
        timeout: "00:03:00"
        continue_on_timeout: true
      - if:
          - "{{ not wait.completed }}" # timed-out (not home)
          - "{{ states('binary_sensor.front_door_contact') == 'off' }}" # front door closed
          - "{{ states('binary_sensor.aqara_contacts_open_excl_front_door') == 'on' }}" # another contact is open
        then:
          - action: script.notify_james
            data:
              title: "Open doors/windows:"
              message: "{{ state_attr('binary_sensor.aqara_contacts_open','influence') }}"
              type: loud