Getting started

Tedee Lock BLE API exposes resources that enable you to work with tedee lock. By calling relevant commands the user is able, among others, to manipulate lock, get battery level or read its activities. This guide aims to help you to get started with Tedee Lock BLE API.

What do you need?

Starting working with the lock’s BLE API does require some prerequisites. You’ll need:

  • Device that supports BLE 5.0 module to communicate with tedee lock correctly.

  • Security algorithms support.

Registration and authentication

Before you can use the BLE API you must:

  1. Register device on backend.

  2. Establish PTLS session. The process of establishing that session is described in dedicated section.

BLE API commands

To interact with the Tedee Lock BLE API, you can send the following commands:

Example request

  1. Form message for encryption,

Command Value

param

0x51 (UNLOCK_LOCK)

0x00 (NONE)

  1. Encrypt prepared message,

  2. Send it on API commands characteristic,

BLE API Response

On every command send on API commands characteristic you will get a response. You can also receive data from lock asynchronously via Notifications characteristic.

Note

Please omit the upper half byte of the message header as it is reserved on API commands characteristic and Notifications characteristic.

data[0] = data[0] & 0x0F

Response BLE frame

Message header

Content

DATA_NOT_ENCRYPTED

x bytes

Message header

Encrypted content

MAC (Message authentication code)

DATA_ENCRYPTED

x bytes

16 bytes

Example response

  1. Receive response on API commands characteristic,

  2. Decrypt received response discarding first header byte,

  3. Parse response

Response

0x00 (SUCCESS)