We try to stabilize the signal strength for several beacons. We have beacon from kontakt.io and scans for beacons from raspberry pi zero. We get signal strength between -40db and -87db and we want it to be more stable. We want rssi not to differ more than + -10db and preferably have as low as possible. It is an indoor positioning system that we are working on and this is how code looks when we tried to stabilize the rssi signal strength. And it's written in python. These two are the formulas we are using in our code:
distance = 10^((rssi at 1m - rssi)/20)
distance = rssi *fiterFactor + oldDistance *(1 - FilterFactor)