I have an old iPhone (too old for home assistant app ), and I would like to trigger some action whenever it enters or leaves home, i.e. the local wifi network.
I am using AVM FRITZ!Box Tools integration, the device_tracker is created from there.
I have little experience with device triggers, because I avoid them for several reasons. I use state and numerical state triggers instead. They are way more flexible and predictable, because they are not device dependent. So I would rewrite it to use state triggers on the entities (from: home and to: home) first. Also for the zone triggers.
Also check in the history graph of Home Assistant if the device trackers actually change soon enough. I seem tot remember fritzbox is particularly slow in marking devices offline. Maybe a ping sensor is more reliable, provided you set the phone not to switch mac address all the time when on the home wifi.
Thanks for the quick response and the link, I will check that out
I already noticed the ‘slowlyness’ of the FB, and also had the idea of using the ping; unfortunately, the iPhone can only be pinged as long as it is ‘awake’. As soon as it turns off its screen, it also no longer responds to pings…
I’m currently investigating fbtr64toolbox.sh; scanning the connected wlan hosts directly on the FB seems to give a much faster response which I would probably then simply turn into a binary sensor
You could also check if the owntracks app runs on the old phone? Others use it for location tracking.
If the device is not pingable (i.e. probably turning off wifi most of the time) it is probably not reliably detectable from outside the phone. The fritzbox itself is showing devices connected that are disconnected already, so it would not matter much how it is queried.