jbergler / hass-ttlock

Home Assistant integration for TTLock locks
65 stars 13 forks source link

Callback no longer works #128

Closed PedroDelCargo closed 3 months ago

PedroDelCargo commented 3 months ago

Describe the bug

From yesterday, no callback data reaches Home assistant (ie: lock unlocked notification) It seems that ttlock changed something in callback protocol. When testing callback URL on ttlock platform, I get the following error : Callback url test failed:javax.net.ssl.SSLException : Received fatal alert: protocol_version

mrahmadt commented 3 months ago

Not sure if it's the same issue

I enabled debug for hass-ttlock, I can see below logs when I test from ttlock platform


2024-07-28 23:29:29.632 DEBUG (MainThread) [custom_components.ttlock] Got webhook data: <MultiDictProxy('lockId': '222', 'notifyType': '1', 'records': '[{"lockId":232332,"electricQuantity":85,"serverDate":1722198569590,"recordTypeFromLock":4,"recordType":4,"success":1,"lockMac":"22:22:22:22:22:22","keyboardPwd":"123456","lockDate":1722198569590}]', 'admin': 'test@ttlock.com', 'lockMac': '22:22:22:22:22:22')>

But I'm getting nothing in the log when I unlock and lock the door manually.

I also can see hass-ttlock connection to ttlock platform

2024-07-28 23:21:45.598 DEBUG (MainThread) [custom_components.ttlock.api] [a086] Sending request to https://euapi.ttlock.com/v3/lock/detail with args={'lockId': 3333}
2024-07-28 23:21:45.716 DEBUG (MainThread) [custom_components.ttlock.api] [a086] Received response: status=200: body={'date': 1715099412000, 'lockAlias': 'Outdoor', 'lockSound': 2, 'modelNum': 'SN9274-D-WIFI_PV53', 'lockMac': '69:DF:5F:D0:74:E2', 'privacyLock': 1, 'deletePwd': '', 'featureValue': '810C2F44754CF5F7', 'adminPwd': 'as dada', 'soundVolume': 5, 'hasGateway': 1, 'autoLockTime': 30, 'wirelessKeypadFeatureValue': '0', 'lockKey': 'sadasdasd', 'isFrozen': 2, 'lockName': 'M302_e274d0', 'resetButton': 1, 'firmwareRevision': '6.6.11.240508', 'tamperAlert': 1, 'specialValue': 23423423, 'displayPasscode': 0, 'noKeyPwd': '32432424', 'passageMode': 2, 'passageModeAutoUnlock': 2, 'doubleVerification': 2, 'timezoneRawOffset': 10800000, 'lockId': 13848777, 'electricQuantity': 85, 'lockFlagPos': 0, 'lockUpdateDate': 1722016109000, 'keyboardPwdVersion': 4, 'aesKeyStr': '0b,2a,a1,4xxxxxxxx,xxxx,df,xx,91', 'hardwareRevision': '1.2', 'openDirection': 2, 'lockVersion': {'groupId': 1, 'protocolVersion': 3, 'protocolType': 5, 'orgId': 1, 'scene': 2}, 'sensitivity': -1}
jbergler commented 3 months ago

Thanks for the debug info, but I'm not sure this is the same problem.

If the test button on ttlock's website works, that suggests all the plumbing is right. The original report has an SSL error, which suggests that there is some problem on @PedroDelCargo's side (maybe requiring TLS1.3 and ttlock doesn't support that?)

For your issue @mrahmadt I don't have any insight/control over the events coming from the lock unless the ttlock cloud sends the webhook.

For both issues, I don't know if theres much I can do unfortunately.

mrahmadt commented 3 months ago

Thanks @jbergler

I can confirm my issue is just the behavior of the lock, it will not call webhook if I open the lock manually, but if I open the door using NFC tag it's working fine

PedroDelCargo commented 3 months ago

The original report has an SSL error, which suggests that there is some problem on @PedroDelCargo's side (maybe requiring TLS1.3 and ttlock doesn't support that?)

Thanks @jbergler, your were right, the problem was on my side. I had changed SSL/TLS settings on my server and that was the origin of the issue. Sorry for disturbing for nothing and thanks for your help.