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
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