Skip to content

ComputerWhisperers/IRKey-Explorer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Home Assistant App Latest Release License: MIT

IRKey Explorer

IRKey Explorer

IRKey Explorer is a Home Assistant app that controls a permanent ESP32 enrollment node and collects Bluetooth Identity Resolving Keys (IRKs). The keys can be copied into Home Assistant's Private BLE Device integration or used by any compatible BLE presence system.

The ESP32 runs the current ESPresense firmware. IRKey Explorer connects to it through the Home Assistant MQTT broker and provides a focused Ingress dashboard for enrollment, telemetry, captured keys, and device management.

Features

  • Discover ESPresense nodes automatically through MQTT.
  • Display node connectivity, IP address, firmware, Wi-Fi RSSI, uptime, memory, and fingerprint count.
  • Start or cancel a two-minute BLE enrollment window.
  • Capture IRKs from iPhone, iPad, Apple Watch, and other compatible bonded devices when ESPresense publishes an IRK.
  • Display complete IRKs with one-click copy controls.
  • Retain a local enrollment history in Home Assistant app backups.
  • Restart the enrollment ESP32 and remove retained enrollments.
  • Open Home Assistant's Private BLE Device setup directly from the dashboard.
  • Work with Bermuda, ESPresense, and other systems that resolve BLE private addresses from an IRK.

Hardware

This project was designed around the MH-ET LIVE ESP32 MiniKit / ESP32 D1 Mini. The seller description sometimes mentions ESP8266; verify that the module and metal RF can are marked ESP32. An ESP8266 has no Bluetooth and cannot perform IRK enrollment.

You need:

  • One ESP32 D1 Mini board.
  • A data-capable Micro-USB cable for flashing.
  • A stable 5 V USB power supply for permanent operation.
  • A computer running Chrome, Edge, or another Chromium browser with WebSerial.
  • A 2.4 GHz Wi-Fi network reachable by Home Assistant and MQTT.
  • Home Assistant with the Mosquitto broker app and MQTT integration configured.

No GPIO wiring or soldering is required. Leave the ESP32 antenna end clear of metal, large power supplies, and enclosed wiring. Place the finished node where the phone or watch can be brought within a few feet during enrollment.

Build The ESP32 Enrollment Node

1. Flash ESPresense

  1. Connect the ESP32 D1 Mini to your computer with the data-capable USB cable.
  2. Open the official ESPresense firmware installer in Chrome or Edge. Firefox and Safari do not support the required WebSerial flow.
  3. Select Connect and choose the new serial/COM port belonging to the ESP32.
  4. Allow the installer to detect the ESP32 and select the current stable build.
  5. Select Install ESPresense and wait for flashing and verification to finish.
  6. Disconnect and reconnect power if the board does not reboot automatically.

If no serial port appears, try another cable and close Arduino IDE, PlatformIO, or any serial terminal that may already have the port open. Some D1 Mini clones also require the appropriate CH340 or CP210x USB serial driver.

2. Configure Wi-Fi And MQTT

After flashing, the board broadcasts an open Wi-Fi network beginning with ESPresense-.

  1. Join the ESPresense-... network from a phone or computer.
  2. Wait for the captive portal or open http://192.168.4.1 manually.
  3. Configure these values:
ESPresense field Recommended value
Room name IRK Enrollment
Wi-Fi SSID Your trusted 2.4 GHz network
Wi-Fi password The network password
MQTT server Home Assistant's LAN IP address or resolvable hostname
MQTT port 1883
MQTT username A Home Assistant/Mosquitto user
MQTT password That user's password
Discovery topic prefix homeassistant
Send telemetry Enabled
Send discovery Enabled
  1. Save the configuration and let the ESP32 reboot.
  2. Reconnect your phone or computer to its normal Wi-Fi network.
  3. Leave the ESP32 powered permanently from its 5 V USB supply.

ESPresense currently sends MQTT credentials without TLS. Use it only on a trusted local network and use a dedicated credential rather than reusing an important password.

3. Confirm The MQTT Connection

In Home Assistant, open Settings → Devices & services → MQTT. An ESPresense device named IRK Enrollment should appear within about a minute.

