I have just started my journey into learning ESPHOME. My first project has been to create a BLE tracker as the native one in HA suddenly stopped working and I cannot find a solution.
Initially, I needed to track one specific BLE tag and this seems to be working fine, based upon its MAC. I now have a binary sensor which shows its presence - although I can’t seem to create it as a device_tracker entity? It can seemingly only be a binary_sensor, which is unhelpful, but not insurmountable.
Anyway, one other thing I’d like to implement is to track the BLE beacon on my watch as I move around the house. I’m aware that the MAC is randomised so I can’t track that. If I examine the logs,. though, I can see that the watch very clearly sends text with its name in every broadcast.
I cannot for the life of me see how I tell the tracker to look for that broadcast text, rather than a MAC or other data. I’m sure it must be possible, but I cannot find anything which explains how.
You could also look at something like the Bermuda integration in HACS which will create the tracker and assign an attribute telling you the area and estimated distance of the closest BLE proxy and it supports the private MAC integration for randomized MACs… (I deployed three myself yesterday and three more today and I’m finding things all over the house)
All data is in HEX, it can be converted to dec or ascii.
for example: 47.61.6C.61.78.79.20.57.61.74.63.68 in the middle of your Adv data is “Galaxy Watch” in ascii.
I’ll have a read, thanks. This is my first foray into ESPHOME and I’m very green. I just need to learn how to look for a certain string within that Adv data, I imagine.
Sorry, what I mean is that I don’t fully understand what the name of the string is that I’m looking for and how I can search for a sub-string within it.
I realise that this probably sounds dense, but this is my first attempt at anything like this.
Yes, that’s it. I need to understand what code I enter to search the relevant data stream and then how I tell that code what to actually search for (as in: I assume that I don’t need to include the wrong string in the search, but a unique part of it).
You need to know where that relevant data is. And what form of data.
Bytes can represent one ascii letter, or dec number or 8 individual bits. Sometimes those bytes are separated to represent two individual numbers.
There’s no generic way of reading whatever message.
Have a look how I extract temp and humidity data from specific known bytes.
Humidity is extracted from eleventh byte, temp integral from tenth byte and decimals from ninth byte. There’s some bitmasking also.
No way you can find those data if you don’t know what/where to look for.
I gotta give you props for your level of understanding this. Everytime I try to learn this, I quickly realize that smashing my fingernails with a hammer is more preferable… I do appreciate all of you folks that do understand it and can help out thogh.
I’m not a bit manipulator either. Having hard time when I need to break and join bytes!
To dig that temp sign +/- from single bit in tenth byte made me loose my hair.
I didn’t know about Bermuda until this thread - and have now installed it.
Annoyingly, I’ve had BLE tracking working absolutely fine natively in HA for months and then it suddenly stopped working completely. I think it was a HAOS update which broke things. So, I thought that this would be a good way to jump into ESPHOME.
Right but, only tracking in HA is really no different than using presence based on devices connecting to wifi and showing Home/Away or from gps data showing the dame thing. At least for me, presence detection is more than home/away. Its home, which room everyone and their devices are in, their location in that room if something is lost and needs found and its pet tracking to notify me if my dog gets out of the fence. Im not sure if thats your end goal but, to man6 people presence is simply home/away and IMO that isnt extremely useful information.