dalehumby / ESPHome-Apple-Watch-detection

ESPHome BLE Apple Watch presence detection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't find Apple Watch 5

Zipties opened this issue · comments

My series 7 shows up fine but my girlfriend's series 5 doe snot. Any tips on how I can get both working? I changed the Lamba to the code suggested in a similar thread and captured the following here is some info I've gathered

[V][api.connection:763]: Hello from client: 'Home Assistant 2022.2.5 (192.168.40.195)'
[D][api.connection:779]: Home Assistant 2022.2.5 (192.168.40.195): Connected successfully
[D][homeassistant.sensor:024]: 'input_number.upstairs_harssi_present': Got state -77.00
[V][sensor:074]: 'HA RSSI Present Value': Received new state -77.000000
[D][sensor:125]: 'HA RSSI Present Value': Sending state -77.00000  with 1 decimals of accuracy
[V][mqtt:405]: Publish(topic='upstairs/sensor/ha_rssi_present_value/state' payload='-77.0' retain=1)
[D][homeassistant.sensor:024]: 'input_number.upstairs_harssi_not_present': Got state -85.00
[V][sensor:074]: 'HA RSSI Not Present Value': Received new state -85.000000
[D][sensor:125]: 'HA RSSI Not Present Value': Sending state -85.00000  with 1 decimals of accuracy
[V][mqtt:405]: Publish(topic='upstairs/sensor/ha_rssi_not_present_value/state' payload='-85.0' retain=1)
[D][ble_adv:052]: Possible Apple Watch: data[2]=0x0e data[3]=0x18
[D][ble_adv:053]:   rssi -86
[D][ble_adv:054]:   mac 5E:A9:00:64:95:97
[D][ble_adv:052]: Possible Apple Watch: data[2]=0x0e data[3]=0x18
[D][ble_adv:053]:   rssi -87
[D][ble_adv:054]:   mac 5E:A9:00:64:95:97
[D][ble_adv:052]: Possible Apple Watch: data[2]=0x0e data[3]=0x18
[D][ble_adv:053]:   rssi -86
[D][ble_adv:054]:   mac 5E:A9:00:64:95:97
[D][ble_adv:052]: Possible Apple Watch: data[2]=0x0e data[3]=0x18
[D][ble_adv:053]:   rssi -86
[D][ble_adv:054]

IMG_5835
IMG_5834
IMG_5833
IMG_5832

I don't have an answer for you. Though I would like to see your whole config settings. I have series 3 and 7 but atm my setup isn't working properly. I have posted it here. I am not sure what I am doing wrong.

commented

Hi @Zipties -

It looks like your girlfriends series 5 is being detected, but possibly was locked at the time? Usually data[3]=0x18 means the watch is locked, and it changes to 0x98 when unlocked (i.e. on wrist and pincode typed in.) Or does the log output always say data[3]=0x18 even when unlocked?

On line 60 of the yaml, you can change it to

if (data_flags == 0x98 || data_flags == 0x18) {

This will detect both locked and unlocked devices.

I confirmed it wasn't locked, and even borrowed it for a bit to make sure. After working on it longer, I believe the device in the logs may not have been hers, but I am sure the screenshots of the BLE scanner app was her watch.

commented

Was the watch detected when you changed the lambda to look for both 0x28 and 0x18?

If you want to be fairly sure the watch you are testing is the one being detected, bring it within 5-10 cm of the ESP32, and the RSSI should be about -45 dBm.