Bluetooth Tracker and Iphone

I had an iPhone 6s up until recently and was using the bluetooth tracker of Home assistant as a presence sensor.
I never got it working on my wife’s phone but on my phone it worked perfectly, triggered me as away when I drove away, triggered me as home when I was parking my car.
Now, however, I cannot seem to get it working correctly on my new iPhone X. Home Assistant has picked up the device without issue in it’s known devices list. I’ve set it to track, given it a name etc etc. However, Other than that “first encounter” to set it up, it isn’t picking up any state changes anymore.
I managed to make it pick up a change by going into my bluetooth settings and scanning on my iPhone + opening a terminal on my Pi and manually triggering a bluetooth scan.
After I noticed Home-assistant had lost my phone, I rescanned in the terminal but nothing showed up.

Anyone else had similar issues? And were you able to resolve them?

Some additional info:

  • Yes, my bluetooth is on 24/7 :slight_smile:
  • Running on a Pi 3 with the Hassbian setup.
  • It worked before, the only difference is a different phone

Hi

Did you ever get this solved?

I’m having the same problems with an IPhone 7s Plus.

My system is running HASS.IO 0.60.1, on rpi 3.

Seem like it is something with Bluetooth, since I’m seen other problems with Bluetooth as well.

May be you can show your config for bluetooth_tracker.

Of course:

I have just the default setting, so this is in my yaml

device_tracker:
  - platform: bluetooth_tracker

Well, I found out that it is working with my new television, so maybe it is my wifes phone who has changed something during an update.

If you would noticed that you have to allow tracking for ios by install home-assistant app in iphone. then this will generated .ios.conf<-- , I cannot remember the name exactly of the file, hidden in home-assistant config folder.

Secondly, you can manually add the device to the known_device.yaml, then you will see in entity_id and you can track home or not home status.

I assumed you already have bluetooth_tracker.py in you home-assistant because they can track your phone.

Hi

I have excatly the same issue and haven’t been able to solve it yet. I’ve been using bluetooth tracking with an iPhone 5 with perfect results. Then I’ve migrated to a new iPhone 8 and detection still works flawlessly. However, a week ago I have tried to track my girlfriend’s new iPhone X with no luck. I’ve been able to auto detect it and configuration seems to be ok in known_devices. Home/Not home tracking seems to work well for a while, but after some time it is unable to detect “not home” state.

I have Hass iOS app installed in both devices, but I have the tracking option disabled, for it is not needed by bluetooth tracker in order to work. Only difference between my girldfriend’s setup and mine (beside iPhone model of course), is that I have an Apple Watch. I’m thinking that maybe watch forces the iPhone Bluetooth active, and somehow this is why detection works with my phone. I’m trying to totally remove the watch from iPhone config when I get home and see if the problem appears. If it doesn’t, maybe it’s an iPhone X hardware related problem, or at least the way it handles bluetooth.

I’ll update with the results. Thanks!

Hi again

After a while trying to detect presence with bluetooth tracker and iPhone X with no success, suddenly it has started working! But I realized that Hass was changing state home/away several times per minute. It seems like bluetooth activates and deactivates very often in order to save battery. So, I have set 180 seconds for “consider_home” parameter in known_devices.yaml and everything is working perfectly know.

A post was split to a new topic: Hass.io and Bluetooth

Hi @MrBramme,

I’ve come across this thread while searching for a similar pattern to what is happening to me and bam! your post describes my very same scenario. My iPhone 6s Plus is perfectly tracked by HA whereas my wife’s iPhone 6s isn’t. Both of us are running 11.4. Whatever I do, HA tracks me well, but doesn’t track her at all, and it had worked well for both of us in the past. Have you had any success addressing this specific case?

Thanks

One small detail that may be relevant: my wife has an Apple Watch linked with her iPhone 6s. I believe smart watches use a specific profile of Bluetooth but I may be wrong. I’m on hassio by the way.

Hello @MrBramme, did you ever managed to sort this out? I’m sort of in the same bot I believe… I just now realised that I did not mention something relevant in my post: HA won’t track my wife’s phone at all during regular usage, but it will track it if the Bluetooth menu is open in the foreground. Can you try that?

Thanks

Sorry for the (extremely) late response but my current situation on this:

at random it started working :stuck_out_tongue: it’s not 100% accurate but still pretty accurate.

my current setup is using the bluetooth tracker, network tracker (nmap) and Owntracks. All knitted together into 1 sensor using the bayesian sensor.

Mind posting your code for the sensor? Very interested to see how that works!

A simple sensor that’ll flag me as home if one of the 3 sensors finds me as home. first sensor is owntracks, second is bluetooth & third is nmap. you can read up on the bayesian sensor and play around with it to, for instance, set it to only flag home if 2/3 state that you’re home … but this works for me!

the sensor is defined like this:

- platform: bayesian
  prior: 0.5
  probability_threshold: 0.9
  name: 'i am home'
  observations:
    - entity_id: 'device_tracker.own_tracks_xxxxx'
      prob_given_true: 0.95
      prob_given_false: 0.05
      platform: 'state'
      to_state: 'home'
    - entity_id: 'device_tracker.my_iphone'
      prob_given_true: 0.95
      prob_given_false: 0.05
      platform: 'state'
      to_state: 'home'
    - entity_id: 'device_tracker.xxx'
      prob_given_true: 0.90
      prob_given_false: 0.05
      platform: 'state'
      to_state: 'home'
1 Like

I know it sounds weird, but even when one would point a finger at the iPhone, it turns out the culprit was not my wife’s iphone but an extremely large database of 2GB. After removing the database and starting one anew, I now see my wife’s iphone’s presence.

1 Like