I have also tried many solutions for presence detection, as most of us a mixture of gps and bluetooth detection. GPS is often a bit slow (without high accuracy mode about 1-3 minutes) and maybe unreliable on some phones. Bluetooth is really fast, but in my case it wasn’t continous, even with the phone 1M away from the esp32 there were drops in recognition.
Since two or 3 months i am using WLAN as a device tracker for beeing home or not.
This idea isn’t really new, all of us tried this with an nmap, ping or a router device tracker. The problem is, that every phone will disable wlan to save battery when not used. So these trackers will show you as not_home every time the phone saves battery.
But if you use the wlan sensor of the companion app, it does not recognize the phone is disconnected from the wlan. For the companion app you are connected all the time, it is really fast when you come to home (most of the time it switches when i enter my appartement door with locked phone in my pocket) and if you leave it’s about 20-30 seconds, the bluetooth solutions wasn’t faster for me.
Give it a try, make a simple template sensor (in my case a binary_sensor):
- platform: template
sensors:
sm_mike_wlan_tracker:
value_template: "{{ is_state('sensor.sm_mike_wifi_connection', 'MadNet') or is_state('sensor.sm_mike_wifi_connection', 'MadNet 5GHz') }}"
delay_off:
seconds: 3
friendly_name: "Smartphone Mike Wlan Device Tracker"
Don’t forget to enable the sensor in the app! If you need a device_tracker you could use the composite device tracker component.
We are using it on a samsung s21 and s10, and for us it is really bulletproof