Home Assistant Companion App BLE Presence Detection + RSSI

Happy it works, thanks for working through debugging as my first beta tester lol.

You should put the phone 1m from the ESP32 and monitor the RSSI values printed to the log. Set the lowest repeated value you see as the TX power in the HA companion app, the default is probably quite a bit off depending on what power setting you’re using. Once that’s set, the distances should be more accurate, but the path loss constant is another knob to tweak if the reported distance doesn’t match actual distance once you move past 1m. The wikipedia page has some example values.

Once the TX power is calibrated, you can tweak the filter constants, number of retained samples, and timeout to get the behavior you want.