core: Cannot tweak consider_home time for private_ble_device
The problem
Hi,
I’ve implemented this great new integration, and it seems to work correctly, except the consider_home time seems to be rather long. When one of my private_ble_device devices leaves home, it still shows as home for approx. 20 minutes.
Other device_tracker integrations have a consider_home setting that can be tweaked to control this behaviour. Bug is to either reduce this default time on this integration, or alternatively provide a way to tweak the setting.
Thanks
What version of Home Assistant Core has the issue?
core-2023.10.0
What was the last working version of Home Assistant Core?
core-2023.10.0
What type of installation are you running?
Home Assistant OS
Integration causing the issue
private_ble_device
Link to integration documentation on our website
https://www.home-assistant.io/integrations/private_ble_device
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 9 months ago
- Comments: 20 (11 by maintainers)
For me it takes about 5-10 minutes, it’s usually similar to the timeout for apples “you left your stuff behind alert”.
There are 2 timeouts in play.
The first is the broadcast interval. There is a sensor (that’s disabled by default) that tells you the current broadcast interval. For my iPhone it’s usually sub 10s, sometimes slowing briefly to 30s. This (plus some padding to account for jitters and wobbles) is the timeout after which your device is considered no long visible. The default for this if your device is not broadcasting enough to automatically determine an interval (or if you have an unstable Bluetooth environment - maybe only a Realtek dongle and no proxies for example, which would be dropping packets left right and centre) is 15 minutes.
We are building on top of the core Bluetooth stack. As it is potentially managing lots of devices and lots of integrations needs and lots of Bluetooth proxies, it had to strongly consider performance. Rather than managing lots of individual timers, there is a “reaper” task that culls these expired addresses once every 5 minutes.
So TL;DR the worst default case is 15-20 minutes. But that would usually mean your Bluetooth setup is unhealthy and the Bluetooth integration hasn’t been able to learn enough about your device.
And for an iPhone the default case should be up to 6 minutes in the worst case.
To figure out what’s going on for you I need you to enable the signal strength sensor and the broadcast interval sensor and report back when you have some graphs. I also need to know more about your Bluetooth setup. Do you have proxies? What usb dongles do you have?