homebridge-smart-lock-ttlock
v1.0.1
Published
Use smart locks with TTLock platform on Homebridge.
Maintainers
Readme
Homebridge Smart Lock TTLock Platform
Requirements
- Lock/door handle using TTLock Platform (Wifi, or Bluetooth + Gateway)
- Smart Lock TTLock Bluetooth - Compatible Gateway (G1, G2, G3, or G4).
- TTLock app for iOS or Android
- Bash access to run curl command
Setup Instructions
Create TTLock Developer Account
- Go to TTLock Platform Registration. If you have previously used the lock with the app, you'll have to use the same account to create the app.
- Complete the required information to create a developer account for API access.
- Wait for the email confirming activation of your account (manual process that will be completed by TTLock).
- Create application and wait for approval.
- Log back into the TTLock Developer Platform and retreive your ClientId and ClientSecret.
- You'll have to submit the password as md5 with the api(use this site).
curl --location --request POST 'https://euapi.ttlock.com/v3/user/register?clientId=[clientid]&clientSecret=[clientsecret]&username=[username]&password=[passwordasmd5]&date=CURRENTMILLIS' \
--header 'Content-Type: application/x-www-form-urlencoded' \Associate Lock and Gateway with New Account
- Log into the TTLock iOS or Android app with your account.
- Add your lock(s) to the app to accociate them with your account.
- If using Bluetooth, add the gateway (and ensure it is associated with the locks).
Plugin Installation
Recommended: install via the Homebridge UI
Or install the plugin with the following command:
npm install -g homebridge-smart-lock-ttlockConfiguration
{
"name": "Smart Lock TTLock Platform",
"batteryLowLevel": 15,
"maximumApiRetry": 2,
"requestTimeoutMs": 7000,
"apiRetryIntervalMs": 500,
"postActionRefreshDelayMs": 2900,
"username": "username",
"password": "passwordasmd5",
"clientid": "clientid",
"clientsecret": "clientsecret",
"platform": "smart-lock-ttlock",
"_bridge": {
"username": "0E:54:DD:3B:09:30",
"port": 51221,
"name": "Smart Lock TTLock Platform"
}
}name: Platform name
clientid: TTLock Open Platform clientId.
clientsecret: TTLock Open Platform clientSecret.
username: TTLock app account username.
password: MD5 hash of your TTLock account password.
batteryLowLevel: Battery percentage at or below which HomeKit shows a low battery warning.
maximumApiRetry: Maximum number of attempts per TTLock API request.
requestTimeoutMs: HTTPS timeout for TTLock API requests.
apiRetryIntervalMs: Delay between TTLock network retry attempts.
postActionRefreshDelayMs: Delay before the second API request that re-reads the real lock state after a lock or unlock command.
Usage
- On Homebridge load, plugin will get all locks from TTLock account and add them to Homebridge (if they are not already cached)
- Use Homekit to lock and unlock your locks!
- Homekit will show warning when lock has low battery (customize in plugin configuration)