For a lower-level check, open Configure → Listen to a topic, subscribe to:

espresense/rooms/irk-enrollment/#

The node should publish online under status and JSON under telemetry.

Install The Home Assistant App

  1. In Home Assistant, open Settings → Apps → App store.

  2. Open the store menu and select Repositories.

  3. Add this repository:

    https://github.com/ComputerWhisperers/IRKey-Explorer
    
  4. Find and install IRKey Explorer.

  5. Start the app and open its Web UI.

  6. The Mosquitto connection is supplied automatically through Home Assistant's MQTT service discovery; no broker password is entered in this app.

  7. Confirm the IRK Enrollment ESP32 appears as Online in the node selector.

The app expects the standard espresense MQTT prefix. If ESPresense was configured with another prefix, change MQTT topic prefix on the app's Configuration tab and restart it.

Enroll A Device

iPhone Or iPad

  1. Select the online ESP32 in IRKey Explorer.
  2. Choose the device type, enter a friendly name, and select Start enrollment.
  3. On the Apple device, open Settings → Bluetooth.
  4. Select ESPresense and accept the secure pairing request.
  5. The captured 32-character IRK appears in the dashboard.

Apple Watch

  1. Start enrollment from IRKey Explorer.
  2. On the watch, open Settings → Bluetooth.
  3. Wait for ESPresense to appear. Some watchOS versions list it under Health Devices because the ESP32 temporarily advertises as a heart-rate monitor.
  4. Select ESPresense and accept pairing.
  5. The captured Watch IRK appears separately in the dashboard.

Enrollment closes automatically after two minutes. If the ESPresense device does not appear, toggle Bluetooth on the Apple device and start enrollment again.

Samsung Galaxy And Android

Samsung Galaxy phones and most Android phones rotate their BLE MAC addresses, but ESPresense does not normally receive an IRK from Android enrollment. The settled ESPresense Android path is to enable the Home Assistant Companion App BLE Transmitter sensor on the phone, which advertises a stable iBeacon-style UUID that Bermuda and ESPresense can use.

Galaxy watches vary by model and software. If a Galaxy Watch does not pair with the ESPresense enrollment node and publish an irk:<32-hex> MQTT config, IRKey Explorer cannot discover its IRK automatically.

Use The IRK In Home Assistant

  1. Keep the enrolled phone or watch nearby and broadcasting.
  2. Copy its IRK from IRKey Explorer.
  3. Open Settings → Devices & services → Add integration.
  4. Select Private BLE Device and paste the IRK.
  5. Complete validation while the device remains in Bluetooth range.

Bermuda automatically adds its room and distance sensors to devices registered through Private BLE Device. Other IRK-aware BLE systems can use the same key.

Troubleshooting

  • ESP32 is absent from the app: Verify Mosquitto is running, the MQTT integration is configured, and espresense/rooms/irk-enrollment/status contains online.
  • ESP32 never joins Wi-Fi: The classic ESP32 uses 2.4 GHz Wi-Fi. Power-cycle it and reconnect to the captive portal to correct its network settings.
  • MQTT authentication fails: Re-enter the MQTT username and password in the ESPresense Network page. Do not use a Home Assistant long-lived access token.
  • No pairing target appears: Bring the device closer, cancel enrollment, toggle Bluetooth, and start a fresh two-minute window.
  • IRK is captured but Private BLE validation fails: Keep the device awake and nearby until Home Assistant observes a matching rotating BLE address.
  • Need firmware logs: Connect USB and use the official ESPresense serial terminal at 115200 baud.

Security

An IRK allows rotating BLE addresses to be correlated with a specific device. IRKey Explorer displays keys in full and stores them in /data/devices.json. Protect Home Assistant access, MQTT access, and app backups accordingly.

The dashboard is exposed only through Home Assistant Ingress and does not open a standalone web port.

Acknowledgements

BLE enrollment and ESP32 firmware are provided by ESPresense. This project communicates with ESPresense through its documented MQTT topics and does not redistribute or modify its firmware.

License

MIT

About

Home Assistant add-on for capturing BLE Identity Resolving Keys through a permanent ESPresense enrollment bridge.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors