TTLOCK Integration with HA

The log looks like this after every try

Peripheral connect start
Monitor started
Peripheral connect triggered
Peripheral connect error: Error: connection canceled!
    at Peripheral.cancelConnect (/app/node_modules/@abandonware/noble/lib/peripheral.js:61:26)
    at NobleDevice.connect (/app/node_modules/ttlock-sdk-js/dist/scanner/noble/NobleDevice.js:91:37)
    at async TTBluetoothDevice.connect (/app/node_modules/ttlock-sdk-js/dist/device/TTBluetoothDevice.js:47:17)
    at async TTLock.connect (/app/node_modules/ttlock-sdk-js/dist/device/TTLock.js:53:27)
    at async Manager._connectLock (/app/src/manager.js:583:21)
    at async Manager.initLock (/app/src/manager.js:163:13)
    at async WebSocket.<anonymous> (/app/api/index.js:52:30)
Connect failed
Lock connect failed
Connect to lock failed 79:7F:C3:EB:7F:38

Everything is clear now, I received the gate and lock, just enter ttlockclientid as in the documentation: ttlockclientid and
ttlocktoken and everything works for me.

I went through setup from ttlock in hacs - and when i try to unlock the lock it says “Failed to call service lock/unlock. API returned: {‘errcode’: -4043, ‘errmsg’: ‘The function is not supported for this lock.’, ‘description’: ‘此锁不支持该操作。’}”

it talks about the callback url but i did not see any notification at all or know where to get it from. i see where to enter it in the tt lock web app.

EDIT : i had to go to ttlock app on my phone and enable remote unlock and it works now! :slight_smile:

1 Like

Hi

I’ve succesfully integrated a Simpled Lock with TTLock in HA, and can Lock/Unlock and see the battery state. Unfortunately, I can’t see how to change or add pass codes. Appologies if the solution is in the depths of this thread.

Thanks

EDIT: Silly me, I found the services:

TTLock: Create a new pass code
TTLock: Remove expired passcodes
TTLock: Configure passage mode

Brilliant!

Followed the first three steps
At step 2. Hit Managament top right of Open Platform to get client_id and Client secret

Where do you register the user??

And what is this
curl -i -X POST -d “clientId=XXXXXXX&clientSecret=YYYYYYYYY&username=IOS_USERNAME&password=PASS_IN_MD5_FORMAT&date=date +%shttps://api.ttlock.com/v3/user/register

I am not a HA developer so I need simpler instructions to follow.

Amy clarification would be appreciated.
Ash

For clarification
a) What MD5 encrypted password? Where did this come from?
b) What is the username as I have not seen a user name? I have seen and account a name, an nickname, an email, afew others but no username. Is this in the TTlock web site of the TTlock iphone app?
c) None of the cut/paste into Terminal went sucessfully but lest solve a& b first.

Could you clarify where the encrypted passwrod is and what is the username?
Much appreciated
Ash

Hi Ash,

What exactly have you done so far?

This works great!
I’m trying to get an automation
Depending on the sensor
Sensor.door_last_operator
So it only triggers if the finger “Right thumb” is used but can’t get it to work.
Any ideas?

Does anyone know of a way to message my phone the name of the last user to unlock the door? I can create a trigger easily to respond to the door being unlocked, but it’s the content of the message that I can’t fathom out.

Hi, are there any ways to do this ? ones that doesnt depend on their cloud ? worried they might disappear one day and render the lock useless

Hi @MadMirza, I am having the same issues you mentioned and have reread the post by @seba.olah several times but still unable to make sense of things.

I did successfully transfer my lock to the created user with the same password as developer account. I can now access that lock through the HA CLI / CURL.

but I cannot log into that account on any platform (web/ios/TTLockHACS integration/etc)

How did you get past this issue?
Thanks!

EDIT:
Finally finally solved it. Even though I was absolutely using the right password, I just reset the password through the CLI/Postman and then was immediately able to log in everywhere with the new password and created username.

Documentation on how to reset password