-
Notifications
You must be signed in to change notification settings - Fork 11
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
TTLock fails to load with multiple locks (since 0.4.x) #34
Comments
Thanks for the report @HerveB. Can you please turn on debug logging for the component (since HA 2023.4 you should be able to do this from the integration UI) and share the last few log lines before the error. Should look something like this:
I'd suggest removing adminPwd, lockKey, noKeyPwd and aesKeyStr as I have above since those are potentially sensitive bits of data. |
From the system logs:Logger: homeassistant.config_entriesSource: config_entries.py:1282 First occurred: 11:08:15 PM (2 occurrences) Last logged: 11:13:46 PMConfig entry 'TTLock' for ttlock integration not ready yet: 1 validation error for LockState state field required (type=value_error.missing); Retrying in background
|
@HerveB you'll need to put the extension into debug mode and probably reload it. The docs on how to do this are here: https://www.home-assistant.io/docs/configuration/troubleshooting/#enabling-debug-logging |
I tried to clean up the debug log and keep only TTLock items.

… On Apr 22, 2023, at 11:19 PM, Jonas Bergler ***@***.***> wrote:
@HerveB <https://github.com/HerveB> you'll need to put the extension into debug mode and probably reload it.
The docs on how to do this are here: https://www.home-assistant.io/docs/configuration/troubleshooting/#enabling-debug-logging
—
Reply to this email directly, view it on GitHub <#34 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEERIRSTHP2QBXSVB5HGTODXCSNSLANCNFSM6AAAAAAXIHKCCI>.
You are receiving this because you were mentioned.
|
Thanks, although I think replying via email may have dropped the data you attached, I only see  |
I uploaded the log file
… On Apr 22, 2023, at 11:50 PM, Jonas Bergler ***@***.***> wrote:
Thanks, although I think replying via email may have dropped the data you attached, I only see 
—
Reply to this email directly, view it on GitHub <#34 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEERIRQB24CFLP57FDY75YTXCSRJPANCNFSM6AAAAAAXIHKCCI>.
You are receiving this because you were mentioned.
|
Looks like the extension might be overwhelming the gateway, are all these locks attached to the same gateway? I'll definitely add some error handling and I'll see if I can do something about fetching the lockedState less aggressively |
I have 3 gateways.
Note that the last version 0.3.x worked fine. I was able to downgrade to fix the issue earlier.
… On Apr 22, 2023, at 11:59 PM, Jonas Bergler ***@***.***> wrote:
Looks like the extension might be overwhelming the gateway, are all these locks attached to the same gateway?
I'll definitely add some error handling and I'll see if I can do something about fetching the lockedState less aggressively
—
Reply to this email directly, view it on GitHub <#34 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEERIRUNJU5PZBKDLYR2GBDXCSSILANCNFSM6AAAAAAXIHKCCI>.
You are receiving this because you were mentioned.
|
@HerveB thanks for the logs, I've added some rate-limiting to the gateway access as well as improving the error handling. Please try v0.4.6, and let me know if the problem is fixed or not. |
The integration still fails to initialize. The new error message:
2023-04-23 00:42:49.554 DEBUG (MainThread) [custom_components.ttlock.api] [919a] Received response: status=200: body={'errcode': 1, 'errmsg': 'failed or means no', 'description': '表示失败或否'}
2023-04-23 00:42:49.554 DEBUG (MainThread) [custom_components.ttlock.api] [919a] API returned: {'errcode': 1, 'errmsg': 'failed or means no', 'description': '表示失败或否'}
2023-04-23 00:42:49.554 DEBUG (MainThread) [custom_components.ttlock.coordinator] Finished fetching ttlock data in 58.760 seconds (success: False)
… On Apr 23, 2023, at 12:31 AM, Jonas Bergler ***@***.***> wrote:
@HerveB <https://github.com/HerveB> thanks for the logs, I've added some rate-limiting to the gateway access as well as improving the error handling. Please try v0.4.6, and let me know if the problem is fixed or not.
—
Reply to this email directly, view it on GitHub <#34 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEERIRWWHLVB34CFA5LDR2DXCSWAVANCNFSM6AAAAAAXIHKCCI>.
You are receiving this because you were mentioned.
|
Hmm, that's a fairly cryptic error from the TTLock API. Could you send me the full logs again please? I added extra info to the logs to help me understand how the parallel requests are executing. It might be that its just hitting the API too fast now that it's setting up multiple locks in parallel. |
I’ll send you the new logs tomorrow however I am wondering what has changed between 0.3.x (works fine) and 0.4.x.
|
Thanks. "what has changed" -> almost everything, I rewrote most of the internals of the extension to support exposing multiple entities. If you could, would you also send me the logs from 0.3.x for me to compare. |
@stevenarmitage I suspect you're running into the same issue as was reported by @HerveB. |
This time there is very little in the logs:
2023-04-23 03:36:43.493 DEBUG (MainThread) [custom_components.ttlock.api] [b06f] Received response: status=200: body={'errcode': 1, 'errmsg': 'failed or means no', 'description': '表示失败或否'}
2023-04-23 03:36:43.494 DEBUG (MainThread) [custom_components.ttlock.api] [b06f] API returned: {'errcode': 1, 'errmsg': 'failed or means no', 'description': '表示失败或否’}
The integration doesn’t seem to be initializing properly. The option to enable debug logging appears only after several minutes and attempts to initialize,
… On Apr 23, 2023, at 12:52 AM, Jonas Bergler ***@***.***> wrote:
Hmm, that's a fairly cryptic error from the TTLock API.
Could you send me the full logs again please? I added extra info to the logs to help me understand how the parallel requests are executing. It might be that its just hitting the API too fast now that it's setting up multiple locks in parallel.
—
Reply to this email directly, view it on GitHub <#34 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AEERIRXPAT25SU6KUFOHCHLXCSYSDANCNFSM6AAAAAAXIHKCCI>.
You are receiving this because you were mentioned.
|
You can enable the debugging via your
|
I no longer have the ability to redownload version 0.3.x in HACS |
No worries, that log is actually pretty helpful. I think I have a quick fix for now to keep going when we hit these errors from the API and I'll spend some time later in the week to solve the problem properly. |
Great. I appreciate the work you have done on this integration! Thanks! |
Hopefully v0.4.7 gets you past this problem for now. You'll probably see some of your locks not report a locked/unlocked status for the first 15 minutes after restarting home assistant. |
0.4.7 seems to be working |
I tried this integration with 0.4.8 and get an error after setting it up: I use a gateway G2 with 2 locks. In the log i didn't found a callback url. i think it's because the validation of the locks failed. |
@ortwin20000 I'll need the debug logging to help with this. Could you please turn debug logging on for the integration and then open a new issue? |
I get the following error message:
Retrying setup: 1 validation error for LockState state field required (type=value_error.missing)
0.3.x was working fine. I deleted the entities when I upgraded to 0.4.3 and go the error above. Same error persisted with 0.4.4 and 0.4.5
The text was updated successfully, but these errors were encountered: