Bluetooth Presence Detection on a RPI3

Have been using Bluetooth Presence Detection with my Android Phone
for a long time with only small issues, but since about .98 it just disconnects
randomly for no reason.

Have been waiting and doing updates hoping it would get fixed but seams to be getting worse.

Any one else having this issue or have a fix.

Running on RPI3
Hassio 0.103.5
HassOS 3.7
Supervisor Version 193

Did you open an issue? Without open issues the developers have no way of knowing about any issues.

Of course, log entries showing the problem would help us help you here, and the developers when you do open an issue.

Thanks for the reply.
How do I do that?

Do you have an error in your log regarding Bluetooth?

Looked at the Log in Developer Tools and have nothing for Bluetooth.
All Bluetooth devices work and show up in my known_devices.yaml
and my phone shows home when I reboot hassio.
But then it will drop my phone at a random time could be minutes or hours.
Also as of this last update it does not detect when I get home or leave.
It shows as home when I do a reboot and then drops as I stated above.

I saw a note in the release notes about something changing to bluetooth_tracker
do I maybe need to have a different entry in my configration.yaml or something.

Thanks for any help.

Just restarted and waited for it to disconnect after that this was in the log.

Error looking up Bluetooth device

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/bluetooth/bluez.py", line 31, in discover_devices
    lookup_class=lookup_class, device_id=device_id)
_bluetooth.error: (110, 'Operation timed out')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_tracker/device_tracker.py", line 140, in perform_bluetooth_update
    devices = await hass.async_add_executor_job(discover_devices, device_id)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_tracker/device_tracker.py", line 62, in discover_devices
    device_id=device_id,
  File "/usr/local/lib/python3.7/site-packages/bluetooth/bluez.py", line 34, in discover_devices
    raise BluetoothError ("error communicating with local "
bluetooth.btcommon.BluetoothError: error communicating with local bluetooth adapter

Then that is exactly the same problem I have. I made a topic here some days ago. Error looking up Bluetooth device

But somehow that is nice - then there must be something with HassOs/Hassio itself.

I made a request on Github: https://github.com/home-assistant/hassos/issues/524

Thanks for creating the issue.
Good to know it not just me.

I had similar issues to this and after some investigation I found that by rolling back HassOS from 3.7 to 2.12 (by using the import USB function) these errors no longer appear and my bluetooth tracking now works flawlessly once again (which it didn’t under 3.7).

If you haven’t already opened an issue against HassOS, that’s worth doing.

Now that I think about it my issues started after updating HassOS from 2.12 to 3.7
Can someone open a issue about this with HassOS 3.7.

Do you have a link to how you did a roll back to 2.12?

For rolling back to 2.12 you can download the file from https://github.com/home-assistant/hassos/releases/tag/2.12

I have a RPi3 so I downloaded the hassos_rpi3-2.12.raucb onto a USB stick and then simply used the Import USB button in Hassio Host system

Just upgraded to
HassOs v3.9
Supervisor V199
Hassio v105.2

Still having the same issues with it dropping after a few minutes and not see phone
when I get home.

Anyone know if this is being worked on?

Most of my automations use the Bluetooth presence of my phone and now
almost all of them are worthless, everything worked flawless before.

Thanks for any update.

Upgraded to 108.3
HasOS 3.12 Production
Supervisor 217

Still having the same issues.
I have a entity for my phone but does not tirgger any automaions or
change from home to not_home

Any update or help always appericated.
Log listed below.

Log Details (ERROR)

Logger: homeassistant.components.bluetooth_tracker.device_tracker
Source: components/bluetooth_tracker/device_tracker.py:62
Integration: bluetooth_tracker ([documentation](https://www.home-assistant.io/integrations/bluetooth_tracker), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+bluetooth_tracker%22))
First occurred: 1:29:15 PM (1 occurrences)
Last logged: 1:29:15 PM

 Error looking up Bluetooth device 

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/bluetooth/bluez.py", line 31, in discover_devices
    lookup_class=lookup_class, device_id=device_id)
_bluetooth.error: (110, 'Operation timed out')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_tracker/device_tracker.py", line 140, in perform_bluetooth_update
    devices = await hass.async_add_executor_job(discover_devices, device_id)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/bluetooth_tracker/device_tracker.py", line 62, in discover_devices
    device_id=device_id,
  File "/usr/local/lib/python3.7/site-packages/bluetooth/bluez.py", line 34, in discover_devices
    raise BluetoothError ("error communicating with local "
bluetooth.btcommon.BluetoothError: error communicating with local bluetooth adapter

Well looks like I at lease got my automations working again.
Will wait and see if the disconnect issue is still there.

Looks like when I was trying to resolve this at one point I deleted all of the devices
in my known_devicel.yaml file and then has Hassio re-discover my phone.

This is what was in all of my automations for the old discovery
device_tracker.samsungsmg935v

I guess something changed in the discovery and it changed to
device_tracker.samsung_sm_g935v

Went thru all of my automations and updated to the new name and
at least the automations now work.

Will wait and see if the disconnect issue is there and report back.

24 hours with no disconnect.
Hopefully this is fixed now.