Espresense device id - how to get them?

yes, I enter an name before pressing the enroll button. Do I need to remove my old id I am using to detect my iphone which is apple:1007:11-2 in the espresense gui setting page under the Filtering tab??

Possibly. I don’t have anything filtered on mine.

ok. Thanks got it working now. The filter line must be blank for the irk id to be detected it seems.

If you use MQTT Explorer, just select the topic on the left side then click the delete button.

Had to amend my post as I was having a few problems with set up but all working now - this is amazing. Thanks so much for the walk through guide - so helpful - thank you!!!

Do you know how to make Android phones update faster? It takes my device 10 mins to change rooms

Sorry, I have zero experience with android phones.

if your issue is with the time it takes to pick up the device when you enter a room, it’s certainly not instant so not really usable for PIR type detection. But in my experience it can be delayed but sometimes it picks me up before I even enter the room.

If you have multiple espresense devices then as you move around this can also take a short while. I believe the espresense uses the distances to work out which receiver you are closer to and the distance on each espresense is an average over the last number of pings, so if you move quickly it actually takes longer to follow you if that makes sense. You can see this for yourself if you open the fingerprints page on each espresense and watch the distance values. I wouldn’t read too much into the distance values. I probably wasted about 3 hours trying to tune them to create a virtual boundary between two rooms using a tape measure and the readouts!!! I failed miserably and actually after resetting all the defaults it seems to work pretty well out of the box!

One other thing to note, I think the amount of Bluetooth pings from your phone may also be linked to battery state. I find that sometimes when my iPhone is in low power mode that my presence in a room can be lost causing my automations to shut the lights off and then shortly after they come back on! I can probably tune this out by increasing the delay on the lights off automation to accommodate the longer period between Bluetooth pings.

Thank you for your response! It looks like it was an Android issue. I was able to setup an iPhone, Tile, and a Blue Charm beacon which all work pretty well. I would say the Blue Charm beacons are the best and will probably just get more of those. One individual in my home doesn’t want to carry a beacon around so I want to get their Apple Watch connected. Unfortunately I’m having trouble with step 9. After I copy the highlighted section I am unable to do anything with it. Step 9 says I need to paste the piece I just copied in step 8 into the box and click “decode” but the option says “convert”. How do I proceed?


This step 9 on the ESPresnse page

Hi, I think this is just an error in the documentation, paste the string into the box above the Convert button and press Convert and this should give you the irk.

Agree with everyone! Thanks so much for this. I thought i lost my room presence ability after deciding to switch it up to an iPhone for a change.

1 Like

Has anyone had any luck extracting an Apple Watch IRK using the tool on the ESPresence website recently? Whenever I try it, it outputs 0000 for me. I have been careful to copy the entire XML string and I have tried it in Safari, Firefox and Edge.

Is anyone able to test it for me?

My impatience won out so using the easily accessible iPhone IRK I have recreated what the converter should be doing using CyberChef.

Process to obtain the Apple Watch IRK is as follows:

  1. Copy the XML output of your Apple Watch’s BluetoothLE address as instructed in the guide on ESPresence
  2. Paste this into notepad, and scroll down to the bottom where it says:
<key>Remote IRK</key>
<data>
Randomcharactershere
</data>

and copy the random characters

  1. Open the following link: CyberChef and paste the characters into the input field, if done correctly the output should be your devices IRK key.

  2. Resume the excellent instructions by @gadgetbazza above, or the ESPresence guide.

1 Like

Yes - I just used the tools and instructions on the ESPresence website and was able to convert the XML to an IRK for my Apple Watch. So I’m not sure if it was working yesterday when you tried it, but it was definitely working today!

The part of the web-page instructions for the Apple Watch that needs improvement is the bit about “adding the IRK:xxxxxxxxxx” to your configuration.yaml. It needs to be updated to be more specific. (This is how I ended up reading this thread). My question was answered above - it needs to be specified as the “device_id:” value for the MQTT_ROOM sensor. I agree with the op here that this thread should be linked/pinned to the ESPresence instructions.

Hey there. I have just finished setting up my first ESP32 by following the instructions on the ESPresence site - and I added my iPhone, 2 iPad’s and my Apple Watch successfully - and configured them in MQTT_ROOM in Home Assistant - but I only needed to use the IRK: for the Apple Watch. The other 3 devices worked fine using the “device_id:” which is the name I paired them with.

Your post seems to suggest that this shouldn’t work (and maybe it didn’t in December), but it does seem to work fine now. Granted I’ve only set up a single ESP32 so far.

Do I need to pair my devices with every ESP32 I deploy? Or are they smart enough to share the information through MQTT after it’s registered with the first one? (I also was able to configure the FILTER section on the ESP32 to only send data from the 3 iOS devices I registered using their device_id’s - but then removed them because I couldn’t figure out how to add the Apple Watch to it)

I think the way you have experienced it is how it is meant to be. However as you have said you are running with only 1 ESP currently, my problems began when I had multiple.

With that said, I think it actually will work with multiple too, however I believe there is a dependency on the device id to irk mapping being registered in MQTT. If you look using something like MQTT explorer you will find messages (in the discovery node I think) listing these mappings. For some reason, in my setup at least, these mappings disappear from time to time and then the whole thing falls down. So I find it more reliable to actually use the irk values (despite them being non readable) and remove the mappings that were posted to MQTT.

Maybe there have been some improvement since I flashed my ESP’s but my theory suggests the problem is the dependency on the MQTT values which could be removed leaving the solution broken.

It would be good to know if you experience this loss of registration, either over time or perhaps after power failures / reboots etc.

after wasting a day messing about i found this post and it worked in minutes - thanks so much

For Apple Watch’s, the process for retrieving the IRK value requires that you use a computer to access your iCloud Keychain data, but once you have the IRK value, the rest of the process is identical.

Anyone have experience extracting the irk from apple watch using windows pc??

4 Likes

Can you share you set up your bluecharm beacon?. I have multiple iPhone and an android working fine but, I can’t find any information on how to set up these damn beacons

The setup is the same but you use the ID that starts out with “ibeacon”. What app are you using on your phone to edit the BlueCharms? Also are you using MQTT Explorer to find the beacon info?