Link Search Menu Expand Document (external link)

Apple Devices

Apples devices emit various btle continuity messages and the fingerprint apple:100?:*-* is often the one seen. Unfortunately if your household has many iPhones, eventually the nearby info will start to collide and lead to duplicate fingerprints.

To work around this you can get the remote IRK (identity resolving key) from your iOS (iPhone) or Watch OS (Apple Watch) device and add this to the Known BLE identity resolving keys section of the ESPresense configuration.

Note: ESPresense version 3.0 or higher is required!

iOS (manual setup)

To automatically get the IRK for your iOS device you can pair it with an ESPresense instance and the key will be visible in the espresense/settings topic. You can either manually add it to your configuration or let HASS configure it for you.

  1. Go in your browser to the ESPresense devices page: http://espresense-office/ui
  2. Fill in a name for your device in the name field and click the Enroll button.
  3. On your iPhone to to Settings -> Bluetooth and you’ll see a new ESPresense device.
  4. Pair the device and the key becomes visible in the MQTT topic espresense/settings

Tip: use MQTT explorer to view the RAW messages. Note: With the automatic procedure you DON’T need to add the 32-bit key to the Known BLE identity resolving keys. It’s automatically done via mqtt!

Watch OS

An Apple Watch cannot be paired with Bluetooth to the ESPresense instance. You have to extract the IRK from iCloud with the Apple Keychain application on MacOS.

Tip: To ensure you have the right IRK, you need to know your Apple Watch’s GUID. To easily find your Apple Watch GUID go on your Apple Watch to the Settings app -> General -> Info and look under Bluetooth for the MAC address.

  1. On MacOS, make sure you are logged in with the iCloud ID with which the Apple Watch is configured.
  2. Start the Keychain access application.
  3. In the left sidebar click on iCloud
  4. In the upper right search bar type bluetooth
  5. A series of GUIDs are shown with the application password type.

    keychain-icloud

  6. Open each GUID to find the one associated with your apple watch. You should see your watches GUID as part of the Account field in the format: Public: XX:XX:XX:XX:XX:XX
  7. Click on Show password
  8. Type your MacOS password twice and copy the contents.

    keychain-password

  9. Paste the contents in the form below and click ‘Decode’ to convert this into an IRK. Under the hood, this is extracting Base64 data and converting it to a hex string and then reversing the order of the bytes.





    Output
    Enter base64 above...


  10. Add the output (which should be 32 characters) to the ‘Known BLE identity resolving keys’ section of the ESPresence configuration.

    ble-irk

  11. Add the same string to your HASS configuration with ‘irk:’ added in front e.g. “irk:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”