Detecting a phone near/away with iBeacon

I’m trying to detect if a phone is near or away an ESPHome device. I’ve set up iBeacon on the phone and a ble_rssi sensor coupled with an analog_threshold binary sensor. The whole setup works pretty well and the binary sensor turns on when the the phone is near the device.
The problem is detecting that the phone has gone away. In some cases, the BLE signal drops and the ble_rssi sensor just stops emitting any readings, so the binary sensor does not have the chance to switch back to OFF. I didn’t see any timeout parameter on the ble_rssi sensor, nor on the binary sensor. How do I force it to turn off after a specified time of inactivity?