How to use Beacon Monitor and Beacon transmitter to do presence detection

Hi,
I have an android tablet (fire tablet) running HA app with power source plugged in 24*7. Power consumption is not a concern on this device. I turned on Beacon Monitor on this device.

I turned on BLE transmitter on my phone and I can see my ID is detected in my tablet’s beacon monitor.

My question is how do I add this ID to device tracker in my HA Server’s configuration file? I did the following:

  - platform: bluetooth_le_tracker
    track_new_devices: true

But the ID of my tranmitter does not show up in known_devices.

I am not sure how to add my transmitter to my home assistant server so that I can use it for presence detection. I’ve researched hours and hours on this simple idea but everyone seems to be using esphome. Could you please help me a little bit?

Normally after enabling BT in HA, you should get your phone discovered as an iBeacon via the automatically loaded integration. It might take some time for HA to recognize it.

  • Check under Settings > Devices & Services if Bluetooth is enabled. If not, enable it by adding it via “Add integration”. Restart if necessary.
  • Now enable the iBeacon integration under Add integration > Apple > iBeacon tracker. Not sure, but it doesn’t hurt to do a restart again.
  • Give it some time, HA will recognize your new “beacon” eventually.

After the beacon is discovered, you’ll have a few entries, one of them is a device_tracker.

I couldn’t get it to run the way I wanted, so I use it in another fashion. I haven’t enabled the iBeacon integration, because after enabling the “Beacon monitor”, you get a sensor where all active beacons are set as an attribute. I use these for some binary_sensors and that works nice in my setup.

Also this thread might give you some more information:

Hi @paddy0174 , thanks for your reply. If I am reading it correctly, your reply implies that my HA server (not my Android tablet) has Bluetooth capability and by installing Bluetooth integration on it, I am using Bluetooth from my server to detect iBeacon.

In my scenario, this is not true.

  1. My HA server is a Linux desktop machine which is not capable of Bluetooth.
  2. I have three 24*7 powered Android companion app which are meant to be used as iBeacon monitor.

Under this scenario, my question is, how to make my HA server use these three iBeacon monitors from Android companion app to do presence detection? Is there a way to write my configuration file to add known iBeacon devices (which is my cell phone Android companion app’s iBeacon transmitter).

Again, I am not using ESP hardware, I do not have Bluetooth on my server. Could you or anyone knowing the topic provide me some help? I’ve spend hours messing my server without success.

1 Like

Ah, ok, then just leave the steps with the BT integration out. The iBeacon integration is what you’re looking for. :slight_smile:

I’m running two tablets and some old cellphones with the “beacon monitor”, and they all report back to HA on the iBeacon integration, as long as the “beacon transmitter” is in the correct format. That doesn’t concern you, the HA companion app is the correct format, my G-Tag beacons use another…

And no, you can’t set it up yourself in configuration files, the iBeacon integration is “config-flow” only. :wink:

Just try it and give it some time to recognize the beacons.

Totally unrelated, but if your tablet is plugged in24/7, make sure you’re properly managing the battery. You don’t want to end up posting on /r/spicypillows. :smiley:

1 Like

Good point, I totally forgot about! :slight_smile: Yep, that should be in your setup, I do it with some old Sonoffs I had lying around, so the battery get’s charged if under 20% and the charging stops at 90%. The companion app does provide a battery sensor, that gives me the more or less exact percentage. :slight_smile:

Hi, @paddy0174, thanks again for your reply and help. I actually installed a Bluetooth dongle and mount it into my container. Installed the Apple iBeacon integration, and confirmed that my android companion app’s iBeacon monitor can find my ID. But the ID does not show up in my Home Assistant anywhere.

Am I missing anything?

1 Like

Bumping this thread, I’ve got a list of bluetooth MAC addresses I want to track the presence of, through both the USB bluetooth dongle, and the beacon monitor on my phone. I used to be able to manually specify mac addresses to be tracked, but it can’t seem to find that ability anymore

I use an esp32 board with esphome running a Bluetooth Low Energy Beacon which is inturn detected by the homeassistant companion Android app. The Documentation doesn’t clearly explain this option imo nor have I found a thread explaining (so maybe we should add it) it but it seems to work. Need to do some more testing before I fully commit!

Has anybody figured this out yet? I am in the exact same case as OP, and am having trouble tracking things. I have:

  1. Multiple dedicated tablets running Home Assistant app with Beacon Monitoring turned on
  2. Multiple phones with HA app with BLE Transmitter turned on
  3. No bluetooth dongle on HA server (so can’t install iBeacon integration)

How can I get the tablets to report the BLE transmitters back to HA, to detect which device is near them? And how do I do the work on the HA side to assign one of those devices to a person, as a tracker?

Hi there!

If you’re only using the HA companion apps, you don’t need the iBeacon or BT integration. The companion app and it’s sensors provide everthing you need. :slight_smile:

So, let’s get into that. :smiley: As you already have enabled all you need, it’s just setting up the sensors. :slight_smile:

What interests you, is the sensor.your_tablet_name_beacon_monitor. It holds all the beacons with an UUID and a proximity as attributes. In your Developer Tools, this sensor should have a state “monitoring” and the attributes look something like this:

123480c3-9e23-bbc5-xxxx-0f180e09xxx9_26465_29541: 0.04
123480c3-9e58-bbc5-xxxx-0f180e09xxx9_26465_29541: 0.04
50765cb7-d9ea-xxxx-99a4-fa879613a492_7266_64057: 2.89
761cb3f4-eb5f-4c95-b5bd-xxxxee751041_100_1: 4.36
options: Monitoring, Stopped, Bluetooth is turned off
device_class: enum
icon: mdi:bluetooth
friendly_name: Tablet kitchen Beacon monitor
6636aaaa-9e88-41cc-8e3a-6f0xxxx5236_100_40004: 2.11
123480c3-9e5e-bbc5-0302-0f1xxxx8r469_26465_29541: 0.05

The numbers here are the UUID, followed by a colon, and after that the proximity.

Now go to each phone, and lookup the UUID of that phone. You can find it under the settings of the BT beacon (in the HA app, where you enabled it). Now all you need to do is matching your UUIDs to your phones and you are good to go with a template binary sensor, like this:

template:
  - binary_sensor:
      - name: Presence My Beacon
        unique_id: presence_my_beacon
        device_class: presence
        state: >-
          {% if state_attr('sensor.your_tablet_name_beacon_monitor', '6636aaaa-9e88-41cc-8e3a-6f0xxxx5236_100_40004') != None) 
          %}
            on
          {% else %}
            off
          {% endif %}

EDIT: Please see the post right under this one from @reste_narquois! The UUID doesn’t need to be hardcoded! :slight_smile:


You check here, if the UUID is listed as an attribute. If it is listed, the tablet is receiving a signal from the beacon. If not, it’s out of reach, aka. “not home”.

Hope this clears it up a little for you! :slight_smile:

1 Like

Just to add to Patrick’s excellently helpful reply, the UUID for your device is now an attribute of your mobile device’s BLE transmitter sensor, so you don’t need to hard code it in YAML:

  {% if 
    (state_attr('sensor.your_tablet_name_beacon_monitor', 
    state_attr('sensor.your_mobile_app_ble_transmitter', 'id'))
    != None) 
  %}
     on
  {% else %}
     off
  {% endif %}
1 Like

Thanks for the kudos and thanks a lot for the update, didn’t know that! :+1: :slight_smile:

Now back to my own config files, I need to change that right away! :laughing:

Thanks! :slight_smile: