-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apple watch 3 always in OFF state #13
Comments
Hi. Could you send logs from ESPHome while is running? That will help see where the problem is.
Also, just to confirm: you are wearing the watch, and it is currently unlocked? By default it’ll only report RSSI when unlocked.
Thanks
|
Hi. I am not wearing the watch and the watch does not have a passcode. Though I did unlock it while testing it. I will try to wear the watch now. Here is the log.
|
I’ve noticed the log did not go further than `Starting scan`. Is this because there weren’t any more (useful) logs?
Sometimes (or maybe some) ESP32s lock up and Bluetooth scanning doesn’t work properly.
Under `scan_parameters:` try remove `interval: 1.2s` and `window: 500ms` so that the default values are used.
If you start getting BLE logs, then you can add those two lines back, but try a lower `window`, like 300ms or 100ms.
… On 03 Feb 2022, at 22:46, duceduc ***@***.***> wrote:
Hi. I am not wearing the watch and the watch does not have a passcode. Though I did unlock it while testing it. I will try to wear the watch now. Here is the log.
Using 'COM4' as serial port.
Showing logs:
[06:38:51]ts Jun[I][logger:214]: Log initialized
[06:38:51][C][ota:458]: There have been 2 suspected unsuccessful boot attempts.
[06:38:51][D][esp32.preferences:114]: Saving preferences to flash...
[06:38:51][I][app:029]: Running through setup()...
[06:38:51][D][esp32_ble_tracker:214]: Starting scan...
[06:38:51][C][wifi:037]: Setting up WiFi...
[06:38:52][I][wifi:245]: WiFi Connecting to 'rice_dwarf'...
[06:38:52][D][binary_sensor:036]: 'Duc hallway presence': Sending state OFF
[06:38:55][W][esp32_ble_tracker:085]: Too many BLE events to process. Some devices may not show up.
[06:38:55][I][wifi:502]: WiFi Connected!
[06:38:55][C][wifi:350]: Local MAC: xxxxxxxxx
[06:38:56][C][wifi:351]: SSID: 'rice_dwarf'
[06:38:56][C][wifi:352]: IP Address: 192.168.1.201
[06:38:56][C][wifi:354]: BSSID: E4:C3:2A:27:66:4F
[06:38:56][C][wifi:355]: Hostname: 'hallway'
[06:38:56][C][wifi:357]: Signal strength: -86 dB ▂▄▆█
[06:38:56][C][wifi:361]: Channel: 7
[06:38:56][C][wifi:362]: Subnet: 255.255.255.0
[06:38:56][C][wifi:363]: Gateway: 192.168.1.1
[06:38:56][C][wifi:364]: DNS1: 0.0.0.0
[06:38:56][C][wifi:365]: DNS2: 0.0.0.0
[06:38:56][C][ota:082]: Over-The-Air Updates:
[06:38:56][C][ota:083]: Address: 192.168.1.201:3232
[06:38:56][C][ota:086]: Using Password.
[06:38:56][W][ota:092]: Last Boot was an unhandled reset, will proceed to safe mode in 8 restarts
[06:38:56][C][api:025]: Setting up Home Assistant API server...
[06:38:56][C][mqtt:029]: Setting up MQTT...
[06:38:56][I][mqtt:174]: Connecting to MQTT...
[06:38:56][I][mqtt:214]: MQTT Connected!
[06:38:56][I][app:062]: setup() finished successfully!
[06:38:56][I][app:102]: ESPHome version 2021.12.3 compiled on Feb 3 2022, 08:17:58
[06:38:56][C][wifi:488]: WiFi:
[06:38:56][C][wifi:350]: Local MAC: xxxxx
[06:38:56][C][wifi:351]: SSID: 'rice_dwarf'
[06:38:56][C][wifi:352]: IP Address: 192.168.1.201
[06:38:56][C][wifi:354]: BSSID: E4:C3:2A:27:66:4F
[06:38:56][C][wifi:355]: Hostname: 'hallway'
[06:38:56][C][wifi:357]: Signal strength: -87 dB ▂▄▆█
[06:38:56][C][wifi:361]: Channel: 7
[06:38:56][C][wifi:362]: Subnet: 255.255.255.0
[06:38:56][C][wifi:363]: Gateway: 192.168.1.1
[06:38:56][C][wifi:364]: DNS1: 0.0.0.0
[06:38:56][C][wifi:365]: DNS2: 0.0.0.0
[06:38:56][C][logger:233]: Logger:
[06:38:56][C][logger:234]: Level: DEBUG
[06:38:56][C][logger:235]: Log Baud Rate: 115200
[06:38:56][C][logger:236]: Hardware UART: UART0
[06:38:56][C][template.sensor:023]: Template Sensor 'Duc Apple Watch hallway RSSI'
[06:38:56][C][template.sensor:023]: Device Class: 'signal_strength'
[06:38:56][C][template.sensor:023]: State Class: ''
[06:38:56][C][template.sensor:023]: Unit of Measurement: 'dBm'
[06:38:56][C][template.sensor:023]: Accuracy Decimals: 0
[06:38:56][C][template.sensor:024]: Update Interval: 60.0s
[06:38:56][C][template.sensor:023]: Template Sensor 'room_presence_debounce'
[06:38:56][C][template.sensor:023]: State Class: ''
[06:38:56][C][template.sensor:023]: Unit of Measurement: ''
[06:38:56][C][template.sensor:023]: Accuracy Decimals: 1
[06:38:56][C][template.sensor:024]: Update Interval: 60.0s
[06:38:56][C][template.binary_sensor:018]: Template Binary Sensor 'Duc hallway presence'
[06:38:56][C][template.binary_sensor:018]: Device Class: 'occupancy'
[06:38:56][C][esp32_ble_tracker:705]: BLE Tracker:
[06:38:56][C][esp32_ble_tracker:706]: Scan Duration: 300 s
[06:38:56][C][esp32_ble_tracker:707]: Scan Interval: 1200.0 ms
[06:38:56][C][esp32_ble_tracker:708]: Scan Window: 500.0 ms
[06:38:56][C][esp32_ble_tracker:709]: Scan Type: PASSIVE
[06:38:56][C][captive_portal:144]: Captive Portal:
[06:38:56][C][ota:082]: Over-The-Air Updates:
[06:38:56][C][ota:083]: Address: 192.168.1.201:3232
[06:38:56][C][ota:086]: Using Password.
[06:38:56][W][ota:092]: Last Boot was an unhandled reset, will proceed to safe mode in 8 restarts
[06:38:56][C][api:134]: API Server:
[06:38:56][C][api:135]: Address: 192.168.1.201:6053
[06:38:56][C][api:139]: Using noise encryption: NO
[06:38:56][C][mqtt:063]: MQTT:
[06:38:56][C][mqtt:065]: Server Address: 192.168.1.20:1883 (192.168.1.20)
[06:38:56][C][mqtt:066]: Username: 'mqttuser'
[06:38:56][C][mqtt:067]: Client ID: 'hallway-7c9ebdedc954'
[06:38:56][C][mqtt:072]: Topic Prefix: 'esphome/hallway'
[06:38:56][C][mqtt:074]: Log Topic: 'esphome/hallway/debug'
[06:38:56][C][mqtt:077]: Availability: 'esphome/hallway/status'
[06:38:56][C][mdns:084]: mDNS:
[06:38:56][C][mdns:085]: Hostname: hallway
[06:38:57][C][homeassistant.sensor:030]: Homeassistant Sensor 'HA RSSI Present Value'
[06:38:57][C][homeassistant.sensor:030]: State Class: ''
[06:38:57][C][homeassistant.sensor:030]: Unit of Measurement: ''
[06:38:57][C][homeassistant.sensor:030]: Accuracy Decimals: 1
[06:38:57][C][homeassistant.sensor:031]: Entity ID: 'input_number.duc_watch_present'
[06:38:57][C][mqtt.sensor:027]: MQTT Sensor 'HA RSSI Present Value':
[06:38:57][C][mqtt.sensor:031]: State Topic: 'esphome/hallway/sensor/ha_rssi_present_value/state'
[06:38:57][C][homeassistant.sensor:030]: Homeassistant Sensor 'HA RSSI Not Present Value'
[06:38:57][C][homeassistant.sensor:030]: State Class: ''
[06:38:57][C][homeassistant.sensor:030]: Unit of Measurement: ''
[06:38:57][C][homeassistant.sensor:030]: Accuracy Decimals: 1
[06:38:57][C][homeassistant.sensor:031]: Entity ID: 'input_number.duc_watch_not_present'
[06:38:57][C][mqtt.sensor:027]: MQTT Sensor 'HA RSSI Not Present Value':
[06:38:57][C][mqtt.sensor:031]: State Topic: 'esphome/hallway/sensor/ha_rssi_not_present_value/state'
[06:38:57][C][mqtt.binary_sensor:022]: MQTT Binary Sensor 'Duc hallway presence':
[06:38:57][C][mqtt.binary_sensor:023]: State Topic: 'esphome/hallway/binary_sensor/duc_hallway_presence/state'
[06:38:57][C][mqtt.sensor:027]: MQTT Sensor 'Duc Apple Watch hallway RSSI':
[06:38:57][C][mqtt.sensor:031]: State Topic: 'esphome/hallway/sensor/duc_apple_watch_hallway_rssi/state'
[06:43:51][I][ota:102]: Boot seems successful, resetting boot loop counter.
[06:43:51][D][esp32.preferences:114]: Saving preferences to flash...
[06:43:51][D][esp32_ble_tracker:214]: Starting scan...
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you commented.
|
Yes, no more logs. I also notice with that message it just stays like that for over 5 -10. Then it repeats with my wifi settings logs. |
I will try removing those two inputs and test again. During compiling, I am seeing these warnings. Ok to ignore them?
|
Removed the 2 lines as suggested. Doesn't seem to have any affect. Still stuck on starting scan.....
|
You can find watch by logging all bluetooth traffic and search for apple related sensors till you find your info. You do so by enabling
I don't know how well will it work on regular ESP32 as I used it on ethernet version. For my Apple Watch SE I had to set data_flags == 0x18 as it have this instead of data_flags == 0x98 when unlocked as in example. |
Hi @duceduc - I've tested a bunch of config changes on my ESP32 and HA, and I cannot get it to not detect my Watch. I'm using the exact same yaml as in this repo. My device is an ESP32-WROOM-32, in the "D1 mini" form factor. I did change my logging level to
It may be that some ESP's are a little slower (why?) and that is causing the bluetooth thread to not complete? |
I have switched over the a esp32 d1 mini just like the img you have in the read me file. Here are my log. Doesn't seems like my watch are being picked up still. config:
log:
|
Based on info you sent I think watch is ... 4C.00.10.05.03.18.XX.XX.XX as It's same as mine apple watch SE ...4C.00.10.05.06.18.XX.XX.XX and you need to change detection to use data_flags == 0x18) as below
|
Hi. Thanks for the help. I have changed the code as suggest above. Now in mqtt, I can see a sensor and the updating of rssi, but the binary_sensor is still Off even though the watch is right beside the node. My config settings is incorrect?? config:
|
You need to set values in HA in input_number.present and input_number.not_present or whatever your name for it is |
Yes, I have those in HA
|
And in UI you need to set them to value which you want to be marked as detected |
Sorry, I've looked back at the readme and I think the author had updated the code a bit. Is this what I need to change in the input_number??
|
Can you check if sensor from esphome have rssi present and not present values as you set them in HA? |
You lost me there. How do I check in esphome if esphome is seeing these 2 entities I've set in HA? |
Oh. I believe I don't have that because I have I have set discovery to be true. Seem to be working now. The binary sensor is switching to on or off and I do see the 2 sensors in HA. |
Hi @duceduc In case you run into this problem again, you can temporarily hard code the present/not presenth threshold values in the ESPHome yaml by changing substitutions:
roomname: hallway
static_ip: 192.168.1.201
yourname: Duc
rssi_present: id(harssi_present).state
rssi_not_present: id(harssi_not_present).state to something like substitutions:
roomname: hallway
static_ip: 192.168.1.201
yourname: Duc
rssi_present: -77
rssi_not_present: -90 The only reason HA sends threshold values to ESPHome is to make testing the values easier than recompiling each time you want to test new thresholds. But once you've found values that work you almost never need to change them so they could be hard coded in the ESPHome yaml. I'm going to close this issue now. If you need any more help feel free to reopen or post a new issue. |
Sorry for commenting on a closed issue. However I am stumbling upon the same problem and I can't figure out where to set discovery to true. @duceduc , could you point me in the right direction? |
Hi. You would need to add the discovery line in your esphome config file like so.
|
I am testing this script out and have used the same settings for the binary and sensor sensor settings.
In mqtt, I can see the binary sensor but the sensor does not appear. Also, the binary sensor is always in the OFF state even though my apple watch 3 is sitting right beside the esp32 node. I am assuming the node isn't detecting my watch??
The text was updated successfully, but these errors were encountered: