Using cheap bluetooth tiles with HA

Hello,

I bought some cheap Chinese bluetooth tags, hoping to be able to use them with Home Assistant to track whether my bins have been put out on bin collection day…

I have no idea where to start. The devices say I should use the ‘iSearching’ app (which I don’t really want to do)…

  • When I open the BeaconScope app on my phone they don’t show up as iBeacons
  • If I hold the button down on them they bleep, then show a flashing blue LED, and appear as devices I can pair with on my phone (with the name of ‘iTAG’)
  • They don’t appear in the Bluetooth section of Home Assistant

Does anyone have any idea how I might be able to get started? I am running HA on a Raspberry Pi 4

I also have various ESP devices in the drawer, if configuring one/more of those with ESPHome might help somehow

Cheers!

Home Assistant 2023.6.1
Supervisor 2023.06.2
Operating System 10.2
Frontend 20230608.0 - latest

Hey Jim, welcome to the forum! :slight_smile:

There seem to be a few things, that you need to do, to get this running, so I’ll try to give that some order. :wink:

  1. I don’t know your beacons, but there are some differences in how they work, depending on the manufacturer, so this is something you need to check in your data sheet of the beacon or on the manufacturer web page. Do these beacons send advertisements out of the box? Some beacons need to be “enabled” by the manufacturer app, to send advertisements (need to be paired with the app), some send right away after starting them (putting in the battery) and some don’t do advertisements at all, they need to stay connected. So this is the first thing to find out.
  2. Depending on how your beacons work, you need to have some integrated BT chip, a dongle or ESPHome devices (like an ESP32), that scan for these devices. What is it, that you have? Or do you want to use the built-in BT from the PI?
  3. The Bluetooth integration in HA is not responsible for scanning for beacons, it is only to integrate the various BT “chips” or dongles into HA. For the scanning and reading process there is an iBeacon integration that needs to be setup and configured for itself. :slight_smile:

As I said above, the first thing is to check how your beacons work and if they need to be enabled to send out advertisements. After that you’d check if your built-in BT (assuming that’s what you want to use) is working. Then you can add the iBeacon integration via Settings > Devices and Services > Add Integration > Apple > iBeacon.

Hope that helps! :slight_smile: And let us know how it’s working out. :slight_smile:

1 Like

Hey Patrick,

Thanks very much for your help :slight_smile:

One of the cheap beacons I bought (including instructions, sadly no data sheet) is here: Car Mobile Phone Wireless Key Finder Alarm Sensor - Temu

I’ll probably just the built in Pi BT for now, and potentially change to ESP devices later if it makes it easier for determining their location (I e. Is it nearer to the one in the kitchen or the one in the garage, perhaps)

Should have mentioned I’ve already got the iBeacon tracker integration installed - it’s picked up 5 devices, but I’ve got no idea what they are - presumably random devices or something in a neighbouring house. Nothing shows up for this beacon but if there’s a chance it needs registering with the app first before it’ll start advertising I’ll give that a go, thanks!

Hi Jim,

Those things you purchased are BLE devices but not beacons. What you have are sometimes called “trackers” or “key finders”. They work differently from beacons. They require a special app on your phone that will constantly watch for their proprietary signal, and then beep an alert when the signal suddenly disappears, i.e. you walked out of the coffee shop but left your keys on the table.

Beacons use the same BLE chips inside but the firmware is totally different. Beacons send out a standard iBeacon protocol signal over and over again that any beacon scanner can “see”. Then, on the scanner side, you need to set up some sort of rules about what the scanner should do when it sees beacon #538. It can be all or nothing “in range”/“out of range” or different actions based on the signal strength of beacon #538 as measured by the scanner, etc.

Once you have a beacon in hand, you can try following my set up instructions that I have previously posted. I am a complete noob at HA, but I got it working pretty easily. It sounds like my HA setup is the same as yours: HA installed on a rPi and using the internal rPi bluetooth as beacon scanner with the iBeacon Tracker integration installed.

See the link below:

I have successfully set up test projects using iBeacons on my HA using the iBeacon Tracker integration as the engine. I have posted about this here: Anyone else experience issues with iBeacons? - #5 by BlueCharmBeacons

2 Likes

Hi Thomas,

Thanks! It’s not a total disaster as they were only a quid, and I can attach them to my wife’s keys as she’s always leaving either her phone or keys somewhere.

In terms of a beacon, I don’t suppose anyone could recommend me a cheap option please? (Or an alternative solution).Bearing in mind it’s going to be gaffer taped to a bin! I could potentially use an ESP with a battery pack I suppose…

Cheers
Jim

If you are in the USA, you could order from the Blue Charm Beacons website or Amazon.

By the looks of your response, you’re in the UK, so maybe try looking for a local supplier there.

We ship our beacons to the UK from time to time but just about everybody there complains about the shipping charges. :grin: If you want to consider it, go to our website and put a couple beacons in your shopping cart then partially check out to get the shipping cost estimate.

Alternatively, you could find some standard beacon sketch examples and load them onto an ESP to get it to act as a beacon. It’s not very difficult if you know how to work with ESPs. The battery will be the tough part though; powering the full ESP dev board takes a lot more battery power than powering an actual beacon. There must be some way to do it; I frequently see people talking about this topic in the Arduino forums.

Good luck!

Jim, you’re in luck, you already found (or better he found you) the man that’s an expert in all things beacon or BLE. :slight_smile:

So what we first need to find out is where are you living? :slight_smile:

And I can only agree with Thomas, an ESP is not a good beacon, but it is a good beacon monitor or ble_proxy.

But what I’d try before you throw your devices away, test, if they really don’t send out a signal. I’m using Gigaset G-Tags (in Germany), and I only found out via some reports in forums, that they indeed send BLE advertisements, despite that functionality is nowhere mentioned… :slight_smile:
I tested it in a very basic form: I put my phone with BT enabled into a chips bag (after it was emptied :rofl: ), pulled the battery tape on the g-tag and put it in the bag as well. And surprisingly I got one BT device listed in my phone. I extracted the MAC address via the phone and been using them ever since with HA and the MAC address. :slight_smile:

“BLE chip options available now include Nordic, Texas Instruments, or Lays” :grin:

A good point you made though about the MAC: Every BLE item, even these key finder thingys, should broadcast a MAC. If the HA integration Jim will use can use MACs only, then that will definitely work. I don’t think that iBeacon Tracker integration can use only MACs. I think it also requires UUIDs. But I remember reading some other user mention they are using HA to scan for MACs only. I am not sure though how they did that. When in doubt, I just say “it probably has something to do with yaml”… :grinning:

:rofl: Next step: develop a BLE device, that looks like a potatoe chip and make a contest out of it. “If you find the BLE device, you can win $xx.” Here in Germany this is a well known pattern to get personal data from customers. :rofl: :rofl:

Coming back to the beacons. :smiley: I’m currently using the MAC addresses from my G-Tags via monitor.sh, sending them over MQTT to HA. In HA I’m generating a device_tracker out of these MQTT messages.

Something along the lines:

mqtt:
  device_tracker:
    - name: mobile_pat_garage_bt
      unique_id: mobile_pat_garage_bt
      state_topic: 'myhome/garage/mobile_pat/device_tracker'
      source_type: 'bluetooth'

On the other hand, there are two integrations, where one of them in theory should work, depending on what the “beacon” is sending.

And last, but not least, I’m experimenting with something different via the companion app of HA:
I’m using a few tablets (old FireHDs) around my home, where I have the companion app installed and using the “beacon monitor” from it. The “beacon monitor” is sending something like an ID for every device as an attribute to it’s sensor. As soon as the attribute is listed, the BT device is there and I set it via a `template sensor´ as “home”.

This is a screenshot of the sensor:

And this is how I use it in a template sensor:

# Note: I'm using the sensor and it's attribute as well as two binary_sensors 
# I'm generating via two ESPs 
template:
  - binary_sensor:
      - name: Presence Pat Mobile Beacon
        unique_id: presence_pat_mobile_beacon
        device_class: presence
        state: >-
          {% if state_attr('sensor.tablet_flur_beacon_monitor', '066af314-ce57-xxx_100_1') != None 
            or state_attr('sensor.tablet_kitchen_beacon_monitor', '066af314-ce57-xxx_100_1') != None 
            or is_state('binary_sensor.presence_pat_mobile_beacon_bedroom', 'on') 
            or is_state('binary_sensor.presence_pat_mobile_beacon_livingroom_cabinet', 'on') 
          %}
            on
          {% else %}
            off
          {% endif %}

:slight_smile:

Btw. Thomas (@BlueCharmBeacons) are you open for a short message exchange? If so, I’d like to send you a PM. :slight_smile:

Hey everyone, thanks so much for all of the help so far

I downloaded a Bluetooth Finder app on my phone and was able to see both of the Tags kicking out their MAC address (and by moving further/closer to them determined which one was which)

I added the bluetooth_le_tracker to my configuration, and can see in my Settings → Integrations → Bluetooth → Download Diagnostics that both of the tags are being detected.

They aren’t however being added to known_devices.yaml - the docs say this is being ‘phased out’ but (to my mind) it doesn’t say what it’s being replaced with, so I may be barking up the wrong tree

Edit: I added track_new_devices: true to the config which created a known_devices.yaml, then just deleted everything apart from those tags and removed that config again, so I’m a bit further along!

Now that the devices are being tracked, the ‘presence detection’ seems to work (I pulled the battery from one of them, a few minutes later it showed as ‘Away’ in the Logbook). Exciting! The next question I suppose is can I grab the RSSI / distance from these tags (as the data appears to be in the Bluetooth diagnostics), and use that to determine where they are? (i.e. is my bin in the back garden, or out ready for collection?)

Thanks again for the wonderful welcome to this community - I really appreciate the help (and talk of crisp packet Faraday cages)

Cheers

Yeah sure. I’m busy today but I will take a look at your DM tonight for sure.

It works… for a time.
The tracker goes sleep.
I think originally, the app keeps it alive.
Have you and idea, hov to solve this?

Old post, but just for fun, here’ s a totally new approach to the trash bin reminder puzzle: