Connecting Apple Devices through Plug1 for Home Assistant Presence

I am trying to get room presence detection setup in home assistant, however I cannot for the life of me get any apple devices to connect (or even show up). I have gotten my public mac address, and IRK using MacOS. This information is valid, as I can use Private BLE to see the device.

I am running HAOS so all of the pip and docker commands are unavailable to me, and I only have access to the configuration. To make matters more complicated I do not have access to the .cfg only the GUI for the addon.

I suspect the identites is the area I want to add the device in, but I have not been able to locate any clear instructions for the parameters/syntax for the identities parameter.

Needless to say I am becoming extremely frustrated by the entire process. Any insight would be greatly appreciated.

I can feel your extreme frustration, especially since room presence is not really supported by our Theengs Gateway BLE device_tracker Hokme/Away presences implementation, which also includes no hassle auto-discovery for this use case. So with Theengs Gateway your frustration won’t go away.

I’m not quite sure where you might have gotten the idea that it should also work for room presence, and it would even kind of work if you’d have RPis in every room with Theengs Gateway installed, and then using each gateway’s presence topic with HA room presence add-ons. This would be very resource wasting though, and while a single Theengs Gateway Add-on instance can have its receiving range extended by one or more ESP32 with OpenMQTTGateway installed, this again is only for a general BLE device_tracker Home/Away recognition.

AFAIK ESPresense would be your best bet for room presence detection of your Apple devices via Bluetooth, but I do not have any personal experience with it, as I find Bluetooth room presence detection inherently inaccurate, due to its technology, and therefore purely rely on motion, contact sensors and radar presence sensors for this task.

I am sure I got the idea somewhere on the internet… Who knew you could get bad advice on the internet?

Sounds like home/way is going to be the plan then. Dog pretty much takes most other presence detectors out of the equation.

To avoid continuing to chew on broken glass, two plugs one at each end of house for good BT coverage, would take BT convert to MQTT and create an entity in HA. The entity would report home if device is detected on either or both plugs, and away if on neither plug. (assuming both plugs are broadcasting on same topic and connected to a MQTT broker)

Finally the apple device have never connected. Never auto discovered and could not get entity to work. Apparently I need to provide an address password address password for the entity. I have the Public address of the device, and the irk. What other address and password needs to be entered, and in which order?

:wink:

You really just need one instance of Theengs Gateway

and the Add-on configuration is the only thing you require to be able to enter the Identity MAC address and Irk for you Apple device(s) - as well as the MQTT integration and an MQTT Broker, either also with the Mosquito HA Add-on, or any other MQTT Broker running anywhere on your local network.

Have you got all these?

Then to extend the range to pick up your Apple device(s). throughout your whole home, one or more ESP32s with the esp32dev-ble-mqtt-undecoded binary of OpenMQTTGateway. similar as described in this thread, even with a different controller system and the Add-on for that controller.

Then once the Identity MAC and Irk has been correctly entered into the Add-on configuration GUI, and Discovery is switched on for a few minutes, the Apple devices will show up auto-discovered within the MQTT Integration from where they can be added to any dashboard.

I have read those articles. They fail to tell me what data to enter in to the identities section of the config. I have the public BT address of the device. I have the irk, the identities field requires an addition address and code?/Password?Irk?

I assume I enter “Public address(aa:bb…)”,“irk”:“some unknown devices address”,“code” at which point the plug can “see” the device and will pass the information to the mqtt.

problem is what is the other address and irk?

No, the identity field only requires the Identity MAC address and the related IRK to be entered, in the correct format, as described in the Documentation section right to the left of the Configuration section.

Screenshot 2025-01-04 at 23.31.12

So for one single Apple device this would be

{"AA:BB:CC:DD:EE:FF": "anVzdG9uZWV4YW1wbGVJUks="}

which then allows Theengs Gateway to test all received BLE broadcasts with randomly changing MAC addresses to be verified and resolved with this particular one, create an auto-discovery BLE device_tracker and constantly set its status to Home or Away.

I think you might have gotten confused with the example in the Documentation having two separate MAC/IRK combos, to show how to also enter the identities for multiple Apple devices.

The documentation on the Theengs Gateway docs pages also seem to be pretty clear in this respect, with the multi device identity setup.

and did you follow the instructions in the paragraph below to get the correct Identity MAC address and IRK for your device(s)?

Solved! Thank you for all of the assistance!

FYI my omission of the {} was the issue with using single address and irk. Unfortunately addon log reports that character 30 was the issue not character 1, so that reenforced the impression of needing two addressed and irk. Hopefully this will help someone else in the future.