Detecting Apple devices and using IRKs with the ESP32-dev-BLE firmware (v1.8.0)

Hello everyone,

I recently updated my ESP32-dev to the BLE firmware version 1.8.0. Previously, I used version 1.7 to forward BLE packets to Jeedom, specifically for detecting a connected showerhead.

Now, I’m interested in exploring the possibility of detecting Apple devices (iPhone, iPad, etc.) via Bluetooth LE. Here are my questions:

  1. With the ESP32-dev-BLE 1.8.0 firmware, is it possible to decode Bluetooth MAC addresses of Apple devices?

  2. If the devices use random MAC addresses, can we configure IRKs (Identity Resolving Keys) to identify them?

• If so, where and how do we specify the IRKs in the configuration?

  1. Can the current firmware directly publish identifiable information in MQTT (e.g., device type or UUID) to make it easier to use without requiring additional plugins on Jeedom?

Additional context:

I don’t have extensive knowledge of the project, but I noted that this configuration was necessary in version 1.7, and I reapplied it directly in the web console after upgrading to 1.8:

commands/MQTTtoBT/config {"pubadvdata":true, "interval":"15000", "intervalacts":"15000", "adaptivescan":false, "intervalcnct":300000, "bleconnect":false, "save":true}

The goal is to retrieve information directly via MQTT and integrate it into Jeedom without needing to install additional plugins.

Thank you in advance for your insights! If you have any configuration examples or experience with detecting Apple devices, I’d love to hear about it. :blush:

Welcome @Heliospeed

The Apple device detection with resolving randomised Bluetooth MAC addresses is currently only available with Theengs Gateway, but not implemented in OpenMQTTGateway yet, as stated on the individual documentation pages of the compatible devices list.

While there is a plug-in for TGW for Jeedom, it doesn’t mean you have to use it, any individual pip install of Theengs Gateway will give you the same functionality, and even if your local Jeedom device doesn’t have Bluetooth coverage for your whole house or doesn’t even have a Bluetooth adapter at all, you can use the esp32dev-ble-mqtt-undecoded OpenMQTTGateway binary on your ESP32(s) to use as remote antennas to send all received devices to Theengs Gateway for decoding, your Apple devices as well as your shower head.

All listed known compatible devices will have their brand, model and model_id published along with their unique properties, but also unknown devices will be uniquely identifiable by their static MAC addresses.

This looks like a good reasonable settings configuration. If you want to find out more about what each of these settings does, have a look at the detailed BLE usage documentation, at

I hope this clarifies things for you. Let us know if you have any further questions.

Thank you for this detailed response. If I understand correctly, I need to reflash my ESP with the esp32dev-ble-mqtt-undecoded version instead of the esp32dev-ble version. This will allow me to propagate Bluetooth frames into MQTT.

In Jeedom, the plugin works if you have a Bluetooth antenna either locally or remotely via SSH (it installs TWG on a Debian system).

Currently, I have a Debian server running Jeedom with a Bluetooth dongle. My goal is to run Jeedom in a container and no longer directly connect any dongles (Bluetooth, Z-Wave, RFLink, etc.). I want to use dedicated containers that publish to my MQTT broker.

The problem I’m encountering is that Bluetooth dongles don’t mount the same way as other devices since they’re recognized as network peripherals.

Is it possible to run Theengs Gateway in a container without a Bluetooth dongle and have it retrieve information from an ESP (running OpenMQTTGateway) to decode my Apple devices?

Then, in Jeedom or another platform, I would only need to retrieve the information published to MQTT.

My goal is to have a more modular, portable, and flexible home automation system (thanks to the ESP acting as a remote BLE antenna).

Thank you again for your help, @DigiH ! You had already helped me a lot on the Jeedom community forum.

You can also just flick the "extDecoderEnable":true switch on your current esp32dev-ble version to make it esp32dev-ble-mqtt-undecoded.

They it will publish the undecoded raw messages which Theengs gateway will pick up, decode and republish, even when its own

-b BLE, --ble BLE     Enable (1) or disable (0) BLE (default: 1)

set to 0, Theengs Gateway shouldn’t even look and want to try to received any local BLE broadcasts, but only decoding the undecided messages received by OpenMQTTGateway.

Best to watch and confirm how these messages flow like that with MQTT Explorer.

Thank you very much for your feedback. As soon as I applied the “extDecoderEnable”: true parameter, I was able to retrieve the undecoded data from the ESP in OpenMQTTGateway. I also confirmed that the information shows up correctly in MQTT Explorer and is detected by the Jeedom “MQTT Discovery” plugin.

Regarding Theengs Gateway, I used the Docker image: “theengs/gateway:latest” without adding any specific parameters in the Docker Compose file (aside from the Identities to decode my Apple devices).

Once again, thank you! I’m really happy that it’s working now. I’ll add more ESP32 antennas to improve Bluetooth coverage—this is great. I’m starting to better understand how it all works.

Have a good evening, and thanks again!

1 Like