Presence by BLE Devices - Beacons, Titles, and?

Hi,

I am trying to do something I thought was simple, but is seemingly more difficult than expected. I have HA, or I guess Hassio, running in docker on an Ubuntu host.

What I am looking to have is somethign reasonably small, uses BLE, and does not require an app to discover or track. Something that I think should just broadcast its info and that HA should either just see or not see based on if the underlying BLE hardware sees it or not.

My first try on this was just enabling the BT and BLE integrations. But I soon found out that there were two issues -

  1. Our iPhones are not always detectable becuase the engery saving.
  2. Device tracker has an issue it seems where if you are using the companion app on your phone, it wont regisiter your MAC becuase that device already existed.

My second try was a few Tiles. Knowing that these were also just special BLE devices I planned on activating them, then deleting the app, and just let them broadcast. It wasnt until after I noticed it was still tracking GPS location that I realized the Community “feature” that always tracks your location if you are near anyone with a Tile. I dont really want Tile doing that and it seems like there is no way to disable.

My third try was a iBeacon, again a BLE device, from Bluecharm - https://bluecharmbeacons.com/product/bluetooth-ble-ibeacon-bc037s-ibeacon/. This seems to be seen as a BLE device by bluetoothclt on my Linux host, but it never seems to be seen by HA. I have read that I could use OwnTracks or a number or MQTT broker solutions to make this work, but it seems like such overkill.

So am I overlooking or doing something dumb where the above solutions should have worked for the no app BLE solution I had described? Or is there really no solution that does not require some other app, integration, or cloud tool?

Thanks all for your help and ideas!

1 Like

The ble tracker in HA is unreliable. You can look at using ESPHome for tracking ble tags. I have it deployed and it works flawlessly

Thanks @davefrooney, it seems that is certainly the case. I am trying to avoid additional components if I can. I have read a bit about the ESPHome stuff and other approches. I might end up there.

After looking through the HA BLE code on Github it is doing a call out to hcitool to do an lescan for low engery devices. Interestingly this scan is not returning the same list of devices as the Ubuntu GUI or bluetoothctl scans. So the next path I am going to take is to try and understand why that is. If I figure that out I will post back here.

dave: Can you elaborate a bit more aboit your usecase? I look out for “subzone” room presence.

I use NUT mini’s and a bunch of Pi Zero W around the house with the software room assistant, which even allows room based presence detection. But may not be what you need.

Not sure if this is helpful to you…I am using Monitor running on a separate Pi from my HA instance with two Nut mini beacons to do presence detection. It works really well for us. I do have a simpler use case than some, because I don’t need multiple Monitor instances, and I don’t need room-based presence detection, just home/not_home. My only frustration is that the Nut minis need new batteries every two months. I was going to try a Tile tracker next, but reading your experience that you can’t turn off the location tracking Community feature changes my mind about this, unfortunately.

@Burningstone What kind of battery life are you getting with your Nut minis?

Can you confirm that the Nut Minis are picked up by a standard hcitool lescan without any other effort? Do you need to do anything with thier app?

You don’t need to do anything with their app. Just remove the plastic cover from the batteries and it starts broadcasting and will be detected by hcitool lescan

They last around 6 months. I set a reminder every 5 months to replace them. My presence detection works flawless like this for 2+ years.

1 Like

Wow, I wonder why mine eat batteries so much more quickly! I’d be thrilled to get 6 months. I’m tired of getting cold in the house because my tracker battery died, HA thinks nobody is home, and the thermostat goes into away mode :roll_eyes:

2 months is definitely too short. Did you connect the Tiles to your phone?

This is why I use a combination of bluetooth tracker and gps for presence detection. I wrote a small app that creates a device tracker out of the bluetooth tracking and use this device tracker in combination with the gps tracker. I just added both device trackers to a person and the person integration handles the presence detection afterwards, there’s a good explanation on the person integrations page on how presence detection works if you have multiple device trackers for one person.

2 Likes

I originally connected the Nut Minis to the app on my phone, because I originally thought you had to “activate” them somehow, but I immediately removed them from the app after that. The Nut app is still on my phone, but does not show any trackers connected. We have two Nut Minis, one for each of the two people in our household, and they both seem to eat batteries at the same rate. Maybe I’ll try deleting the app from my phone entirely and see if it makes any difference. Not hopeful, though.

What are you using for GPS tracking? I really don’t want to have to deal with that, especially as I have an iPhone, and my husband has Android, and he does not want to add apps on his phone. If the batteries were more reliable on the Nut Minis, I’d be happy with what I have now.

Sorry for the delay, I completely missed your reply!

Did you try other batteries as well? I just changed batteries, after 8 months of use, it was still working, but I changed it just to be safe. I use the official Home Assistant Companion App for GPS presence detection. I also use it for other things such as notifications and some controls for the home. If you build a nice interface like this one (which I use as well and my wife loves it), I’m sure your husband will give it a try.

Thanks for the reply. I’ve tried different batteries, I don’t think it matters. The other thing is that the Nut minis will randomly and intermittently start beeping for no reason. Sometimes it’s just a quick beep or two, sometimes it lasts for a minute or so. It’s not often, but annoying in the middle of the night, or when it happens to my husband when he’s driving! And it shouldn’t happen, they aren’t connected to anything…it’s just weird!

I bought two iBeacons from BlueCharm just before the world went crazy. Their batteries are supposed to last almost a year. I’ve set one up in Monitor as a test and it seems to work fine. They have a button so that you can turn them off, which I have done, since we are home all the time in the current lockdown situation. Might as well save the batteries! When life goes back to normal, I’ll deploy them both and see how I get on.

I do have a nice Lovelace dashboard (although not as fancy as Jim’s!) My husband will use a Chrome shortcut I set up on his phone occasionally, but mostly HA is my thing and he doesn’t interact with it much :woman_shrugging: I’m not complaining because he helps me with the hardware side when I build sensors or need something soldered :grin:

1 Like

Hi Anwen, this is Thomas from Blue Charm. FYI, you can make the batteries last longer by increasing the interval of the beacon. Default value is 1000ms (1 second). You can also save some battery power by decreasing the TX broadcast power. Default value is 0 dBm.

I have not done a detailed analysis of the battery life of the particular beacon that you ordered, but I did do a full matrix of expected life values for another similar beacon: the BC011. This should give you some sense about how adjusting the interval and TX power effect battery life.

Another option is to buy a different beacon with a larger battery such as my BC063B. It’s waterproof and it has a 4 year battery.

Depending on how you want to use the beacon, there is also the option to buy the BC011 beacon which has a “button trigger” function. You can program this various ways using the simple config app, but the simplest approach is to set it up so that the beacon ONLY broadcasts for a set period after you click the button on the beacon. Not sure if this would fit your usage case though.

(To forum mods: feel free to delete this post if it is too “advertisey”. Sorry in advance!)

2 Likes

Thomas, I’m assuming you know which model I ordered because I stated that they have the button to turn them off (BC037S). Thank you for this information, it will be helpful. I could double the interval to get better battery life without it adversely affecting my presence detection.

Yes, I figured out the model from your earlier post. The one you have (BC037S) can be turned on/off with a button on the beacon; the BC063B and BC011 beacons can also be turned off with buttons on them.

As far as increasing the beacon broadcast interval to save battery, yes, it will work for SOME applications. For others, it might screw everything up. You have to test it out in your specific usage case to see if it is workable or not.

The reason is that the scanning device (the Pi, or in some cases, maybe an app on your phone) is not scanning 100% of the time (I assume…see my disclaimer of Pi ignorance below!). It also has a scanning window (period when scanning) and a scanning interval (when it begins each new scan). So if your beacon broadcast interval is extended, meaning it broadcasts fewer times per X period of time, it might be more likely to NOT line up with the scanning window of the Pi or phone. Hope that makes sense.

If your Pi scanner is not battery-powered, you can probably adjust these settings to make the scanning continuous (e.g. set the scan interval to 5 seconds and the scan window to 5 seconds). Continuous scanning would wear out your Pi battery quickly, so you should only do this if your Pi is plugged into wall current.

Disclaimer: I’m knowledgeable about Arduino but don’t know much at all about Raspberry Pi. So my advice about the scanning stuff above is based on Arduino+HM10 BLE scanner modules. I’m not 100% sure Pi is the same, but I assume it is. One of these days, I gotta dig into Pi as well as this Home Assistant thing. From what I read yesterday, it looks very interesting!

Hi Z4Clamps,

I know this is an older post, but just to clarify for others who read your post: A Tile is different from a beacon. A Tile is a “BLE Tag”, which means it has an ongoing connection with your device and also can have two-way communication with your device.

A “BLE beacon”, on the other hand, only broadcasts it’s little info packet one way. It does not listen or react to anything from your device (unless you connect to it to configure it, but that is not the standard usage function). So a BLE Beacon is like a little lighthouse working independently, whereas a BLE Tag (e.g. Tile) is like a little walkie-talkie.

BLE Tags are used for tracking things, and they can make a beep sound if certain conditions are met. (As the thief runs away with your laptop bag, the Tag attached to it will “beep, beep, beep!”).

BLE Beacons are also used for tracking things (usually in warehouses) as well as serving as proximity triggers in automation (either “entering zone”, “leaving zone”, “staying within a zone for X period of time”, etc.)

A bit of an over-simplified description, but accurate enough for general understanding of the difference between these two. Trust me…lots of people confuse the two!

1 Like

For presence detection with my beacons, I am using a script running on a Pi (using a power supply) written by Andrew J. Freyer called Monitor. I will play around with how the beacon’s parameters work with Montor and see what works in terms of increasing battery life.

You should definitely look into Home Assistant, it is fantastic!

Very interesting reading on that Monitor page. He’s doing something more than just scanning for beacons, since he is also including scanning for any Bluetooth device at all. I was a bit surprised by this approach, but if it works, great!

I was also surprised that he feels interference with WiFi might be an issue if you scan too often. Maybe this is because his more active “call and response” method? I’m not sure, but if it works, then great!

I did not see any description about scan window or scan interval, but I think this is because his system waits first for some random BLE “sound/cough/Mike”, then it starts a “call and response” type of scan. At least, this is what I am understanding from the reading. So perhaps you don’t need to try to adjust scan interval and scan window.

I will definitely try out HA and Monitor when I have some free time. Thanks for the info and link!

1 Like