Skip to content

Commit

Permalink
fix(bluetooth-classic): improve signal strength estimation
Browse files Browse the repository at this point in the history
Kalman parameters have been re-tuned to be reactive, but still smoothen
away noise.
  • Loading branch information
mKeRix committed Mar 18, 2021
1 parent 12bcafb commit 418ab35
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -37,7 +37,7 @@ const execPromise = util.promisify(exec);

@Injectable()
export class BluetoothClassicService
extends KalmanFilterable(Object, 1.4, 1)
extends KalmanFilterable(Object, 0.01, 0.7)
implements OnModuleInit, OnApplicationBootstrap {
private readonly config: BluetoothClassicConfig;
private rotationOffset = 0;
Expand Down Expand Up @@ -163,7 +163,9 @@ export class BluetoothClassicService
`Received RSSI of ${event.rssi} for ${event.device.address} from ${event.instanceName}`
);

const baseId = this.config.entityOverrides[event.device.address]?.id || event.device.address;
const baseId =
this.config.entityOverrides[event.device.address]?.id ||
event.device.address;
const sensorId = makeId(`bluetooth-classic ${baseId}`);
let sensor: RoomPresenceDistanceSensor;
if (this.entitiesService.has(sensorId)) {
Expand Down

0 comments on commit 418ab35

Please sign in to comment.