-
Notifications
You must be signed in to change notification settings - Fork 13
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 Lock Status #72
Comments
I have same problem. My setup described here #1 (comment) |
Same issue with mine: I got my Hornbill lock from Amazon to show up in Home Assistant. I can lock and unlock through Home Assistant. Sometimes on the first attempt, I get call service failed. It works on the second try. However, the state of the lock only updates when locking/unlocking through Home Assistant. The state of the lock does not update itself when operating the lock manually or on the TTLock app even after a month of testing thus far. The other sensors are as follows: |
I'm not sure about the door sensor, I don't have one myself and some of the events get notifications via the ebhook, while others (like auto lock after a configured delay) don't get notifications and need a local implementation within the integration to emulate the status changes. First question is the webhook setup and working for you? If you're not seeing the trigger/operator sensors updating its unlikely. What I think I'd need is some pretty detailed logging - easiest way is probably to put this in your
Just a warning though - I'm reasonably busy through til Christmas, so I don't know if I'll find the time to do much with the logs before then but I'll do my best. |
The same issue; I didn't receive the notification with the webhook URL to use as Callback on TTLOCK portal; how to view the URL? |
The notification should return until the first time it gets hit, if you want to look it up after that check your home assistant logs, should look something like this
|
I've noticed the lock status is always incorrect unless I use it only on HomeAssistant, but that's not gonna work when people unlock the door without it.. |
I have the same issue. The lock is set to auto lock after 5 seconds, but it seems that the integration doesn't poll the lock for its status at all. If i use the app and check the status , i can see that it indeed unlocks ok via home assistant, and checking it again 5 seconds later it says it is locked again, but HA still says it is unlocked. so it seems that it is either not checking the status again or maybe the plugin doesn't support polling for status. ?? also last used and last operator are always "unknown" edit: ok i didn't do the callback url thing. added that and the status seems to be ok , as does last operator etc. |
Hi, I turned on debug mode and looked at the logs and it seems TTLock web hook only reports a lock being unlocked but not locked, I am however getting an additional web hook record for my TTLock door sensor, first it would be nice to get a binary sensor based on this data telling HA when the door is open or closed, secondly you could infer from the door closed message that the lock has engaged as until this point my lock has always locked itself after the sensor reported closed. I am attaching the logs of the door sensor web hook to aid in figuring out how it operates.
Edit: This gives me the basic behavior I want of HA detecting when the door is locked again but obviously a proper door sensor implementation will be greatly appreciated. |
Im reporting the same issue as well with Lock. Any updates on this?? |
I'm also having the same problem. Is there any solution? |
@pazoozoo123 thanks for providing logs that's starting to help paint a picture of what's going on here. This log message suggests that the integration doesn't think the lock has auto lock configured.
I need to get the reported configuration of the lock to dig into this further. Are you able to share a new set of logs, this time including the initial fetch of the lock details when the integration reloads? |
I turned on debug mode in the integration and reloaded it, here is what the logs contained:
Indeed I don't have auto lock enabled, it is currently set to disabled, the lock still auto locks it self because of the attached door sensor when it detects the door is closed. |
Yeah that makes sense. What is the ‘featureValue’ for these locks? It’s easy enough to plumb the door sensor closed message up so that it marks the door as locked but I don’t know if it’s safe to assume that closing the door also results in it being locked? Is that configurable? |
The feature value is:
After adding the DS2 ttlock door sensor to the lock using the app the only options available are: |
Same issue with my setup. I did use the callback url but when unlocking by fingerprint when the lock relocks HA does not get a updated status. I noticed in the logs on lock2.ttlock.com it only logs unlocks unless you manually lock the lock. Maybe this is why? |
I got the same problem here =[ |
Same issue here. Webhook URL setup appeared to work fine and no errors in log. Lock will unlock from HA web interface as expected. However, it's set to auto lock after 5 seconds, and when this happens the HA status still shows 'unlocked'. Re-loading the TT Lock integration fixes the issue and the status is correctly reset to 'locked'. Also, when logging in at lock2.ttlock.com I can see all unlocking history, but agree with earlier poster that auto-lock events aren't shown. However, the lock status reported in that web UI does update and always shows the correct status, so I assume it should be possible to be pulling the correct status. No idea of an auto lock event triggers the webhook, perhaps that's the issue, given reloading the integration (which I assume pulls a fresh status) does capture the correct lock status. Edit: Further to my above comments, the status did update back to 'locked'! It just took 5 minutes after the door auto-locked. Is the webhook setup supposed to update the status faster than that? |
If the lock has a door sensor then it is safe to assume it's locked when closed. This setting is not configurable. |
From a design perspective, I'd prefer not to rely on the query endpoints as these make calls to the lock, which ends up destroying battery life if we poll it. I think in terms of implementing this the process is something like:
|
As far as featureValue 13 I'm pretty sure that is just an indication of whether the lock has door sensor capabilities (which 3 out of the 4 I have have) not if the lock HAS a door sensor, so I'm not sure if there's any point using that info, but totally your call. |
Could you share the feature value from a lock that has the capability but no sensor attached and another one with a sensor attached? That'd be useful in understanding the behavior. I agree we can make the call on startup, but since the APIs are rate limited we want to avoid hitting it if we can avoid it. |
@jbergler After setting up a notebook to query the API, bit 13 for me is a 1. Tomorrow I'll disconnect the sensor from the lock and see if it changes to a 0. That'd be a good test of validity for that bit. |
FWIW, querying the queryOpenState endpoint returns the following for my lock with the connected sensor: {'state': 0, 'sensorState': 1} That's door locked and closed. When open, I get: {'state': 0, 'sensorState': 0} and apparently, when I am too far away from the door lock, testing the sensor in another room, I get this: {'state': 0} I imagine that if there isn't a valid sensor reading, the |
Does the API/webhook give a status update when status has changed?
This is probably necessary to expose the
Agreed
I'd suggest a new
Agreed |
However, the state of the lock only updates when locking/unlocking through Home Assistant or the TTLock APP. The state of the lock does not update itself in HA when operating the lock manually or via the TTLock app.
Can I update how often the lock status updates Home Assistant?
Originally posted by @jxbrown in #1 (comment)
The text was updated successfully, but these errors were encountered: