Struggling to find an IRK Key recognisable by Private BLE Device Integration?

Hi

Searched the forum but cannot find a solution.

I am struggling getting HA Private BLE Device Integration to recognise IRK keys for an iPAD and iPhone running iOS 18.4. I am using the guide here with a Windows PC.

I am reasonably confident I followed the steps correcttly (and I did it several times). The “one subfolder that probably holds the computer’s Bluetooth radio’s MAC address” is definitely the MAC address of my BT Dongle on my PC.

The error I see when I try to put the key into Private BLE is always “The provided IRK does not match any BLE devices that Home Assistant can see.”. I have two ESP32s set up in HA and I am right next to them when I try to put (what I believe is) the correct IRK key in.

One point to note, is that when I was trying to get the IRK keys I connected my iPhone to my Windows PC’s BT a number of times, each time both deleting and forgetting the connection. Each time (and this is the odd part), for the same iPhone BT MAC (verified by Settings, general, About in the iPhone) it showed a DIFFERENT KEY. I was under the impression that IRK was fixed?

Is there something I should turn off to prevent what seems to be random IRK Keys (if they are actually IRK keys) or is there some other way to mine the fixed key information correctly?

If someone with a Windows PC could show me what their fixed key arrangement looks like (a screencap would be very useful) Imight have a lightbulb moment, but right now I cannot get a working IRK and it IRKs me no end; pun intended.


Background:

I have read the issues with Private BLE and beta iOS 18 here.

I am aware of the guide here using Arduino IDE but I don’t really want to go that route yet.

I have read the Bermuda Information re IRK harvesting here.

I have read the guide here for adding a device if you have the ESPresense Integration but I do not wish to add that Integration.

1 Like

You linked to the MAC OS guide. You mean this one? https://www.home-assistant.io/integrations/private_ble_device/#on-windows---for-any-devices-that-will-connect-to-a-computer

Do step 7 & 8, obfuscate the hex values and paste the full file here, formatted for the forum.

I was having the same issue until I realised I was copying the wrong key from the file.

Though I’m pretty sure it is this:

It does not change in your screenshots.

Hi Tom, thanks for the reply.

Yes, I meant to link to the Windows based one, sorry about that. I have changed the link in the original post.

See below as requested, no disrespect here, but I am not sure how the IRK line could be one line down from the MAC Address of the device it is representing? The other MAC is a set of Wireless Sony Headphones.

i.e. 98:XX:XX:XX:XX:XX:27 matches up with 4f,10,xx,xx,xx,xx,xx,xx,xx,xx,etc,ae

The odd thing remains: if I delete the iPhone from the PCs BT connection records and forget it in the iPhone then pair again, that hex value changes (for the same iPhone BT MAC). I have done it 3 times now, each with a different result.

I am pretty sure the BT Proxy Devices are working OK, I can see a list of devices under the Bluetooth Integration > Configure > Advertisement Monitor Table.




1 Like

It was a guess.

Once you have done that the file should look like this:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\redacted]
"MasterIRK"=hex:redacted

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\redacted]
"LTK"=hex: redacted
"KeyLength"=dword:00000010
"ERand"=hex(b):0000000000000000
"EDIV"=dword:00000000
"IRK"=hex: redacted   <------ #### THIS IS THE ONE YOU WANT  ##########
"Address"=hex(b): redacted
"AddressType"=dword:00000000
"MasterIRKStatus"=dword:00000001
"AuthReq"=dword:00000020
2 Likes

You’re right it should … thank you :slight_smile:

It seems my main PC either has a flaky BT Adpater (Realtek) or something else is happening with it.

Hopefully this will help someone else, but i tried the PsExec sequence on my Notebook which has an Intel BT Adapter and it works fine, even put the IRK it found into HA and it worked first time for my Iphone. I put a few xx in the output below to obfuscate the hex codes.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\7413eabd45a1\98502e559c27]
“LTK”=hex:3b,5d,90,59,cf,xx,xx,a6,7a,f3,55,98,5e,0c,94,8b
“KeyLength”=dword:00000010
“ERand”=hex(b):00,00,00,00,00,00,00,00
“EDIV”=dword:00000000
“IRK”=hex:3f,43,ca,b1,xx,46,fe,xx,88,07,a9,xx,4c,e0,68,16
“Address”=hex(b):27,9c,xx,xx,50,98,00,00
“AddressType”=dword:00000000
“MasterIRKStatus”=dword:00000001
“AuthReq”=dword:00000020

So the lesson learned here for me, is try another Windows device with a different BT Adapter. I cannot tell you whether or not the Intel BT Adapter is better than the Realtek one, but for me it worked whereas the Realtek one did not, even though the Realtek one does show you the connected device; just not the IRK code.

Thank you Tom for the heads up, appreciated.


3 Likes

@smurfhk What exact model of Intel bluetooth adapter did you use to get the right results? My results are the same as in your startpost.

This on 3 different systems (2x W10, 1x W11), with 2 different bluetooth USB adapters (both Realtek based), a system with an Intel wireless-AC 7260 wifi/bluetooth card and a system with a MediaTek based wifi/bluetooth card.

Just in case anyone asks, I checked if I had system rights, no problems there.

IIRC the Notebook has an Intel AX210NGW Wifi Card which has Intel BT included.

USB\VID_8087&PID_0032\5&1779F47&0&7. I added that card myself, to an old Notebook. I am 99.9% sure I took out the old AC Wifi Card. HTH.

I replaced the original wifi-card as well, some crappy Broadcom card, but I ran into a whitelist (damn you Lenovo) so had to get a modded BIOS first. Been using the AC 7260 since. But that’s a mPCIe card, the one you mentioned is M.2, my laptop is from before the M.2 era…

Well, looks like I’ll have to get a M.2 ->PCIe adapter to put a more recent Intel card into a PCIe slot in a desktop pc. See if that works.

Thanks for the modelnumber :slight_smile:

Oh I did manage to get the IRK from my phone a different way, smartwatch still no luck. Found a script for an ESP32, connected my phone to it using a bluetooth terminal app (which threw a connection error). Despite the connection error (something about no serial profile), the ESP32 spat out the IRK through the Arduino IDE terminal.

Also tried the adb-method, got a capture file with the entire bluetooth handshake process with my smartwatch in it. But only the IRK from my phone was in there, not the one from my smart watch.

Gonna shop for a more recent Intel card, with at least bluetooth 5, the AC 7260 has bluetooth 4.0, maybe 4.0 is too old for this IRK retrieval method?

Too funny

Lenovo X240, modded BIOS, AC7260 to AX210GNW. Never tried old WiFi card for IRK.

For Apple Watch had to use Arduino IDE Method, was the only way IIRC.

G780 with an i7-3612QM here :slight_smile: , old I know but still works.

I can’t use the Arduino IDE method because my Nothing Watch Pro 2 can’t be forced to connect to the ESP32. So either I’d have to find a way to rewrite the Arduino-sketch so that the ESP32 connects to the smartwatch (instead of other way round), or wait till the new wifi-card arrives.

Found a mPCIe version of the AX210, now for the long wait. Couldn’t find it on this side of the earth.

1 Like

@smurfhk Late update, took a while for the wifi cards I ordered to arrive, and … I’m still stuck.

As of now:
ASUS USB-BT500 BT 5.0 → No IRK in registry
RENGOGA BT 5.4 USB adapter → No IRK in registry
Intel AC 7260 (BT 4.0) → No IRK in registry
Mediatek MT7922 (BT 5.2) → No IRK in registry
and for the two most recent additions:
Intel AC 9560 (BT 5.1) → No IRK in registry
mPCIe version of Intel AX210 (BT 5.3) → No IRK in registry

Either I’m doing something wrong, or there’s something else going on. No matter what model of BT controller I use and either W10 (LTSB 2016, LTSC 2019) or W11 (24H2 Pro), all the registry shows is something like this:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys]

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\0015********]
“9876********”=hex:15,fb,b9,,,,,,,,,,,,,*
“2016********”=hex:83,15,dc,,,,,,,,,,,,,*

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\bcfc********]
“2cbe********”=hex:4d,5b,cd,,,,,,,,,,,,,*

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\bcfce********]

I checked with whoami if the psexec tool is doing it’s thing, not sure what else it could be. Is there a specific BT-driver, BT-controller or Windows version or some combination of the 3 required?

I found that solution works only on iphone 12 pro max. I get new folder inside Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\48f17fb72482 with IRK after pair complete.

I try same with iphone 6 plus and after success pairing only new key is created inside Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\48f17fb72482 (there is no folder with IRK).

Can someone try and confirm this? Where can I find IRK for those devices?

No idea sorry, but see my driver details? HTH?



See Full Driver list here.

Starting to wonder (I have an iPhone 13 Mini) whether it is iPhone dependent (given previous poster’s concern). Not sure of your model.