From 45af253a66331f11edc07c7ec9e24269e0ad1674 Mon Sep 17 00:00:00 2001 From: Jens Helgheim <76071330+TurboJens@users.noreply.github.com> Date: Tue, 4 Mar 2025 13:59:28 +0100 Subject: [PATCH 1/4] Added windows instructions I have added the information from https://github.com/home-assistant/home-assistant.io/issues/33676 and put in some extra details to make life easier for others. --- source/_integrations/private_ble_device.markdown | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/_integrations/private_ble_device.markdown b/source/_integrations/private_ble_device.markdown index 912de1b35ed..a00075dee00 100644 --- a/source/_integrations/private_ble_device.markdown +++ b/source/_integrations/private_ble_device.markdown @@ -56,6 +56,17 @@ Alternatively, the IRK of an Android phone and/or secondary device can be obtain 8. Select one of the frames and expand the "Bluetooth Security Manager Protocol." The hex dump will show either the sending or receiving device IRK. 9. Reverse the value displayed. For example, if it is `763af6c7f7d94ad6c262158e2320544e`, the IRK to use would be: `4e5420238e1562c2d64ad9f7c7f63a76`. +### On Windows - for any devices that will connect to a computer: +1. Get the PsExec tool from Microsoft, it's available in the SysinternalsSuite or here: https://learn.microsoft.com/en-us/sysinternals/downloads/psexec download and extract the PsExec.exe or PsExec64.exe +2. Open Command Prompt as Administrator: Press the Windows key, type "cmd," right-click on Command Prompt, and select "Run as administrator." +3. Run PsExec: Navigate to the folder where PsExec is located and run "psexec -i -s cmd" or "psexec64 -i -s cmd". This command will open a new command prompt window with SYSTEM rights. +4. Verify SYSTEM Rights: In the new command prompt window, type whoami to confirm that you have SYSTEM rights. +5. Open Registry Editor with SYSTEM Rights: In the new command prompt window, type regedit to open the Registry Editor with SYSTEM rights. +6. Locate the IRK: Navigate to HKLM\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys. There is one subfolder that probably holds the computers bluetooth radio's mac address, look inside it for the folder corresponding to the MAC address of your Bluetooth device. Within this folder, you will find entries labeled IRK, which contain the Identity Resolving Key. +7. Right-click the key(folder) and select export. Save the .reg file somewhere. +8. Open the .reg file in notepad, Press Ctrl+H to open replace. Find what: "," and Replace with "". Press Replace All. This removes all commas from the hex value. +9. Copy the IRK value (only the part after "hex:") and it can be used as-is. No reversing of byte order needs to be done. + ## ESPresense If you already use Identity Resolving Key tracking with ESPresence then you already have a hex-encoded version of your Identity Resolving Key. Home Assistant can use the key in this format directly. From bb2e122f5a216476edb5ca27189ec6a08d39e260 Mon Sep 17 00:00:00 2001 From: Jens Helgheim <76071330+TurboJens@users.noreply.github.com> Date: Tue, 4 Mar 2025 14:13:06 +0100 Subject: [PATCH 2/4] Update private_ble_device.markdown --- source/_integrations/private_ble_device.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/_integrations/private_ble_device.markdown b/source/_integrations/private_ble_device.markdown index a00075dee00..f6069bee757 100644 --- a/source/_integrations/private_ble_device.markdown +++ b/source/_integrations/private_ble_device.markdown @@ -56,13 +56,13 @@ Alternatively, the IRK of an Android phone and/or secondary device can be obtain 8. Select one of the frames and expand the "Bluetooth Security Manager Protocol." The hex dump will show either the sending or receiving device IRK. 9. Reverse the value displayed. For example, if it is `763af6c7f7d94ad6c262158e2320544e`, the IRK to use would be: `4e5420238e1562c2d64ad9f7c7f63a76`. -### On Windows - for any devices that will connect to a computer: -1. Get the PsExec tool from Microsoft, it's available in the SysinternalsSuite or here: https://learn.microsoft.com/en-us/sysinternals/downloads/psexec download and extract the PsExec.exe or PsExec64.exe +### On Windows - for any devices that will connect to a computer +1. Get the PsExec tool from Microsoft. It's available in the [Sysinternals Suite](https://learn.microsoft.com/en-us/sysinternals/downloads/psexec). Download and extract the PsExec.exe or PsExec64.exe. 2. Open Command Prompt as Administrator: Press the Windows key, type "cmd," right-click on Command Prompt, and select "Run as administrator." 3. Run PsExec: Navigate to the folder where PsExec is located and run "psexec -i -s cmd" or "psexec64 -i -s cmd". This command will open a new command prompt window with SYSTEM rights. 4. Verify SYSTEM Rights: In the new command prompt window, type whoami to confirm that you have SYSTEM rights. 5. Open Registry Editor with SYSTEM Rights: In the new command prompt window, type regedit to open the Registry Editor with SYSTEM rights. -6. Locate the IRK: Navigate to HKLM\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys. There is one subfolder that probably holds the computers bluetooth radio's mac address, look inside it for the folder corresponding to the MAC address of your Bluetooth device. Within this folder, you will find entries labeled IRK, which contain the Identity Resolving Key. +6. Locate the IRK: Navigate to HKLM\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys. There is one subfolder that probably holds the computer's Bluetooth radio's MAC address, look inside it for the folder corresponding to the MAC address of your Bluetooth device. 7. Right-click the key(folder) and select export. Save the .reg file somewhere. 8. Open the .reg file in notepad, Press Ctrl+H to open replace. Find what: "," and Replace with "". Press Replace All. This removes all commas from the hex value. 9. Copy the IRK value (only the part after "hex:") and it can be used as-is. No reversing of byte order needs to be done. From 5d67c7f1b9b2296b00265a7e055d2110a41f4275 Mon Sep 17 00:00:00 2001 From: Jens Helgheim <76071330+TurboJens@users.noreply.github.com> Date: Tue, 4 Mar 2025 14:31:40 +0100 Subject: [PATCH 3/4] Updated formatting --- source/_integrations/private_ble_device.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/source/_integrations/private_ble_device.markdown b/source/_integrations/private_ble_device.markdown index f6069bee757..d344ba7c792 100644 --- a/source/_integrations/private_ble_device.markdown +++ b/source/_integrations/private_ble_device.markdown @@ -57,6 +57,7 @@ Alternatively, the IRK of an Android phone and/or secondary device can be obtain 9. Reverse the value displayed. For example, if it is `763af6c7f7d94ad6c262158e2320544e`, the IRK to use would be: `4e5420238e1562c2d64ad9f7c7f63a76`. ### On Windows - for any devices that will connect to a computer + 1. Get the PsExec tool from Microsoft. It's available in the [Sysinternals Suite](https://learn.microsoft.com/en-us/sysinternals/downloads/psexec). Download and extract the PsExec.exe or PsExec64.exe. 2. Open Command Prompt as Administrator: Press the Windows key, type "cmd," right-click on Command Prompt, and select "Run as administrator." 3. Run PsExec: Navigate to the folder where PsExec is located and run "psexec -i -s cmd" or "psexec64 -i -s cmd". This command will open a new command prompt window with SYSTEM rights. From 6f0cd44f88560f4a5c1cfae6b03def84b786de9f Mon Sep 17 00:00:00 2001 From: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> Date: Fri, 14 Mar 2025 08:45:50 +0100 Subject: [PATCH 4/4] tiny style tweaks --- .../_integrations/private_ble_device.markdown | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/_integrations/private_ble_device.markdown b/source/_integrations/private_ble_device.markdown index d344ba7c792..c51f394a8f4 100644 --- a/source/_integrations/private_ble_device.markdown +++ b/source/_integrations/private_ble_device.markdown @@ -58,15 +58,15 @@ Alternatively, the IRK of an Android phone and/or secondary device can be obtain ### On Windows - for any devices that will connect to a computer -1. Get the PsExec tool from Microsoft. It's available in the [Sysinternals Suite](https://learn.microsoft.com/en-us/sysinternals/downloads/psexec). Download and extract the PsExec.exe or PsExec64.exe. -2. Open Command Prompt as Administrator: Press the Windows key, type "cmd," right-click on Command Prompt, and select "Run as administrator." -3. Run PsExec: Navigate to the folder where PsExec is located and run "psexec -i -s cmd" or "psexec64 -i -s cmd". This command will open a new command prompt window with SYSTEM rights. -4. Verify SYSTEM Rights: In the new command prompt window, type whoami to confirm that you have SYSTEM rights. -5. Open Registry Editor with SYSTEM Rights: In the new command prompt window, type regedit to open the Registry Editor with SYSTEM rights. -6. Locate the IRK: Navigate to HKLM\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys. There is one subfolder that probably holds the computer's Bluetooth radio's MAC address, look inside it for the folder corresponding to the MAC address of your Bluetooth device. -7. Right-click the key(folder) and select export. Save the .reg file somewhere. -8. Open the .reg file in notepad, Press Ctrl+H to open replace. Find what: "," and Replace with "". Press Replace All. This removes all commas from the hex value. -9. Copy the IRK value (only the part after "hex:") and it can be used as-is. No reversing of byte order needs to be done. +1. Get the PsExec tool from Microsoft. It's available in the [Sysinternals Suite](https://learn.microsoft.com/en-us/sysinternals/downloads/psexec). Download and extract the `PsExec.exe` or `PsExec64.exe`. +2. Open Command Prompt as Administrator: Press the Windows key, type `cmd`, right-click on **Command Prompt**, and select **Run as administrator**. +3. Run PsExec: Navigate to the folder where PsExec is located and run `psexec -i -s cmd` or `psexec64 -i -s cmd`. This command will open a new command prompt window with SYSTEM rights. +4. Verify SYSTEM Rights: In the new command prompt window, type `whoami` to confirm that you have SYSTEM rights. +5. Open Registry Editor with SYSTEM Rights: In the new command prompt window, type `regedit` to open the Registry Editor with SYSTEM rights. +6. Locate the IRK: Navigate to `HKLM\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys`. There is one subfolder that probably holds the computer's Bluetooth radio's MAC address, look inside it for the folder corresponding to the MAC address of your Bluetooth device. +7. Right-click the key(folder) and select export. Save the `.reg` file somewhere. +8. Open the `.reg` file in Notepad. To open the **Replace** window, press Ctrl+H. **Find what:** "," and **Replace with** "". Select **Replace All**. This removes all commas from the hex value. +9. Copy the IRK value (only the part after `hex:`) and it can be used as-is. No reversing of byte order needs to be done. ## ESPresense