npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-ttlock

v1.1.0

Published

Use locks with TTLock platform on Homebridge.

Downloads

34

Readme

Homebridge TTLock Plugin

github checks github release npm version npm downloads

Requirements

  1. Lock/door handle using TTLock Platform (Wifi, or Bluetooth + Gateway)
  2. If using Bluetooth - TTLock Compatible Gateway (G1, G2, G3, or G4). Successfully tested with this one
  3. TTLock app for iOS or Android
  4. Bash access to run curl command

Setup Instructions

Create TTLock Developer Account

  1. Go to TTLock Platform Registration.
  2. Complete the required information to create a developer account for API access.
  3. Wait for the email confirming activation of your account (manual process that will be completed by TTLock).
  4. Log back into the TTLock Developer Platform and retreive your ClientId and ClientSecret.

Create a New User on Developer Account

  1. Make up a new username. Creating a new user account is required! It must be associated with your developer account (unfortunately you can't use an account you've already set up on the TTLock app).
  2. Come up with a password and save it somewhere. When you submit the request to create the new user, you'll have to submit the password as md5 (use this site).
  3. Using a terminal, run this command to create the new user on your developer account:
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' \
  1. In the response to the request, note the username that is assigned (it will be your username prefixed with some random characters). This will be the username you'll use to log into the mobile app and the Homebridge plugin from now on.

Associate Lock and Gateway with New Account

  1. Log into the TTLock iOS or Android app with your new account. You'll use the username that the API call returned, and the password you created (NOT as md5).
  2. Add your lock(s) to the app to accociate them with your account. If you have previously used the lock with the app, you'll have to reset and add it to the new account.
  3. If using Bluetooth, add the gateway (and ensure it is associated with the locks).
  4. Important -In the settings for each lock, ensure the Remote Unlock setting is set to On.

Plugin Installation

Recommended: install via the Homebridge UI

Or install the plugin with the following command:

npm install -g homebridge-ttlock

Configuration

        {
            "platform": "ttlock"
            "name": "TTLock Platform",
            "clientid": "clientid",
            "clientsecret": "clientsecret",
            "username": "username",
            "password": "passwordasmd5",
            "batteryLowLevel": 15,
            "maximumApiRetry": 5;
        }

name: Platform display name

clientid: Your ClientId from the TTLock developer platform.

clientsecret: Your ClientSecret from the TTLock developer platform.

username: Username for the user account accociated with the developer account.

password: Password for the user account as md5.

batteryLowLevel: The battery level percentage at which a low battery warning will be displayed in the HomeKit status.

maximumApiRetry: Maximum times to retry hitting the API.

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)

Planned Backlog

  • Better handle condition when gateway is busy
  • Expose each lock to config and allow more customization