Skip to main content

pysesame-ble

PyPI version License Python Versions

A fast, 100% local Python library for controlling CANDY HOUSE Sesame smart locks and accessories over Bluetooth Low Energy (BLE) using bleak and standard cryptography.

Supported Devices

  • Locks:
    • Sesame 3, Sesame 4
    • Sesame 5, Sesame 5 Pro, Sesame 5 USA
    • Sesame 6, Sesame 6 Pro, Sesame 6 Pro Sliding Door
    • Sesame Bike Lock 1, Bike Lock 2, Bike Lock 3
  • Keypads & Biometric Readers:
    • Sesame Touch, Sesame Touch Pro, Sesame Touch 2, Sesame Touch 2 Pro
    • Sesame Face, Sesame Face Pro, Sesame Face 2, Sesame Face 2 Pro
    • Passcode, RFID/NFC Card, Fingerprint, Face, and Palm recognition management
  • Accessories:
    • Sesame Bot (Switch pusher)
    • Sesame Open Sensor (Door/Window magnet sensor)

Features

  • 100% Local & Offline: Direct communication over BLE. No cloud, Wi-Fi bridge, or internet access required.
  • Modern Security: Hardware-accelerated cryptographic handshakes via cryptography.hazmat (AES-CCM encryption, AES-CMAC session signing, and NIST P-256 ECDH).
  • Setup & QR Code Parsing: Parse and generate official ssm:// QR code URLs exported from the CANDY HOUSE mobile app.
  • Direct BLE Onboarding: Claim and register reset devices directly over BLE without needing the mobile app.
  • Asynchronous Architecture: Built on asyncio, bleak, and bleak-retry-connector.

Installation

pip install pysesame-ble

Quick Start

1. Control a Smart Lock

import asyncio
from uuid import UUID
from bleak import BleakScanner
from pysesame_ble import SesameLock, SesameAdData, find_sesame_device


async def main():
    mac = "AA:BB:CC:DD:EE:FF"
    secret_key = "0123456789abcdef0123456789abcdef"  # 16-byte hex secret key

    # Locate BLE device
    result = await find_sesame_device(mac)
    if not result:
        print("Device not found nearby")
        return
    ble_device, ad_data = result

    lock = SesameLock(ble_device, ad_data=ad_data, secret_key=secret_key)
    await lock.connect()
    await lock.login()

    print(f"Lock Battery: {lock.battery_percentage}% ({lock.battery_voltage}V)")
    print(f"Current Angle: {lock.current_angle}°, Locked: {lock.is_locked}")

    # Unlock the door
    await lock.unlock(history_name="Python Script")

    await asyncio.sleep(3)

    # Lock the door
    await lock.lock(history_name="Python Script")

    await lock.disconnect()


asyncio.run(main())

2. Parse a Setup QR Code (ssm://)

from pysesame_ble import SesameQRCode

qr_url = "ssm://UI?t=sk&sk=...&l=0&n=Front%20Door"
qr = SesameQRCode.from_url(qr_url)

print(f"Device Name: {qr.device_name}")
print(f"Model ID: {qr.model_id}")
print(f"UUID: {qr.device_uuid}")
print(f"Secret Key (Hex): {qr.secret_key.hex()}")

3. Scan for Nearby Sesame Devices

import asyncio
from pysesame_ble import scan_sesame_devices


async def main():
    devices = await scan_sesame_devices(timeout=5.0)
    for address, (ble_dev, ad_data) in devices.items():
        reg_status = "Registered" if ad_data.is_registered else "Unregistered"
        print(
            f"[{address}] Model: {ad_data.model_id}, Status: {reg_status}, UUID: {ad_data.device_uuid}"
        )


asyncio.run(main())

License

This project is licensed under the Apache License 2.0. See LICENSE for details.

Metadata

Release files for pysesame-ble 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pysesame-ble 0.1.1
File Size Uploaded
pysesame_ble-0.1.1.tar.gz 24.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pysesame-ble 0.1.1
File Interpreter ABI Platform
pysesame_ble-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 51.6 kB

Release files / pysesame_ble-0.1.1.tar.gz

Download URL pysesame_ble-0.1.1.tar.gz
Size 24.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ee882717fb986dccfaa1dc79e4e30f7a37beade9fc2cd519b2c6383c3238be68
BLAKE2b-256 checksum
How to use checksums
432b3f982ea2dadbcf55f2f903714f6257dd49ccfe940f2bd1508cb7bab1f836
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release files / pysesame_ble-0.1.1-py3-none-any.whl

Download URL pysesame_ble-0.1.1-py3-none-any.whl
Size 26.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de459f41647f16354a36fd910ac610c3eaa5cac35597dcf87a62622794370d46
BLAKE2b-256 checksum
How to use checksums
b89e9ee9563d2f9594417617dc6bc4f870c6e6fae6691a315029319bbaa6cf75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page