Skip to content
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

Home Assistant Watch is Unlocked Sensor #11

Open
romanpeters opened this issue Dec 30, 2021 · 3 comments
Open

Home Assistant Watch is Unlocked Sensor #11

romanpeters opened this issue Dec 30, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@romanpeters
Copy link

Hi,
I noticed it's possible to tell if the Watch is locked or unlocked.

I would like to track my Watch, but I also want to know when my Watch is in the room but it's charging.
That way I can adjust my presence automations accordingly when I'm not wearing it.

Ideally whether the Watch is unlocked would be an attribute of the presence binary_sensor in Home Assistant, or alternatively a separate binary_sensor.

Is it possible to add this functionality through the ESPHome YAML configuration?

@dalehumby
Copy link
Owner

Hi @romanpeters - Sorry for the delay replying. I'm in the process of moving homes and all my home automation stuff is still in transit until mid-Feb. This is a nice idea. I can look at it then.

In the meantime, which Apple Watch series do you have? As far as I can tell, not all of them change state when locked/unlocked. Does the sensor in HA for your watch change to 'not present' when you take it off, after a short while?

Could you give an example of the different automations that your would run based on your presence (wearing a watch) vs watch charging (not wearing the watch)?

@dalehumby dalehumby self-assigned this Jan 29, 2022
@romanpeters
Copy link
Author

I'm using a Series 4. I just tested it and once my watch locks, the sensor does not update any more, but stays on its last measurement from before locking.

I usually charge my watch first thing in the morning, so my use case would be to use it as a trigger for my morning routine.

@dalehumby dalehumby added the enhancement New feature or request label Feb 15, 2022
@dalehumby
Copy link
Owner

Hi @romanpeters - Thanks for the info. Could you try changing line 60 to be

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

This will at least detect your watch when it's both locked and unlocked. If this doesnt work, please send

  • what watch model you have. If possible, install LightBlue app on your iPhone, open app, connect to your Watch, and under "Device Information" send me "Model Number String" (something like Watch6,6)
  • esphome yaml file
  • debug log with very verbose logging switched on (add the following to your yaml file)
logger:
  level: VERY_VERBOSE

As an enhancement, I could look at sending a flag to HA of whether the watch is locked/unlocked, and then you could run an automation when the status changes from unlocked to locked (when you take it off for your morning routine.)

@dalehumby dalehumby added the question Further information is requested label Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants