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.

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.




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
1 Like

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.


1 Like