I’m using the HA app’s SSID sensor to determine if I’m home or not and trigger certain automations based on that. Unfortunately, I’m noticing that it’s very unreliable. Examples for situations where that was very apparent were: I left the house for a bit and took my phone with me. After I returned home, it wouldn’t detect that I was back for 6 hours, until I unlocked my device and opened the HA app. This happend a bunch of times.
Another time, my device seemed to have randomly disconnected from the Wi-Fi for a bit and I had the same problem.
Alternatives I tried out:
The device tracker of my (FritzBox 7490) router’s HA integration; it also had a random disconnect for hours. Also, it had too much of a delay between me leaving the house/network and it noticing.
The HA app’s Geolocation Tracker (which is what HA’s device tracker uses). It also had the problem of the location not updating for hours, but at least it’s not terribly inaccurate and seems to at least always correctly report whether I’m within that zone I set as my home in HA, as far as I can see so far from its sensor history. I will try using it for a while as long as there is no better solution.
I make do with my router’s ubus device tracker. It uses the router’s Wi-Fi station table to decide whether I’m online or not. Unless your phone aggressively shuts off Wi-Fi, that works well.
Anything BLE beacon related has a hardcoded 3 minute transition from present to absent. That’s useless to me.
Correct, it does require Bluetooth, but you could always use an ESP32 as an external Bluetooth proxy antenna receiver with OpenMQTTGateway installed on it, forwarding your iPhone BLE broadcasts to the Theengs gateway Add-on.
With Theengs Gateway you can set the timeout, as well as the scanning frequency to any times and durations you want and require, so definitely no 3 minute limit there.
iPhones do shut off WiFi when they go into sleep/standby, but they constantly send out BLE beacon messages, that’s why Bluetooth is the most reliable and fastest detection for iPhones, iPad, Apple Watches and AirPods
@DigiH Regarding the Theengs Gateway: Will a Raspberry Pi Zero W used as its hardware be sufficient to do the job in my case? Not planning on using it for anything other than detecting the presence of my iPhone.
I have been thinking that I would like to use Bluetooth with my Android phone to establish my presence with or without Wi-Fi working. I was not aware that there was this thing called theengs gateway that allows me to do that. If I could get my phone to also broadcast Bluetooth packets privately like the iPhone does, then that would be perfect. Unfortunately, Android does not seem to have this feature and neither does it seem to be the case that the Home Assistant Companion app supports that. The closest I would be able to get to is to have the Companion application start beaconing whenever I’m close by my house, which is something that I can do using an application that I already have on my phone called phone profiles plus. But the beaconing is by no means privacy-preserving.
With Android it is a bit of a different story, as Android is very quit on the Bluetooth front, compared to Apple devices. You can, however, use a Bluetooth Beacon app on Android (e. g. Beacon Scope), which also sends regular iBeacon broadcasts. And if entering the custom UUID
54686565-6E67-732D-6942-6561636F6E31
yo9u will also get auto-discovery of the Android phone as a BLE device tracker.
This is for Android version which do have a static Bluetooth MAC address, but as more modern Android versions also randomise the MAC addresses, the UUID
54686565-6E67-732D-6942-6561636F6E32
would need to be entered. This would also require an IRK (Identity Resolving Key) though, which I really do no0t know if and how this is possible to get for modern Android versions.
The static issue on Android with Beacon Scope has been reported as working fine by users though.
This integration has been working well for me for several years now.
As a secondary check I also use Apple Home automations (“when someone leaves/arrives home”) to toggle an input_boolean exported via HomeKit Bridge. This requires an Apple TV or HomePod for external access (I prefer not to do my own outside port forwarding).
And since I have several esp32-based esphome devices (plugs, sensors, etc), I’ve added Bluetooth proxying to those, instead of setting up a separate server, to detect my Phone and Watch broadcasts with the Private BLE Device integration.