How far is the beacon from your pi? Depending on the type of beacon and obstacles between it and the pi the range may not be as far as you might expect and cause presence detection to fluctuate. I put together this last year and it's been working fairly well using cheap keyring style NRF51822 beacons.