ESPresense - Apple Watch - Device ID

I’m still not sure I’m seeing anything different than you. First, I’m using MQTT Explorer on my Windows desktop to look at the messages being sent to the mosquito broker and capture the data in the MQTT messages.

As each room detector powers up, I see about 6-9 messages generated by apple:1005:9-24 before I see the first from apple:watch3-4. I only have apple:watch3-4 defined in HA though MQTT Explorer sees all ids. After that I see about 10- 20% of the messages coming from apple:1005:9-24 with 80-90% coming from apple:watch3-4. This is why I just track apple:watch3-4 messages.

Is the “switch” or change in id’s you are talking about? I don’t think this is a switch, but the fact the watch is broadcasting both. My iPhone actually is broadcasting 4 ids including my covid tracker and room assistant app both broadcasting their own id. This is why I don’t think the watch is switching, just broadcasting two ids at different intervals.

The problem I’m having is that I could be in my living room sitting right next to the room sensor and about 5-6 meters from the office sensor but I’m detected in the office causing my office lights to come on. Then a second or two later I’m back in the living room causing the office lights to go out and this happens more than once. I normally don’t have a problem if I’m in the office at my desk, but as I type this, my office lights have blinked twice thinking I had left and come back.

Again when I look at the data, for some reason, ESPresense is not always generating the correct distance. When I’m in the living room, more than 5 meters from the office, 8 meters from the sensor, there are times when it thinks I’m 1.6 meters from the office sensor. This is why the lights blink on from my automation.

I think the problem is either in the ESPresense code or my calibration setting from rssi@1m. As I don’t know anything about bluethooth and how it works, I’m only guessing. I just can’t help thinking I’m just a couple of tweaks away from getting this to work flawlessly if I just knew what to tune and how much.

1 Like

Hi,

I’ve just set-up my first ESPresense device tonight and came across the same problem for both my phone and watch.

However, after carefully following the documents on the ESPresense site here… Apple | ESPresense you will see how it explains to retrieve an IRK (Identity Resolving Key) for your iPhone and watch and then add this to one of the settings on the ESP board web ui to get a consistent device id. Took me a couple of goes to figure it out, so hopefully you will be able to do it.

1 Like

Hi @gadgetbazza,

In the link that you provided, it states (11. Add the same string to your HASS configuration with ‘irk:’ added in front e.g. “irk:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”).

Did you need to do this and, if so, where did you add it, please? Wherever I add it (under mqtt: or under sensor: - platform: mqtt_room), the configuration check fails - it doesn’t like irk:.

Cheers
Joe.

Hi Joe,

Yes it needs to go in you HA configuration yaml in the sensors section, see my snippet below for reference.

sensor:
- platform: mqtt_room
    name: "My Apple Watch BLE"
    device_id: "irk:<device_irk_value_here>"
    state_topic: "espresense/rooms"
    timeout: 5
    away_timeout: 120
  - platform: mqtt_room
    name: "My iPhone 12Pro BLE"
    device_id: "irk:<device_irk_value_here>"
    state_topic: "espresense/rooms"
    timeout: 5
    away_timeout: 120
  - platform: mqtt_room
    name: "Another iPhone BLE"
    device_id: "irk:<device_irk_value_here>"
    state_topic: "espresense/rooms"
    timeout: 5
    away_timeout: 120
  - platform: mqtt_room
    name: "Another Apple Watch BLE"
    device_id: "irk:<device_irk_value_here>"
    state_topic: "espresense/rooms"
    timeout: 5
    away_timeout: 120

HTH

1 Like

Hi @gadgetbazza,

Sorry for the delayed response.

Many thanks for answering my question and, particularly, for providing the snippet - it helps no end.

Under sensor: -platform: mqtt_room, I’d put in entries for the ESP32s running espresense but had failed to put in any entries for the devices (beacons).

So, thanks once again
Joe

Hi,

I can see the mqtt topics through mqtt explorer but for some reason i dont see a sensor for my apple watch underneath the developer tools,

I have the following configured
sensor:

  • platform: mqtt_room
    name: “Davids Watch”
    device_id: “irk:1b087407929fc33f19744c82c53369d4”
    state_topic: “espresense/devices/apple:1005:9-12”
    timeout: 60
    away_timeout: 120

i rebooted home-assistant and the espresence device with the following irk key saved

how do i get my apple watchto show up in home-assistant?

Hi.

From first glance, I’d say the MQTT topic in your yaml is incorrect for this piece.

I’ve actually made a start to finish post Here for setting up apple devices on espresense. It doesn’t go into retrieving the irk for a watch but it sounds like you’ve worked that out from the espresense docs anyway. So check what you have against that guide and hopefully you will find the missing piece.

HTH

thanks but you explicitly say iphone… im trying to setup a watch



is this not right?

Now the Senosr looks correct. I have it configured in the same way and it’s working.

They work exactly the same, the only difference is how you obtain the irk.

1 Like

how do you change the scanning interval?

For Bluetooth? Not sure you can that I’ve seen.

Why do you need to change it, it seems to be pretty frequent to me, like every second?

i need another bluetooth device to test

Is there any way to extract the IRK for an Apple Watch without using a Mac? I have an iPhone and an iPad, but no Mac. From what I am seeing, using MQTT explorer only works for the iPhone, not the Apple Watch.

2 Likes

I have the same problem here. Is it possible to get the IRK without a Mac.
I tried to install the iCloud for Windows, I can find “iCloud-Passwords”, but there is no access to the bluetooth stuff.

Any ideas?

i have been debating getting one of those virtual mac in the cloud accounts just to get the IKR for my watch.

1 Like

I have an old Mac Mini (late 2011) here. Is ist possible to make it work, to get those data? Or is that one too old?

Looking for same solution to find the apple watch irk using windows as well. Did you ever figured this out??

1 Like

You can use VMware player to emulate a MAC, lot ‘s of tutorials online how to do that.