I have two proximity sensors defined for my wife and me. She has an iPhone, I have Android. I added a couple of local IP-based device trackers to improve our presence detection at home (as soon as we connect to the WiFi mesh).
My device trackers and proximity sensors work well, with frequent updates. My wife’s iPhone doesn’t update as often. More importantly, her proximity sensor’s direction of travel never becomes “stationary”. It usually stays at the last value. So if she’s going somewhere, it shows “away_from” during the drive and for however long she stays put at her destination. It switches to “towards” only when she starts driving back. It stays on “towards” even after she’s home, till she drives out again, and so on. This makes any automation/scripts for her proximity sensor very hard and unnecessarily complicated.
Here’s my config. Am I doing this wrong? Is there a better way to do it? Thanks in advance!
device_tracker:
# For the Android device:
- platform: ping
hosts:
alaas_s21_detector: 192.168.4.141
# For the iPhone device:
- platform: iphonedetect
consider_home: 60
scan_interval: 12
new_device_defaults:
track_new_devices: true
hosts:
nehals_iphone_detector: 192.168.4.103
proximity:
prox_alaa:
devices:
- device_tracker.alaa_s_s21 # HA app on Android
- device_tracker.alaas_s21_detector # ping integration
tolerance: 50
unit_of_measurement: mi
prox_nehal:
devices:
- device_tracker.nehals_iphone # HA app on iOS
- device_tracker.nehals_iphone_detector # iphonedetect integration
tolerance: 50
unit_of_measurement: mi